summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2016-06-29 18:12:43 +0200
committerDidier Raboud <odyx@debian.org>2016-06-29 18:12:43 +0200
commit6b251e401b7ccc22a53ce14abe7687606ac03c8e (patch)
tree38cfaa66a64c40b02fe9bb530de9f2c2c1ef6488 /test
parent6d457e5a33eade52ecd952469e415c9c4ca81e9c (diff)
Update lsb_release.py to cope with the new Debian Ports' release label
Closes: #827137 Changed-by: Didier Raboud <odyx@debian.org> to have tests for both the old and the new versions
Diffstat (limited to 'test')
-rwxr-xr-xtest/apt-cache7
-rw-r--r--test/test_lsb_release.py26
2 files changed, 20 insertions, 13 deletions
diff --git a/test/apt-cache b/test/apt-cache
index 7492dc0..eb503a5 100755
--- a/test/apt-cache
+++ b/test/apt-cache
@@ -46,9 +46,14 @@ if os.environ.get('TEST_APT_CACHE_UNSTABLE') == '500':
print(' release o=Debian,a=unstable,n=sid,l=Debian,c=main')
print(' origin MirRor-is-not-read')
-if os.environ.get('TEST_APT_CACHE_UNSTABLE_PORTS') == '500':
+if os.environ.get('TEST_APT_CACHE_UNSTABLE_PORTS_OLD') == '500':
print(' 500 http://MirRor_is_not_read/folder-either-debian-ports/ sid/main arch Packages')
print(' release o=Debian Ports,a=unstable,n=sid,l=ftp.debian-ports.org,c=main,v=1.0')
print(' origin MirRor-is-not-read')
+if os.environ.get('TEST_APT_CACHE_UNSTABLE_PORTS') == '500':
+ print(' 500 http://MirRor_is_not_read/folder-either-debian-ports/ sid/main arch Packages')
+ print(' release o=Debian Ports,a=unstable,n=sid,l=ftp.ports.debian.org,c=main,v=1.0')
+ print(' origin MirRor-is-not-read')
+
print('Pinned packages:')
diff --git a/test/test_lsb_release.py b/test/test_lsb_release.py
index 10b969a..936af90 100644
--- a/test/test_lsb_release.py
+++ b/test/test_lsb_release.py
@@ -163,7 +163,7 @@ class TestLSBRelease(unittest.TestCase):
label='l8bel',
component='c0mp0nent',
ignoresuites=('c0mp0nentIgn'),
- alternate_olabels={'P-or1g1n':'P-l8bel'}),
+ alternate_olabels={'P-or1g1n': ('P-l8bel', 'P-l9bel')}),
supposed_output)
os.environ.pop('TEST_APT_CACHE1')
os.environ.pop('TEST_APT_CACHE2')
@@ -255,21 +255,23 @@ class TestLSBRelease(unittest.TestCase):
os.remove(fn)
os.environ.pop('LSB_ETC_DEBIAN_VERSION')
- # Test "unstable releases with Debian Ports" that end in /sid, go read valid apt-cache policy
- os.environ['TEST_APT_CACHE_UNSTABLE_PORTS'] = '500'
distinfo['CODENAME'] = 'sid'
distinfo['RELEASE'] = 'unstable'
distinfo['DESCRIPTION'] = '%(ID)s %(OS)s %(RELEASE)s (%(CODENAME)s)' % distinfo
- for rno in lr.RELEASE_CODENAME_LOOKUP:
- fn = 'test/debian_version_' + rnd_string(5,12)
- f = open(fn,'w')
- f.write(lr.RELEASE_CODENAME_LOOKUP[rno] + '/sid')
- f.close()
- os.environ['LSB_ETC_DEBIAN_VERSION'] = fn
- self.assertEqual(lr.guess_debian_release(),distinfo)
- os.remove(fn)
+
+ for CODE in ('PORTS', 'PORTS_OLD'):
+ # Test "unstable releases with Debian Ports" that end in /sid, go read valid apt-cache policy
+ os.environ['TEST_APT_CACHE_UNSTABLE_' + CODE] = '500'
+ for rno in lr.RELEASE_CODENAME_LOOKUP:
+ fn = 'test/debian_version_' + rnd_string(5,12)
+ f = open(fn,'w')
+ f.write(lr.RELEASE_CODENAME_LOOKUP[rno] + '/sid')
+ f.close()
+ os.environ['LSB_ETC_DEBIAN_VERSION'] = fn
+ self.assertEqual(lr.guess_debian_release(),distinfo)
+ os.remove(fn)
+ os.environ.pop('TEST_APT_CACHE_UNSTABLE_' + CODE)
os.environ.pop('LSB_ETC_DEBIAN_VERSION')
- os.environ.pop('TEST_APT_CACHE_UNSTABLE_PORTS')
os.environ.pop('TEST_APT_CACHE_UNSTABLE')
def test_get_lsb_information(self):