@@ -970,8 +970,8 @@ class TestKernelVersion(_CheckTestBase):
970
970
971
971
def test_success (self , capsys ):
972
972
"""Test the success case."""
973
- result , output = self .perform_check (capsys , cmd_effects = "4.1 " )
974
- assert textwrap .dedent (output ) == "PASS -- Kernel version (4.1 )\n "
973
+ result , output = self .perform_check (capsys , cmd_effects = "4.6 " )
974
+ assert textwrap .dedent (output ) == "PASS -- Kernel version (4.6 )\n "
975
975
assert result is CheckState .SUCCESS
976
976
977
977
def test_subproc_error (self , capsys ):
@@ -982,7 +982,7 @@ def test_subproc_error(self, capsys):
982
982
assert textwrap .dedent (output ) == textwrap .dedent (
983
983
"""\
984
984
ERROR -- Kernel version
985
- Unable to check the kernel version with command 'uname -r' - must be at least version 4.0
985
+ Unable to check the kernel version with command 'uname -r' - must be at least version 4.6
986
986
"""
987
987
)
988
988
assert result is CheckState .ERROR
@@ -995,18 +995,29 @@ def test_no_version_match(self, capsys):
995
995
assert textwrap .dedent (output ) == textwrap .dedent (
996
996
"""\
997
997
ERROR -- Kernel version
998
- Unable to check the kernel version with command 'uname -r' - must be at least version 4.0
998
+ Unable to check the kernel version with command 'uname -r' - must be at least version 4.6
999
999
"""
1000
1000
)
1001
1001
assert result is CheckState .ERROR
1002
1002
1003
- def test_old_version (self , capsys ):
1003
+ def test_old_major_version (self , capsys ):
1004
1004
"""Test the version being too old."""
1005
1005
result , output = self .perform_check (capsys , cmd_effects = "3.9.8" )
1006
1006
assert textwrap .dedent (output ) == textwrap .dedent (
1007
1007
"""\
1008
1008
FAIL -- Kernel version
1009
- The kernel version is 3.9, but at least version 4.0 is required.
1009
+ The kernel version is 3.9, but at least version 4.6 is required.
1010
+ """
1011
+ )
1012
+ assert result is CheckState .FAILED
1013
+
1014
+ def test_old_minor_version (self , capsys ):
1015
+ """Test the version being too old."""
1016
+ result , output = self .perform_check (capsys , cmd_effects = "4.5" )
1017
+ assert textwrap .dedent (output ) == textwrap .dedent (
1018
+ """\
1019
+ FAIL -- Kernel version
1020
+ The kernel version is 4.5, but at least version 4.6 is required.
1010
1021
"""
1011
1022
)
1012
1023
assert result is CheckState .FAILED
0 commit comments