mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Additional tests for kernelparams.
This commit is contained in:
parent
0776274479
commit
48b182cf84
1 changed files with 18 additions and 0 deletions
|
@ -3215,6 +3215,24 @@ def test_kernelparams_return_linux_non_utf8():
|
|||
assert core.kernelparams() == expected
|
||||
|
||||
|
||||
@pytest.mark.skip_unless_on_linux
|
||||
def test_kernelparams_file_not_found_error():
|
||||
with patch("salt.utils.files.fopen", MagicMock()) as fopen_mock:
|
||||
fopen_mock.side_effect = FileNotFoundError()
|
||||
ret = core.kernelparams()
|
||||
assert ret == {}
|
||||
|
||||
|
||||
@pytest.mark.skip_unless_on_linux
|
||||
def test_kernelparams_oserror(caplog):
|
||||
with patch("salt.utils.files.fopen", MagicMock()) as fopen_mock:
|
||||
with caplog.at_level(logging.DEBUG):
|
||||
fopen_mock.side_effect = OSError()
|
||||
ret = core.kernelparams()
|
||||
assert ret == {}
|
||||
assert "Failed to read /proc/cmdline: " in caplog.messages
|
||||
|
||||
|
||||
def test_linux_gpus(caplog):
|
||||
"""
|
||||
Test GPU detection on Linux systems
|
||||
|
|
Loading…
Add table
Reference in a new issue