forked from os-autoinst/os-autoinst-distri-opensuse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add argument to customize qesap log filename
Add argument to `qesap_execute` about the log filename. Use it in qesap regression Ansible and Terraform retry. Add verbosity args with no verbose default in qesap_ansible_script_output_file. Improve debug message in peering delete function.
- Loading branch information
Showing
6 changed files
with
125 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright SUSE LLC | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
# Summary: Setup and install more tools in the running jumphost image for qe-sap-deployment | ||
# Maintainer: QE-SAP <[email protected]>, Michele Pagot <[email protected]> | ||
|
||
use strict; | ||
use warnings; | ||
use Mojo::Base 'publiccloud::basetest'; | ||
use base 'consoletest'; | ||
use testapi; | ||
use qesapdeployment; | ||
|
||
sub run { | ||
my ($self) = @_; | ||
$self->select_serial_terminal; | ||
|
||
# 'az' and 'terraform' are preinstalled in the PcTools qcow2, we test their version | ||
assert_script_run('az --version'); | ||
assert_script_run('terraform --version'); | ||
|
||
# test ansible installed by pip | ||
assert_script_run('ansible --version'); | ||
} | ||
|
||
sub post_fail_hook { | ||
my ($self) = @_; | ||
$self->select_serial_terminal; | ||
$self->qesap_upload_logs(); | ||
$self->SUPER::post_fail_hook; | ||
} | ||
|
||
1; |
56 changes: 56 additions & 0 deletions
56
tests/sles4sap/qesapdeployment/test_cluster_ibsm_peering.pm.bkp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Copyright SUSE LLC | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
# Summary: Test for qe-sap-deployment | ||
# Maintainer: QE-SAP <[email protected]>, Michele Pagot <[email protected]> | ||
|
||
use strict; | ||
use warnings; | ||
use Mojo::Base 'publiccloud::basetest'; | ||
use testapi; | ||
use qesapdeployment; | ||
|
||
sub run { | ||
my ($self) = @_; | ||
if (check_var('PUBLIC_CLOUD_PROVIDER', 'AZURE')) { | ||
if (get_var("QESAPDEPLOY_IBSMIRROR_RESOURCE_GROUP")) { | ||
my $rg = qesap_az_get_resource_group(); | ||
my $ibs_mirror_rg = get_var('QESAPDEPLOY_IBSMIRROR_RESOURCE_GROUP'); | ||
qesap_az_vnet_peering(source_group => $rg, target_group => $ibs_mirror_rg); | ||
qesap_add_server_to_hosts(name => 'download.suse.de', ip => get_required_var("QESAPDEPLOY_IBSMIRROR_IP")); | ||
qesap_az_vnet_peering_delete(source_group => $rg, target_group => $ibs_mirror_rg); | ||
} | ||
} elsif (check_var('PUBLIC_CLOUD_PROVIDER', 'EC2')) { | ||
if (get_var("QESAPDEPLOY_IBSMIRROR_IP_RANGE")) { | ||
my $deployment_name = qesap_calculate_deployment_name('qesapval'); | ||
my $vpc_id = qesap_aws_get_vpc_id(resource_group => $deployment_name); | ||
my $ibs_mirror_target_ip = get_var('QESAPDEPLOY_IBSMIRROR_IP_RANGE'); # '10.254.254.240/28' | ||
die 'Error in network peering setup.' if !qesap_aws_vnet_peering(target_ip => $ibs_mirror_target_ip, vpc_id => $vpc_id); | ||
qesap_add_server_to_hosts(name => 'download.suse.de', ip => get_required_var("QESAPDEPLOY_IBSMIRROR_IP")); | ||
die 'Error in network peering delete.' if !qesap_aws_delete_transit_gateway_vpc_attachment(name => $deployment_name . '*'); | ||
} | ||
} else { | ||
die 'This test has been scheduled without a valid setting combination'; | ||
} | ||
} | ||
|
||
sub post_fail_hook { | ||
my ($self) = @_; | ||
qesap_upload_logs(); | ||
qesap_execute(cmd => 'ansible', cmd_options => '-d', verbose => 1, timeout => 300); | ||
qesap_execute(cmd => 'terraform', cmd_options => '-d', verbose => 1, timeout => 1200); | ||
if (check_var('PUBLIC_CLOUD_PROVIDER', 'AZURE')) { | ||
if (get_var("QESAPDEPLOY_IBSMIRROR_RESOURCE_GROUP")) { | ||
my $rg = qesap_az_get_resource_group(); | ||
my $ibs_mirror_rg = get_required_var('QESAPDEPLOY_IBSMIRROR_RESOURCE_GROUP'); | ||
qesap_az_vnet_peering_delete(source_group => $rg, target_group => $ibs_mirror_rg); | ||
} | ||
} elsif (check_var('PUBLIC_CLOUD_PROVIDER', 'EC2')) { | ||
if (get_var("QESAPDEPLOY_IBSMIRROR_IP_RANGE")) { | ||
qesap_aws_delete_transit_gateway_vpc_attachment(name => qesap_calculate_deployment_name('qesapval') . '*'); | ||
} | ||
} | ||
$self->SUPER::post_fail_hook; | ||
} | ||
|
||
1; |