コード例 #1
0
 def test_kernel_versions_debian(self):
     '''
     Test kernel version debian
     '''
     mock = MagicMock(return_value='  Installed: 4.9.82-1+deb9u3')
     with patch.dict(restartcheck.__grains__, {'os': 'Debian'}):
         with patch.dict(restartcheck.__salt__, {'cmd.run': mock}):
             self.assertListEqual(restartcheck._kernel_versions_debian(), ['4.9.82-1+deb9u3'])
コード例 #2
0
ファイル: test_restartcheck.py プロジェクト: vin01/salt
 def test_kernel_versions_debian(self):
     """
     Test kernel version debian
     """
     mock = MagicMock(return_value="  Installed: 4.9.82-1+deb9u3")
     with patch.dict(restartcheck.__grains__, {"os": "Debian"}):
         with patch.dict(restartcheck.__salt__, {"cmd.run": mock}):
             self.assertListEqual(restartcheck._kernel_versions_debian(),
                                  ["4.9.82-1+deb9u3"])
コード例 #3
0
 def test_kernel_versions_ubuntu(self):
     '''
     Test kernel version ubuntu
     '''
     mock = MagicMock(return_value='  Installed: 4.10.0-42.46')
     with patch.dict(restartcheck.__grains__, {'os': 'Ubuntu'}):
         with patch.dict(restartcheck.__salt__, {'cmd.run': mock}):
             self.assertListEqual(restartcheck._kernel_versions_debian(),
                                  ['4.10.0-42.46', '4.10.0-42-generic #46', '4.10.0-42-lowlatency #46'])
コード例 #4
0
ファイル: test_restartcheck.py プロジェクト: vin01/salt
 def test_kernel_versions_ubuntu(self):
     """
     Test kernel version ubuntu
     """
     mock = MagicMock(return_value="  Installed: 4.10.0-42.46")
     with patch.dict(restartcheck.__grains__, {"os": "Ubuntu"}):
         with patch.dict(restartcheck.__salt__, {"cmd.run": mock}):
             self.assertListEqual(
                 restartcheck._kernel_versions_debian(),
                 [
                     "4.10.0-42.46",
                     "4.10.0-42-generic #46",
                     "4.10.0-42-lowlatency #46",
                 ],
             )