@@ -20,7 +20,7 @@ use version_utils qw(is_sle is_transactional);
2020our @EXPORT
2121 = qw( capture_state check_automounter is_patch_needed add_test_repositories disable_test_repositories enable_test_repositories
2222 add_extra_customer_repositories ssh_add_test_repositories remove_test_repositories advance_installer_window get_patches check_patch_variables add_repo_if_not_present
23- has_published_assets) ;
23+ has_published_assets get_test_repos ) ;
2424use constant ZYPPER_PACKAGE_COL => 1;
2525use constant OLD_ZYPPER_STATUS_COL => 4;
2626use constant ZYPPER_STATUS_COL => 5;
@@ -249,4 +249,23 @@ sub has_published_assets {
249249 return scalar grep { m / ^PUBLISH_/ } keys %bmwqemu::vars ;
250250}
251251
252+ # Return list of all available repos
253+ sub get_test_repos {
254+ # In Incidents there is INCIDENT_REPO instead of MAINT_TEST_REPO
255+ # Those two variables contain list of repositories separated by comma
256+ set_var(' MAINT_TEST_REPO' , get_var(' INCIDENT_REPO' )) if get_var(' INCIDENT_REPO' );
257+ my @repos = split (/ ,/ , get_var(' MAINT_TEST_REPO' ));
258+ # Add aggregate repos to @repos, if they are provided
259+ # Test repos are expected to end in '_TEST_REPOS'
260+ # These vars are set by qem-bot, e.g.
261+ # https://github.com/openSUSE/qem-bot/blob/ecb7acc8badccce85969e05f368455390b1ab6eb/openqabot/types/aggregate.py#L104
262+ my @test_repos = grep { / _TEST_REPOS$ / } keys %bmwqemu::vars ;
263+ for my $repo (@test_repos ) {
264+ if (my $value = get_var($repo )) {
265+ push @repos , split (/ ,/ , $value );
266+ }
267+ }
268+ return @repos ;
269+ }
270+
2522711;
0 commit comments