2019-11-21 20:10:36 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
use testapi;
|
|
|
|
use utils;
|
|
|
|
|
|
|
|
sub _soft_fail_run {
|
|
|
|
my ($test, $sudo) = @_;
|
|
|
|
$sudo //= 1;
|
|
|
|
my $cmd = "";
|
|
|
|
$cmd = "sudo " if ($sudo);
|
|
|
|
$cmd .= "python3 -m unittest";
|
|
|
|
if (script_run "$cmd $test -v") {
|
|
|
|
record_soft_failure "Non-blocking test $test failed";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub run {
|
2019-11-21 22:58:53 +00:00
|
|
|
# This test is basically a recreation of exactly the test process
|
|
|
|
# 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
|
2019-11-21 20:10:36 +00:00
|
|
|
my $self = shift;
|
|
|
|
# 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
|
2024-01-09 18:37:57 +00:00
|
|
|
select_console "tty2-console";
|
2022-07-28 20:32:57 +00:00
|
|
|
console_login(user => "test", password => "weakpassword");
|
2019-11-21 20:10:36 +00:00
|
|
|
assert_script_run "curl -O https://fedorapeople.org/groups/qa/tunirtests.tar.gz";
|
|
|
|
assert_script_run "tar xvf tunirtests.tar.gz";
|
2023-12-23 20:04:50 +00:00
|
|
|
if (get_var("CANNED")) {
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestAtomic01Status -v";
|
|
|
|
}
|
2019-11-21 20:10:36 +00:00
|
|
|
_soft_fail_run "tunirtests.nongatingtests.TunirNonGatingtests";
|
|
|
|
_soft_fail_run "tunirtests.nongatingtests.TunirNonGatingtestBzip2";
|
|
|
|
_soft_fail_run "tunirtests.nongatingtests.TunirNonGatingtestsCpio";
|
|
|
|
_soft_fail_run "tunirtests.nongatingtests.TunirNonGatingtestDiffutills";
|
|
|
|
_soft_fail_run "tunirtests.nongatingtests.TunirNonGatingtestaudit";
|
|
|
|
_soft_fail_run "tunirtests.selinux.TestSELinux";
|
|
|
|
_soft_fail_run "tunirtests.sshkeygentest.sshkeygenTest";
|
|
|
|
_soft_fail_run "tunirtests.testumountroot.TestUmountRoot";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.cloudtests.TestBase -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.cloudtests.TestCloudtmp -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.cloudtests.Testtmpmount -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.cloudtests.Testnetname -v";
|
|
|
|
# this test only works properly as a regular user
|
|
|
|
_soft_fail_run "tunirtests.cloudtests.TestJournalWritten", 0;
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.cloudservice.TestServiceStop -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.cloudservice.TestServiceDisable -v";
|
|
|
|
type_string "sudo reboot\n";
|
|
|
|
boot_to_login_screen(timeout => 180);
|
2022-07-28 20:32:57 +00:00
|
|
|
console_login(user => "root", password => "weakpassword");
|
2019-11-21 20:10:36 +00:00
|
|
|
# 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
|
2024-01-09 18:37:57 +00:00
|
|
|
select_console "tty2-console";
|
2022-07-28 20:32:57 +00:00
|
|
|
console_login(user => "test", password => "weakpassword");
|
2019-11-21 20:10:36 +00:00
|
|
|
_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);
|
2022-07-28 20:32:57 +00:00
|
|
|
console_login(user => "root", password => "weakpassword");
|
2019-11-21 20:10:36 +00:00
|
|
|
# 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
|
2024-01-09 18:37:57 +00:00
|
|
|
select_console "tty2-console";
|
2022-07-28 20:32:57 +00:00
|
|
|
console_login(user => "test", password => "weakpassword");
|
2019-11-21 20:10:36 +00:00
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.cloudservice.TestServiceAfter -v";
|
2024-01-02 22:06:35 +00:00
|
|
|
if (get_var("CANNED")) {
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestDockerInstalled -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestDockerStorageSetup -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestAtomicFirstBootRun -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestAtomicCommand -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestAtomicDockerImage -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestRootMount -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.atomictests.Testreadonlymount -v";
|
|
|
|
assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestDockerDaemon -v";
|
|
|
|
}
|
2019-11-21 20:10:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sub test_flags {
|
2022-07-28 20:32:57 +00:00
|
|
|
return {fatal => 1};
|
2019-11-21 20:10:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|