diff --git a/autopkgtest.py b/autopkgtest.py index ae15545..8e43d88 100644 --- a/autopkgtest.py +++ b/autopkgtest.py @@ -610,7 +610,7 @@ class AutoPackageTest(object): self.log_verbose('Checking hints for %s/%s/%s: %s' % (testsrc, testver, arch, [str(h) for h in hints])) for hint in hints: if [mi for mi in hint.packages if mi.architecture in ['source', arch] and - (mi.version == 'all' or same_source(mi.version, testver))]: + (mi.version == 'all' or apt_pkg.version_compare(testver, mi.version) <= 0)]: result = 'IGNORE-FAIL' break else: diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index 03d9f26..8f7615d 100755 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -1368,6 +1368,7 @@ class T(TestBase): 'series/amd64/g/green/20150101_100200@': (0, 'green 2', tr('green/2')), }}) + # lower hint version should not apply self.create_hint('pitti', 'force-badtest lightgreen/0.1') exc = self.do_test( @@ -1381,6 +1382,18 @@ class T(TestBase): )[1] self.assertNotIn('forced-reason', exc['green']) + # higher hint version should apply + self.create_hint('pitti', 'force-badtest lightgreen/3') + self.do_test( + [], + {'green': (True, {'green 2': {'amd64': 'PASS', 'i386': 'PASS'}, + 'lightgreen 1': {'amd64': 'IGNORE-FAIL', 'i386': 'IGNORE-FAIL'}, + 'darkgreen 1': {'amd64': 'PASS', 'i386': 'PASS'}, + }), + }, + {} + ) + def test_hint_force_badtest_arch(self): '''force-badtest hint for architecture instead of version'''