From 9963584380567ad69fb465057fa361ab22ceeda5 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sun, 21 Jul 2024 15:40:48 -0700 Subject: [PATCH 1/4] use configured username and password --- tests/autocloud.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/autocloud.pm b/tests/autocloud.pm index 087c5d2a..e8ce9d67 100644 --- a/tests/autocloud.pm +++ b/tests/autocloud.pm @@ -23,7 +23,7 @@ sub run { assert_script_run "chmod ugo+w /dev/" . $serialdev; # let's go to another tty and login as regular user send_key "alt-f2"; - console_login(user => "test", password => "weakpassword"); + console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword")); assert_script_run "curl -O https://fedorapeople.org/groups/qa/tunirtests.tar.gz"; assert_script_run "tar xvf tunirtests.tar.gz"; assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestAtomic01Status -v"; @@ -45,19 +45,19 @@ sub run { assert_script_run "sudo python3 -m unittest tunirtests.cloudservice.TestServiceDisable -v"; type_string "sudo reboot\n"; boot_to_login_screen(timeout => 180); - console_login(user => "root", password => "weakpassword"); + console_login(user => "root", password => get_var("USER_PASSWORD", "weakpassword")); # we need to use script_run as regular user again assert_script_run "sudo chmod ugo+w /dev/" . $serialdev; # let's go to another tty and login as regular user again send_key "alt-f2"; - console_login(user => "test", password => "weakpassword"); + console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword")); _soft_fail_run "tunirtests.testreboot.TestReboot"; assert_script_run "sudo python3 -m unittest tunirtests.cloudservice.TestServiceManipulation -v"; # this test only works properly as a regular user _soft_fail_run "tunirtests.cloudtests.TestJournalWrittenAfterReboot", 0; type_string "sudo reboot\n"; boot_to_login_screen(timeout => 180); - console_login(user => "root", password => "weakpassword"); + console_login(user => "root", get_var("USER_PASSWORD", "weakpassword")); # we need to use script_run as regular user again assert_script_run "sudo chmod ugo+w /dev/" . $serialdev; # let's go to another tty and login as regular user again From 8d332ad1eb0dd38645794510edd6288a3099dcdc Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Mon, 22 Jul 2024 00:00:06 -0700 Subject: [PATCH 2/4] tests require python3 which is not default in rocky 8 --- tests/autocloud.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/autocloud.pm b/tests/autocloud.pm index e8ce9d67..0ffb5bf0 100644 --- a/tests/autocloud.pm +++ b/tests/autocloud.pm @@ -19,6 +19,10 @@ sub run { # autocloud used to use, via tunir and this tunir config: # https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/autocloud/backend/files/fedora.txt?id=6e7c1b90593df8371fd34ed9484bd4da119236d3 my $self = shift; + # tests require python3 which is not default installed in Rocky 8 + if (get_version_major() < 9) { + assert_script_run("dnf install -y python3", timeout => 240); + } # we need to use script_run as regular user assert_script_run "chmod ugo+w /dev/" . $serialdev; # let's go to another tty and login as regular user From 3ecdf9b668f8c6f00025b1f24255261871d8ab61 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Mon, 22 Jul 2024 00:00:59 -0700 Subject: [PATCH 3/4] provide rocky tunirtests.tar.gz --- tests/autocloud.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/autocloud.pm b/tests/autocloud.pm index 0ffb5bf0..b00d3064 100644 --- a/tests/autocloud.pm +++ b/tests/autocloud.pm @@ -28,7 +28,7 @@ sub run { # let's go to another tty and login as regular user send_key "alt-f2"; console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword")); - assert_script_run "curl -O https://fedorapeople.org/groups/qa/tunirtests.tar.gz"; + assert_script_run "curl -O https://openqa.rockylinux.org/qa/tunirtests.tar.gz"; assert_script_run "tar xvf tunirtests.tar.gz"; assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestAtomic01Status -v"; _soft_fail_run "tunirtests.nongatingtests.TunirNonGatingtests"; From 962d765414b992e6b33f98731d4692dead1d8008 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Mon, 22 Jul 2024 00:10:38 -0700 Subject: [PATCH 4/4] use configured username and password --- tests/autocloud.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/autocloud.pm b/tests/autocloud.pm index b00d3064..5ff7d494 100644 --- a/tests/autocloud.pm +++ b/tests/autocloud.pm @@ -66,7 +66,7 @@ sub run { assert_script_run "sudo chmod ugo+w /dev/" . $serialdev; # let's go to another tty and login as regular user again send_key "alt-f2"; - console_login(user => "test", password => "weakpassword"); + console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword")); assert_script_run "sudo python3 -m unittest tunirtests.cloudservice.TestServiceAfter -v"; assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestDockerInstalled -v"; assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestDockerStorageSetup -v";