Support Debian
This commit is contained in:
parent
5a9997058d
commit
08d16574fc
2 changed files with 34 additions and 3 deletions
|
@ -16,6 +16,11 @@ import check_kernel
|
|||
|
||||
|
||||
class CleanKernelVersionTestCase(unittest.TestCase):
|
||||
def testDebian(self):
|
||||
versions = [('3.16.7-ckt9-3~deb8u2', '3.16.7-ckt9-3~deb8u2')]
|
||||
for dirty, clean in versions:
|
||||
self.assertEqual(clean_kernel_version(dirty), LooseVersion(clean))
|
||||
|
||||
def testFedora(self):
|
||||
versions = [('4.0.4-301.fc22.x86_64', '4.0.4-301'),
|
||||
('4.0.0-1.fc22', '4.0.0-1')]
|
||||
|
@ -29,6 +34,11 @@ class RunningKernelVersionTestCase(unittest.TestCase):
|
|||
self.assertEqual(check_kernel.running_kernel_version(),
|
||||
LooseVersion('4.0.3-301'))
|
||||
|
||||
def testDebian(self):
|
||||
with unittest.mock.patch.object(check_kernel, 'proc_version', return_value='Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24)'):
|
||||
self.assertEqual(check_kernel.running_kernel_version(),
|
||||
LooseVersion('3.16.7-ckt9-3~deb8u1'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue