diff options
author | Didier Raboud <odyx@debian.org> | 2013-06-05 12:27:33 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2013-06-05 12:30:21 +0200 |
commit | 5fc63d832bb2ebd403dc0b7f5aad0db5683b8b91 (patch) | |
tree | 7a500c6475e59a6aee94a5e3748705b6c26ad20e /test | |
parent | ca4918edbd7dc9c7af915c76d3a8cc22110e1cef (diff) |
Fix lsb_release to correctly work with stable release updates incrementing the second digit from Wheezy on.
Also fix the test cases to cover that.
Closes: #711174
Diffstat (limited to 'test')
-rw-r--r-- | test/test_lsb_release.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test_lsb_release.py b/test/test_lsb_release.py index d100c21..c449a4b 100644 --- a/test/test_lsb_release.py +++ b/test/test_lsb_release.py @@ -40,6 +40,9 @@ class TestLSBRelease(unittest.TestCase): cdn = lr.RELEASE_CODENAME_LOOKUP[rno] # Test that 1.1, 1.1r0 and 1.1.8 lead to buzz. Default is picked randomly and is not supposed to go trough badDefault = rnd_string(0,9) + # From Wheezy on, the codename is defined by the first number but a dot-revision is mandatory + if float(rno) >= 7: + rno = rno + '.' + str(random.randint(0,9)) self.assertEqual(lr.lookup_codename(rno,badDefault),cdn,'Release name `' + rno + '` is not recognized.') self.assertEqual(lr.lookup_codename(rno + 'r' + str(random.randint(0,9)),badDefault),cdn,'Release name `' + rno + 'r*` is not recognized.') self.assertEqual(lr.lookup_codename(rno + '.' + str(random.randint(0,9)),badDefault),cdn,'Release name `' + rno + '.*` is not recognized.') @@ -241,7 +244,11 @@ class TestLSBRelease(unittest.TestCase): # Test "stable releases" with numeric debian_versions for rno in lr.RELEASE_CODENAME_LOOKUP: - distinfo['RELEASE'] = rno + random.choice('.r') + str(random.randint(0,9)) + # From Wheezy on, the codename is defined by the first number but a dot-revision is mandatory + if float(rno) >= 7: + distinfo['RELEASE'] = rno + '.' + str(random.randint(0,9)) + else: + distinfo['RELEASE'] = rno + random.choice('.r') + str(random.randint(0,9)) distinfo['CODENAME'] = lr.RELEASE_CODENAME_LOOKUP[rno] distinfo['DESCRIPTION'] = '%(ID)s %(OS)s %(RELEASE)s (%(CODENAME)s)' % distinfo fn = 'test/debian_version_' + rnd_string(5,5) |