🐛 fix getting debian version for bullseye
This commit is contained in:
parent
1cb5f3aa2c
commit
e5738cadf0
2 changed files with 5 additions and 2 deletions
|
@ -70,8 +70,7 @@ def running_kernel_version():
|
||||||
|
|
||||||
if re.search('Debian', proc_version_):
|
if re.search('Debian', proc_version_):
|
||||||
# Remove gcc version first
|
# Remove gcc version first
|
||||||
proc_version_ = re.sub('\(gcc[^(]+\(Debian [^)]+\)\s*\)', '',
|
proc_version_ = re.sub('\(gcc.*?\)', '', proc_version_)
|
||||||
proc_version_)
|
|
||||||
|
|
||||||
# Then look for the Debian kernel version
|
# Then look for the Debian kernel version
|
||||||
m = re.search('(?<=Debian )(\S+)', proc_version_)
|
m = re.search('(?<=Debian )(\S+)', proc_version_)
|
||||||
|
|
|
@ -57,6 +57,10 @@ class RunningKernelVersionTestCase(unittest.TestCase):
|
||||||
self.assertEqual(check_kernel.running_kernel_version(),
|
self.assertEqual(check_kernel.running_kernel_version(),
|
||||||
Version('2.6.32-48squeeze11'))
|
Version('2.6.32-48squeeze11'))
|
||||||
|
|
||||||
|
patch_object(check_kernel, 'proc_version', return_value='Linux version 5.10.0-8-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.46-4 (2021-08-03)')
|
||||||
|
self.assertEqual(check_kernel.running_kernel_version(),
|
||||||
|
Version('5.10.46-4'))
|
||||||
|
|
||||||
|
|
||||||
class VersionTestCase(unittest.TestCase):
|
class VersionTestCase(unittest.TestCase):
|
||||||
def testStr(self):
|
def testStr(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue