diff --git a/britney2/inputs/suiteloader.py b/britney2/inputs/suiteloader.py index de00563..665b66f 100644 --- a/britney2/inputs/suiteloader.py +++ b/britney2/inputs/suiteloader.py @@ -113,6 +113,7 @@ class DebMirrorLikeSuiteContentLoader(SuiteContentLoader): # - Load all sources before any of the binaries. for suite in suites: sources = self._read_sources(suite.path) + self._update_suite_name(suite) suite.sources = sources (suite.binaries, suite.provides_table) = self._read_binaries(suite, self._architectures) @@ -133,6 +134,18 @@ class DebMirrorLikeSuiteContentLoader(SuiteContentLoader): # building items/keys - by intern strings we reduce memory (considerably). self._architectures = [sys.intern(arch) for arch in allarches] + def _update_suite_name(self, suite): + try: + release_file = read_release_file(suite.path) + except FileNotFoundError: + self.logger.info("The %s suite does not have a Release file, unable to update the name", + suite.name) + release_file = None + + if release_file is not None: + suite.name = release_file['Suite'] + self.logger.info("Using suite name from Release file: %s", release_file['Suite']) + def _check_release_file(self, target_suite, missing_config_msg): try: release_file = read_release_file(target_suite.path) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 0ddb456..9595ced 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -150,6 +150,7 @@ class AutopkgtestPolicy(BasePolicy): for src, data in suite.sources.items(): for trigger in data.testsuite_triggers: self.testsuite_triggers.setdefault(trigger, set()).add(src) + target_suite_name = self.suite_info.target_suite.name os.makedirs(self.state_dir, exist_ok=True) self.read_pending_tests() @@ -187,7 +188,8 @@ class AutopkgtestPolicy(BasePolicy): # Blacklisted tests don't get a version if res['version'] is None: res['version'] = 'blacklisted' - (triggers, src, arch, ver, status, run_id, seen) = ([ + (test_suite, triggers, src, arch, ver, status, run_id, seen) = ([ + res['suite'], res['trigger'], res['package'], res['arch'], @@ -195,6 +197,9 @@ class AutopkgtestPolicy(BasePolicy): res['status'], str(res['run_id']), round(calendar.timegm(time.strptime(res['updated_at'][0:-5], '%Y-%m-%dT%H:%M:%S')))]) + if test_suite != target_suite_name: + # not requested for this target suite, so ignore + continue if triggers is None: # not requested for this policy, so ignore continue