Run autocloud tests on Cloud_Base qcow2 images

autocloud is dying soon. So, we want to run the tests in openQA
instead. This adds a test module called 'autocloud' and a test
suite called 'cloud_autocloud' which basically replicate what
autocloud does (download a tarball full of tests and run each
one), and the necessary template bits to run it on Cloud_Base
qcow2 images.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2019-11-21 12:10:36 -08:00
parent 5a28c0c0f2
commit 54a6b21c28
2 changed files with 162 additions and 0 deletions

View File

@ -1855,6 +1855,17 @@
}, },
test_suite => { name => "server_firewall_default" }, test_suite => { name => "server_firewall_default" },
}, },
{
machine => { name => "64bit" },
prio => 30,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "Cloud_Base-qcow2-qcow2",
version => "*",
},
test_suite => { name => "cloud_autocloud" },
},
{ {
machine => { name => "64bit" }, machine => { name => "64bit" },
prio => 61, prio => 61,
@ -3415,6 +3426,18 @@
}, },
test_suite => { name => "desktop_background" }, test_suite => { name => "desktop_background" },
}, },
{
group_name => "Fedora PowerPC",
machine => { name => "ppc64le" },
prio => 30,
product => {
arch => "ppc64le",
distri => "fedora",
flavor => "Cloud_Base-qcow2-qcow2",
version => "*",
},
test_suite => { name => "cloud_autocloud" },
},
{ {
group_name => "Fedora AArch64", group_name => "Fedora AArch64",
machine => { name => "aarch64" }, machine => { name => "aarch64" },
@ -4291,6 +4314,18 @@
}, },
test_suite => { name => "server_firewall_default" }, test_suite => { name => "server_firewall_default" },
}, },
{
group_name => "Fedora AArch64",
machine => { name => "aarch64" },
prio => 30,
product => {
arch => "aarch64",
distri => "fedora",
flavor => "Cloud_Base-qcow2-qcow2",
version => "*",
},
test_suite => { name => "cloud_autocloud" },
},
], ],
Machines => [ Machines => [
{ {
@ -4473,6 +4508,19 @@
], ],
version => "*", version => "*",
}, },
{
arch => "x86_64",
distri => "fedora",
flavor => "Cloud_Base-qcow2-qcow2",
name => "",
settings => [
{ key => "ISO", value => "cloudinit.iso" },
{ key => "TEST_TARGET", value => "HDD_1" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
{ key => "BOOTFROM", value => "c" },
],
version => "*",
},
{ {
arch => "i386", arch => "i386",
distri => "fedora", distri => "fedora",
@ -4654,6 +4702,19 @@
], ],
version => "*", version => "*",
}, },
{
arch => "ppc64le",
distri => "fedora",
flavor => "Cloud_Base-qcow2-qcow2",
name => "",
settings => [
{ key => "ISO", value => "cloudinit.iso" },
{ key => "TEST_TARGET", value => "HDD_1" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
{ key => "BOOTFROM", value => "c" },
],
version => "*",
},
{ {
arch => "aarch64", arch => "aarch64",
distri => "fedora", distri => "fedora",
@ -4696,6 +4757,19 @@
], ],
version => "*", version => "*",
}, },
{
arch => "aarch64",
distri => "fedora",
flavor => "Cloud_Base-qcow2-qcow2",
name => "",
settings => [
{ key => "ISO", value => "cloudinit.iso" },
{ key => "TEST_TARGET", value => "HDD_1" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
{ key => "BOOTFROM", value => "c" },
],
version => "*",
},
], ],
TestSuites => [ TestSuites => [
{ {
@ -5887,5 +5961,11 @@
{ key => "INSTALL_NO_USER", value => "1" }, { key => "INSTALL_NO_USER", value => "1" },
], ],
}, },
{
name => "cloud_autocloud",
settings => [
{ key => "POSTINSTALL", value => "autocloud" },
],
},
], ],
} }

82
tests/autocloud.pm Normal file
View File

@ -0,0 +1,82 @@
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 {
my $self = shift;
bypass_1691487;
# 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
send_key "alt-f2";
console_login(user=>"test", 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";
_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);
console_login(user=>"root", 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");
_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");
# 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");
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";
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";
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et: