Skip to content

Commit e9811e9

Browse files
Merge pull request os-autoinst#21319 from BillAnastasiadis/cloudconfig_adj
Allow ipaddr2 test to use alternative vars for image source
2 parents ad5e77a + ed40916 commit e9811e9

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

tests/sles4sap/ipaddr2/deploy.pm

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ sub run {
3333
# before to start.
3434
die('Azure is the only CSP supported for the moment')
3535
unless check_var('PUBLIC_CLOUD_PROVIDER', 'AZURE');
36-
my $os = get_required_var('CLUSTER_OS_VER');
37-
my %cloudinit_args;
38-
$cloudinit_args{scc_code} = get_required_var('SCC_REGCODE_SLES4SAP') if ($os =~ /byos/i);
39-
$cloudinit_args{external_repo} = get_var('IPADDR2_NGINX_EXTREPO') if get_var('IPADDR2_NGINX_EXTREPO');
40-
my %deployment = (
41-
os => $os,
42-
diagnostic => get_var('IPADDR2_DIAGNOSTIC', 0));
43-
$deployment{trusted_launch} = 0 if (check_var('IPADDR2_TRUSTEDLAUNCH', 0));
4436

4537
select_serial_terminal;
4638

@@ -52,6 +44,24 @@ sub run {
5244
# break test steps that relay to remote ssh comman output
5345
assert_script_run('rm ~/.ssh/config');
5446

47+
my $os;
48+
if (get_var('PUBLIC_CLOUD_IMAGE_LOCATION')) {
49+
# This section is only needed by Azure tests using images uploaded
50+
# with publiccloud_upload_img. This is because qe-sap-deployment
51+
# is still not able to use images from Azure Gallery
52+
$os = $self->{provider}->get_blob_uri(get_var('PUBLIC_CLOUD_IMAGE_LOCATION'));
53+
} else {
54+
$os = get_required_var('CLUSTER_OS_VER');
55+
}
56+
57+
my %cloudinit_args;
58+
$cloudinit_args{scc_code} = get_required_var('SCC_REGCODE_SLES4SAP') if ($os =~ /byos/i);
59+
$cloudinit_args{external_repo} = get_var('IPADDR2_NGINX_EXTREPO') if get_var('IPADDR2_NGINX_EXTREPO');
60+
my %deployment = (
61+
os => $os,
62+
diagnostic => get_var('IPADDR2_DIAGNOSTIC', 0));
63+
$deployment{trusted_launch} = 0 if (check_var('IPADDR2_TRUSTEDLAUNCH', 0));
64+
5565
$deployment{region} = $provider->provider_client->region;
5666
# If required (by default cloud-init is active), both:
5767
# - create on the fly the cloud-init profile

0 commit comments

Comments
 (0)