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'])
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"])
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'])
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", ], )