Skip to content

Commit

Permalink
Public CLoud: Schedule Ansible client as SLE and target as SLEM
Browse files Browse the repository at this point in the history
  • Loading branch information
pdostal authored and ilausuch committed Jul 27, 2023
1 parent 641b6ee commit b4e5146
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 deletions.
21 changes: 8 additions & 13 deletions lib/main_micro_alp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use base 'Exporter';
use Exporter;
use main_common;
use main_containers qw(load_container_tests is_container_test);
use main_publiccloud 'load_ansible_tests';
use testapi qw(check_var get_required_var get_var set_var);
use version_utils;
use utils;
Expand Down Expand Up @@ -278,9 +279,14 @@ sub load_slem_on_pc_tests {
}

sub load_tests {
# SLEM on PC
if (is_public_cloud()) {
load_slem_on_pc_tests;
if (check_var('PUBLIC_CLOUD_ANSIBLE_CLIENT', 1) || check_var('PUBLIC_CLOUD_ANSIBLE_TARGET', 1)) {
# SLE-Micro Ansible target
load_ansible_tests();
} else {
# SLEM on PC
load_slem_on_pc_tests();
}
return 1;
}

Expand All @@ -289,17 +295,6 @@ sub load_tests {
return 1;
}

if (check_var('PUBLIC_CLOUD_ANSIBLE_CLIENT', 1)) {
loadtest 'boot/boot_to_desktop';
loadtest 'publiccloud/ansible_client';
return 1;
}
elsif (check_var('PUBLIC_CLOUD_ANSIBLE_TARGET', 1)) {
loadtest 'microos/disk_boot';
loadtest 'publiccloud/ansible_target';
return 1;
}

if (get_var('REMOTE_TARGET')) {
load_remote_target_tests;
return 1;
Expand Down
15 changes: 15 additions & 0 deletions lib/main_publiccloud.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ require bmwqemu;

our @EXPORT = qw(
load_publiccloud_tests
load_ansible_tests
);

sub load_maintenance_publiccloud_tests {
Expand Down Expand Up @@ -180,6 +181,20 @@ sub load_publiccloud_download_repos {
loadtest 'shutdown/shutdown';
}

sub load_ansible_tests {
if (check_var('PUBLIC_CLOUD_ANSIBLE_CLIENT', 1)) {
loadtest 'boot/boot_to_desktop';
loadtest 'publiccloud/ansible_client';
return 1;
}
elsif (check_var('PUBLIC_CLOUD_ANSIBLE_TARGET', 1)) {
loadtest 'microos/disk_boot';
loadtest 'publiccloud/ansible_target';
return 1;
}
}


=head2 load_publiccloud_tests
C<load_publiccloud_tests> schedules the test jobs for the variety of groups.
Expand Down
20 changes: 13 additions & 7 deletions tests/publiccloud/ansible_client.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,30 @@

use base "consoletest";
use serial_terminal 'select_serial_terminal';
use strict;
use transactional qw(trup_call process_reboot);
#use strict;
use warnings;
use testapi;
use mmapi;
use utils qw(zypper_call);
use network_utils qw(setup_static_network);
use lockapi;
use mm_network qw(setup_static_mm_network);
use utils qw(zypper_call);

sub run {

Check warning on line 19 in tests/publiccloud/ansible_client.pm

View workflow job for this annotation

GitHub Actions / CI: Running unit tests with perl v5.32

Code before strictures are enabled - severity 5

See page 429 of PBP
my ($self, $args) = @_;
select_serial_terminal;

record_info('system', script_output('cat /etc/os-release'));
setup_static_network(ip => '10.0.2.15/15', gw => '10.0.2.2');
# setup_static_network(ip => '10.0.2.15/15', gw => '10.0.2.2');
# record_info('ip', script_output('ip a'));
# record_info('route', script_output('ip r'));
# assert_script_run('echo "10.0.2.20 microos" >> /etc/hosts');
# zypper_call('in -y iputils git');

setup_static_mm_network('10.0.2.15/15');

record_info('ip', script_output('ip a'));
record_info('route', script_output('ip r'));
assert_script_run('echo "10.0.2.20 microos" >> /etc/hosts');
zypper_call('in -y iputils git');
script_run('ping -c 1 download.suse.de');

assert_script_run('mkdir /root/.ssh');
assert_script_run('curl -f -v ' . autoinst_url . '/data/slenkins/ssh/id_rsa > /root/.ssh/id_rsa');
Expand Down

0 comments on commit b4e5146

Please sign in to comment.