diff --git a/boottest.py b/boottest.py index 4d3c3b4..b83668f 100644 --- a/boottest.py +++ b/boottest.py @@ -208,9 +208,11 @@ class BootTest(object): if not (src in self.pkglist and ver in self.pkglist[src]): self.pkglist[src][ver] = status - def get_status(self, name, version): - """Return test status for the given source name and version.""" - return self.pkglist[name][version] + def get_status(self, name): + """Return test status for the given source name.""" + last_version = sorted( + self.pkglist[name], cmp=apt_pkg.version_compare)[-1] + return self.pkglist[name][last_version] def request(self, packages): """Requests boottests for the given sources list ([(src, ver),]).""" @@ -236,6 +238,13 @@ class BootTest(object): """Collects boottests results and updates internal registry.""" self._run("collect", "-O", self._result_path) self._read() + if not self.britney.options.verbose: + return + for src in sorted(self.pkglist): + for ver in sorted(self.pkglist[src], cmp=apt_pkg.version_compare): + status = self.pkglist[src][ver] + print("I: [%s] - Collected boottest status for %s_%s: " + "%s" % (time.asctime(), src, ver, status)) def needs_test(self, name, version): """Whether or not the given source and version should be tested. diff --git a/britney.py b/britney.py index eef23fe..a119ca8 100755 --- a/britney.py +++ b/britney.py @@ -1944,7 +1944,7 @@ class Britney(object): boottest.collect() # Update excuses from the boottest context. for excuse in boottest_excuses: - status = boottest.get_status(excuse.name, excuse.ver[1]) + status = boottest.get_status(excuse.name) label = BootTest.EXCUSE_LABELS.get(status, 'UNKNOWN STATUS') excuse.addhtml("Boottest result: %s" % (label)) # Allows hints to force boottest failures/attempts diff --git a/tests/test_boottest.py b/tests/test_boottest.py index 01772e8..5492240 100644 --- a/tests/test_boottest.py +++ b/tests/test_boottest.py @@ -146,6 +146,7 @@ class TestBoottestEnd2End(TestBase): self.create_manifest([ 'green 1.0', 'pyqt5:armhf 1.0', + 'signon 1.0' ]) def create_manifest(self, lines): @@ -171,6 +172,7 @@ template = """ green 1.1~beta RUNNING pyqt5-src 1.1~beta PASS pyqt5-src 1.1 FAIL +signon 1.0 PASS """ def request(): @@ -190,6 +192,9 @@ def collect(): p = argparse.ArgumentParser() p.add_argument('-r') p.add_argument('-c') +p.add_argument('-d', default=False, action='store_true') +p.add_argument('-P', default=False, action='store_true') +p.add_argument('-U', default=False, action='store_true') sp = p.add_subparsers() @@ -258,11 +263,10 @@ args.func() # promotion. context = [] context.append( - ('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.1~beta', - 'Architecture': 'all'})) + ('signon', {'Version': '1.1', 'Architecture': 'armhf'})) self.do_test( context, - [r'\bpyqt5-src\b.*\(- to .*>1.1~beta<', + [r'\bsignon\b.*\(- to .*>1.1<', '
  • Boottest result: {}'.format( boottest.BootTest.EXCUSE_LABELS['PASS']), '
  • Valid candidate'])