File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ use Mojo::Base 'opensusebasetest';
1313use strict;
1414use warnings;
1515use testapi;
16+ use bmwqemu ();
1617use serial_terminal qw( select_serial_terminal) ;
1718use utils;
1819use hacluster qw( get_hostname ha_export_logs pre_run_hook save_state wait_until_resources_started script_output_retry_check) ;
@@ -72,6 +73,7 @@ our @EXPORT = qw(
7273 load_ase_env
7374 upload_ase_logs
7475 modify_selinux_setenforce
76+ get_test_repos
7577) ;
7678
7779=head1 SYNOPSIS
@@ -1452,6 +1454,27 @@ sub modify_selinux_setenforce {
14521454 }
14531455}
14541456
1457+ =head2 get_test_repos
1458+
1459+ Constructs an array of repos to be added to SUTs.
1460+
1461+ =cut
1462+ sub get_test_repos {
1463+ # In Incidents there is INCIDENT_REPO instead of MAINT_TEST_REPO
1464+ # Those two variables contain list of repositories separated by comma
1465+ set_var(' MAINT_TEST_REPO' , get_var(' INCIDENT_REPO' )) if get_var(' INCIDENT_REPO' );
1466+ my @repos = split (/ ,/ , get_var(' MAINT_TEST_REPO' ));
1467+ # Add aggregate repos to @repos, if they are provided
1468+ # Test repos are expected to end in '_TEST_REPOS'
1469+ my @test_repos = grep { / _TEST_REPOS$ / } keys %bmwqemu::vars ;
1470+ for my $repo (@test_repos ) {
1471+ if (my $value = get_var($repo )) {
1472+ push @repos , split (/ ,/ , $value );
1473+ }
1474+ }
1475+ return @repos ;
1476+ }
1477+
14551478sub post_run_hook {
14561479 my ($self ) = @_ ;
14571480
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ use warnings;
1313use testapi;
1414use strict;
1515use utils;
16+ use sles4sap;
1617use publiccloud::ssh_interactive " select_host_console" ;
1718use publiccloud::utils " validate_repo" ;
1819
@@ -25,10 +26,7 @@ sub run {
2526 record_info(' Skip validation' , ' Skipping maintenance update validation (triggered by setting)' );
2627 return ;
2728 } else {
28- # In Incidents there is INCIDENT_REPO instead of MAINT_TEST_REPO
29- # Those two variables contain list of repositories separated by comma
30- set_var(' MAINT_TEST_REPO' , get_var(' INCIDENT_REPO' )) unless get_var(' MAINT_TEST_REPO' );
31- my @repos = split (/ ,/ , get_var(' MAINT_TEST_REPO' ));
29+ my @repos = sles4sap::get_test_repos();
3230 # Failsafe: Fail if there are no test repositories, otherwise we have the wrong template link
3331 my $count = scalar @repos ;
3432 my $check_empty_repos = get_var(' PUBLIC_CLOUD_IGNORE_EMPTY_REPO' , 0) == 0;
Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ sub test_flags {
1717sub run {
1818 my ($self , $run_args ) = @_ ;
1919 $self -> import_context($run_args );
20-
21- set_var(' MAINT_TEST_REPO' , get_var(' INCIDENT_REPO' )) if get_var(' INCIDENT_REPO' );
22- my @repos = split (/ ,/ , get_var(' MAINT_TEST_REPO' ));
20+ my @repos = sles4sap_publiccloud::get_test_repos();
2321 my $count = 0;
2422 my @zypper_cmd ;
2523
You can’t perform that action at this time.
0 commit comments