Skip to content

Commit 9dfb452

Browse files
Add aggregate repos to ibsm modules
1 parent 1c079b9 commit 9dfb452

3 files changed

Lines changed: 26 additions & 7 deletions

File tree

lib/sles4sap.pm

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use Mojo::Base 'opensusebasetest';
1313
use strict;
1414
use warnings;
1515
use testapi;
16+
use bmwqemu ();
1617
use serial_terminal qw(select_serial_terminal);
1718
use utils;
1819
use 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_ISSUES$/ } 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+
14551478
sub post_run_hook {
14561479
my ($self) = @_;
14571480

tests/publiccloud/validate_repos.pm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use warnings;
1313
use testapi;
1414
use strict;
1515
use utils;
16+
use sles4sap;
1617
use publiccloud::ssh_interactive "select_host_console";
1718
use 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;

tests/sles4sap/publiccloud/cluster_add_repos.pm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ sub test_flags {
1717
sub 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

0 commit comments

Comments
 (0)