Skip to content

Commit

Permalink
Schedule SDAF test in PCloud Latest HA+SAP JP
Browse files Browse the repository at this point in the history
Schedule SDAF test in Public Cloud / Latest HA+SAP Job Group
TEAM-9689 - [SDAF] Schedule SDAF test in Public Cloud / Latest HA+SAP Job Group
  • Loading branch information
lilyeyes committed Feb 26, 2025
1 parent 0c7987b commit f5bb9d6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ Sets OpenQA parameters required for replacing tfvars template variables for data

sub set_image_parameters {
my %params;

#return;
#my $os_image_name;

#if (is_azure() && get_var('PUBLIC_CLOUD_IMAGE_LOCATION')) {
# $os_image_name = $provider->get_blob_uri(get_var('PUBLIC_CLOUD_IMAGE_LOCATION'));
# return;
#}

# Parse image ID supplied by OpenQA parameter 'PUBLIC_CLOUD_IMAGE_ID'
my @variable_names = qw(SDAF_IMAGE_PUBLISHER SDAF_IMAGE_OFFER SDAF_IMAGE_SKU SDAF_IMAGE_VERSION);
# This maps a variable name from array @variable names to value from delimited 'PUBLIC_CLOUD_IMAGE_ID' parameter
Expand All @@ -148,8 +157,13 @@ sub set_image_parameters {

# Add all remaining parameters with static values
$params{SDAF_IMAGE_OS_TYPE} = 'LINUX'; # this can be modified in case of non linux images
$params{SDAF_SOURCE_IMAGE_ID} = ''; # for supplying uploaded image - not implemented yet
$params{SDAF_IMAGE_TYPE} = 'marketplace';
if (is_azure() && get_var('PUBLIC_CLOUD_IMAGE_LOCATION')) {
$params{SDAF_IMAGE_TYPE} = 'custom';
$params{SDAF_SOURCE_IMAGE_ID} = ''; # for supplying uploaded image
}
else {
$params{SDAF_IMAGE_TYPE} = 'marketplace';
}

foreach (keys(%params)) {
set_var($_, $params{$_});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# 'SDAF_DEPLOYER_SNAPSHOT' define existing snapshot name to be used as a source
# 'SDAF_DEPLOYER_MACHINE' override default value for VM size

use parent 'sles4sap::sap_deployment_automation_framework::basetest';
use parent qw(sles4sap::sap_deployment_automation_framework::basetest sles4sap_publiccloud_basetest);
use strict;
use warnings;
use sles4sap::sap_deployment_automation_framework::deployment qw(serial_console_diag_banner az_login);
Expand All @@ -25,12 +25,15 @@ use sles4sap::azure_cli qw(az_disk_create);
use serial_terminal qw(select_serial_terminal);
use mmapi qw(get_current_job_id);
use testapi;
use publiccloud::azure;

sub test_flags {
return {fatal => 1};
}

sub run {
my ($self, $run_args) = @_;

select_serial_terminal();
serial_console_diag_banner('Module sdaf_clone_deployer.pm : start');

Expand All @@ -47,6 +50,26 @@ sub run {
my @deployment_tags = ("deployment_id=" . get_current_job_id());

az_login();
###### testing
record_info("Search the img");
#my $provider_setting = get_required_var('PUBLIC_CLOUD_PROVIDER');
my $provider = $self->provider_factory();

#my $subscription_id = $provider->{provider_client}{subscription};
my $os_image_name;
#if (is_azure() && get_var('PUBLIC_CLOUD_IMAGE_LOCATION')) {
# This section is only needed by Azure tests using images uploaded
# with publiccloud_upload_img. This is because qe-sap-deployment
# is still not able to use images from Azure Gallery
$os_image_name = $provider->get_blob_uri(get_var('PUBLIC_CLOUD_IMAGE_LOCATION'));
#record_info("os_image_name", $os_image_name);
#} else {
if (is_azure() && get_var('PUBLIC_CLOUD_IMAGE_LOCATION')) {
$os_image_name = $provider->get_image_id();
record_info("os_image_name", $os_image_name);
}
die "testing";

record_info('VM create', "Creating deployer vm with parameters:\n
Resource group: $deployer_resource_group\n
VM name: $new_deployer_vm_name\n
Expand Down

0 comments on commit f5bb9d6

Please sign in to comment.