mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2024-11-21 13:33:08 +00:00
Add fedup_minimal test
Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D358
This commit is contained in:
parent
f7d4bc69ce
commit
1422d2c0e2
33
lib/fedoralog.pm
Normal file
33
lib/fedoralog.pm
Normal file
@ -0,0 +1,33 @@
|
||||
package fedoralog;
|
||||
use base 'basetest';
|
||||
|
||||
use testapi;
|
||||
|
||||
sub post_fail_hook() {
|
||||
my $self = shift;
|
||||
my $password = get_var("ROOT_PASSWORD", "weakpassword");
|
||||
|
||||
send_key "ctrl-alt-f2";
|
||||
assert_screen "text_console_login", 20;
|
||||
type_string "root";
|
||||
send_key "ret";
|
||||
assert_screen "console_password_required", 10;
|
||||
type_string $password;
|
||||
send_key "ret";
|
||||
|
||||
assert_screen "root_logged_in", 10;
|
||||
|
||||
# Upload all ABRT logs
|
||||
type_string "cd /var/tmp/abrt && tar czvf abrt.tar.gz *";
|
||||
send_key "ret";
|
||||
upload_logs "/var/tmp/abrt/abrt.tar.gz";
|
||||
|
||||
# Upload /var/log
|
||||
type_string "tar czvf /tmp/var_log.tar.gz /var/log";
|
||||
send_key "ret";
|
||||
upload_logs "/tmp/var_log.tar.gz";
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
# vim: set sw=4 et:
|
6
main.pm
6
main.pm
@ -55,6 +55,12 @@ if (get_var("ENTRYPOINT"))
|
||||
{
|
||||
autotest::loadtest get_var('CASEDIR')."/tests/".get_var("ENTRYPOINT").".pm";
|
||||
}
|
||||
elsif (get_var("UPGRADE"))
|
||||
{
|
||||
autotest::loadtest get_var('CASEDIR')."/tests/upgrade_preinstall_".get_var("UPGRADE").".pm";
|
||||
autotest::loadtest get_var('CASEDIR')."/tests/upgrade_run_".get_var("UPGRADE").".pm";
|
||||
autotest::loadtest get_var('CASEDIR')."/tests/upgrade_postinstall_".get_var("UPGRADE").".pm";
|
||||
}
|
||||
else
|
||||
{
|
||||
autotest::loadtest get_var('CASEDIR')."/tests/_boot_to_anaconda.pm";
|
||||
|
@ -7,11 +7,12 @@
|
||||
],
|
||||
"area": [
|
||||
{
|
||||
"width": 1018,
|
||||
"height": 13,
|
||||
"xpos": 0,
|
||||
"ypos": 0,
|
||||
"width": 204,
|
||||
"height": 13,
|
||||
"type": "match"
|
||||
}
|
||||
]
|
||||
],
|
||||
"properties": []
|
||||
}
|
@ -1,18 +1,18 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 13,
|
||||
"width": 204,
|
||||
"ypos": 16,
|
||||
"type": "match",
|
||||
"xpos": 0
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"console_command_success",
|
||||
"ENV-DISTRI-fedora",
|
||||
"ENV-INSTLANG-en_US",
|
||||
"ENV-FLAVOR-server"
|
||||
],
|
||||
"area": [
|
||||
{
|
||||
"type": "match",
|
||||
"width": 1012,
|
||||
"height": 13,
|
||||
"xpos": 0,
|
||||
"ypos": 16
|
||||
}
|
||||
],
|
||||
"properties": []
|
||||
}
|
18
needles/console_f22_installed.json
Normal file
18
needles/console_f22_installed.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"properties": [],
|
||||
"area": [
|
||||
{
|
||||
"xpos": 0,
|
||||
"ypos": 129,
|
||||
"width": 238,
|
||||
"height": 12,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"console_f22_installed",
|
||||
"ENV-DISTRI-fedora",
|
||||
"ENV-INSTLANG-en_US",
|
||||
"ENV-FLAVOR-develop"
|
||||
]
|
||||
}
|
BIN
needles/console_f22_installed.png
Normal file
BIN
needles/console_f22_installed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
18
needles/console_password_required2.json
Normal file
18
needles/console_password_required2.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"properties": [],
|
||||
"area": [
|
||||
{
|
||||
"xpos": 1,
|
||||
"height": 17,
|
||||
"width": 77,
|
||||
"ypos": 79,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"console_password_required",
|
||||
"ENV-DISTRI-fedora",
|
||||
"ENV-INSTLANG-en_US",
|
||||
"ENV-FLAVOR-server"
|
||||
]
|
||||
}
|
BIN
needles/console_password_required2.png
Normal file
BIN
needles/console_password_required2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 882 B |
18
needles/grub_fedup.json
Normal file
18
needles/grub_fedup.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"properties": [],
|
||||
"area": [
|
||||
{
|
||||
"xpos": 119,
|
||||
"ypos": 51,
|
||||
"width": 61,
|
||||
"height": 10,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"grub_fedup",
|
||||
"ENV-DISTRI-fedora",
|
||||
"ENV-INSTLANG-en_US",
|
||||
"ENV-FLAVOR-server"
|
||||
]
|
||||
}
|
BIN
needles/grub_fedup.png
Normal file
BIN
needles/grub_fedup.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
@ -1,17 +1,18 @@
|
||||
{
|
||||
"properties": [],
|
||||
"area": [
|
||||
{
|
||||
"width": 156,
|
||||
"xpos": 0,
|
||||
"height": 19,
|
||||
"ypos": 113,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"root_logged_in",
|
||||
"ENV-DISTRI-fedora",
|
||||
"ENV-INSTLANG-en_US",
|
||||
"ENV-FLAVOR-server"
|
||||
],
|
||||
"area": [
|
||||
{
|
||||
"xpos": 0,
|
||||
"ypos": 126,
|
||||
"width": 156,
|
||||
"height": 22,
|
||||
"type": "match"
|
||||
}
|
||||
]
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
18
needles/tmp_failed_proc.json
Normal file
18
needles/tmp_failed_proc.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"tags": [
|
||||
"tmp_failed_proc",
|
||||
"ENV-DISTRI-fedora",
|
||||
"ENV-INSTLANG-en_US",
|
||||
"ENV-FLAVOR-develop"
|
||||
],
|
||||
"properties": [],
|
||||
"area": [
|
||||
{
|
||||
"xpos": 71,
|
||||
"ypos": 338,
|
||||
"width": 251,
|
||||
"height": 11,
|
||||
"type": "match"
|
||||
}
|
||||
]
|
||||
}
|
BIN
needles/tmp_failed_proc.png
Normal file
BIN
needles/tmp_failed_proc.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
23
templates
23
templates
@ -176,6 +176,16 @@
|
||||
},
|
||||
test_suite => { name => "server_kickstart_hdd" },
|
||||
},
|
||||
{
|
||||
machine => { name => "64bit" },
|
||||
product => {
|
||||
arch => "x86_64",
|
||||
distri => "fedora",
|
||||
flavor => "universal",
|
||||
version => "*",
|
||||
},
|
||||
test_suite => { name => "fedup_minimal" },
|
||||
},
|
||||
],
|
||||
Machines => [
|
||||
{
|
||||
@ -369,7 +379,7 @@
|
||||
},
|
||||
{
|
||||
name => "server_kickstart_hdd",
|
||||
prio => 13,
|
||||
prio => 14,
|
||||
settings => [
|
||||
{ key => "KICKSTART", value => "1" },
|
||||
{ key => "GRUB", value => "inst.ks=hd:vdb1:/root-user-crypted-net.ks" },
|
||||
@ -381,5 +391,16 @@
|
||||
],
|
||||
variables => "",
|
||||
},
|
||||
{
|
||||
name => "fedup_minimal",
|
||||
prio => 15,
|
||||
settings => [
|
||||
{ key => "ROOT_PASSWORD", value => "weakpassword" },
|
||||
{ key => "BOOTFROM", value => "c" },
|
||||
{ key => "HDD_1", value => "disk_f21.img" },
|
||||
{ key => "UPGRADE", value => "minimal" },
|
||||
],
|
||||
variables => "",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
37
tests/upgrade_postinstall_minimal.pm
Normal file
37
tests/upgrade_postinstall_minimal.pm
Normal file
@ -0,0 +1,37 @@
|
||||
use base "fedoralog";
|
||||
use strict;
|
||||
use testapi;
|
||||
|
||||
sub boot_and_login {
|
||||
wait_still_screen 10;
|
||||
|
||||
my $password = get_var("ROOT_PASSWORD", "weakpassword");
|
||||
|
||||
send_key "ctrl-alt-f3";
|
||||
assert_screen "text_console_login", 20;
|
||||
type_string "root";
|
||||
send_key "ret";
|
||||
assert_screen "console_password_required", 10;
|
||||
type_string $password;
|
||||
send_key "ret";
|
||||
assert_screen "root_logged_in", 10;
|
||||
}
|
||||
|
||||
sub run {
|
||||
boot_and_login();
|
||||
|
||||
assert_screen "console_f22_installed";
|
||||
}
|
||||
|
||||
|
||||
sub test_flags {
|
||||
# without anything - rollback to 'lastgood' snapshot if failed
|
||||
# 'fatal' - whole test suite is in danger if this fails
|
||||
# 'milestone' - after this test succeeds, update 'lastgood'
|
||||
# 'important' - if this fails, set the overall state to 'fail'
|
||||
return { fatal => 1 };
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
# vim: set sw=4 et:
|
50
tests/upgrade_preinstall_minimal.pm
Normal file
50
tests/upgrade_preinstall_minimal.pm
Normal file
@ -0,0 +1,50 @@
|
||||
use base "fedoralog";
|
||||
use strict;
|
||||
use testapi;
|
||||
|
||||
sub boot_and_login {
|
||||
wait_still_screen 10;
|
||||
|
||||
my $password = get_var("ROOT_PASSWORD", "weakpassword");
|
||||
|
||||
send_key "ctrl-alt-f3";
|
||||
assert_screen "text_console_login", 20;
|
||||
type_string "root";
|
||||
send_key "ret";
|
||||
assert_screen "console_password_required", 10;
|
||||
type_string $password;
|
||||
send_key "ret";
|
||||
assert_screen "root_logged_in", 10;
|
||||
}
|
||||
|
||||
sub run {
|
||||
boot_and_login();
|
||||
|
||||
type_string 'yum -y update; echo $?';
|
||||
send_key "ret";
|
||||
|
||||
assert_screen "console_command_success", 1800;
|
||||
|
||||
type_string "reboot";
|
||||
send_key "ret";
|
||||
|
||||
boot_and_login();
|
||||
|
||||
type_string 'yum -y install fedup; echo $?';
|
||||
send_key "ret";
|
||||
|
||||
assert_screen "console_command_success", 1800;
|
||||
}
|
||||
|
||||
|
||||
sub test_flags {
|
||||
# without anything - rollback to 'lastgood' snapshot if failed
|
||||
# 'fatal' - whole test suite is in danger if this fails
|
||||
# 'milestone' - after this test succeeds, update 'lastgood'
|
||||
# 'important' - if this fails, set the overall state to 'fail'
|
||||
return { fatal => 1 };
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
# vim: set sw=4 et:
|
53
tests/upgrade_run_minimal.pm
Normal file
53
tests/upgrade_run_minimal.pm
Normal file
@ -0,0 +1,53 @@
|
||||
use base "fedoralog";
|
||||
use strict;
|
||||
use testapi;
|
||||
|
||||
sub run {
|
||||
my $fedup_url;
|
||||
my $to_version;
|
||||
# FIXME: this is just a workaround, see https://phab.qadevel.cloud.fedoraproject.org/T478
|
||||
if (get_var("BUILD") =~ /^(\d+)_Final_(.*)$/) {
|
||||
$fedup_url = "https://dl.fedoraproject.org/pub/alt/stage/".$1."_".$2."/Server/".get_var("ARCH")."/os";
|
||||
$to_version = $1;
|
||||
} else {
|
||||
$fedup_url = "https://dl.fedoraproject.org/pub/alt/stage/".get_var("BUILD")."/Server/".get_var("ARCH")."/os";
|
||||
get_var("BUILD") =~ /^(\d+)/;
|
||||
$to_version = $1;
|
||||
}
|
||||
|
||||
type_string "fedup --network ".$to_version." --instrepo ".$fedup_url;
|
||||
send_key "ret";
|
||||
|
||||
wait_still_screen 30, 6000; # TODO: shorter timeout, longer stillscreen?
|
||||
|
||||
upload_logs "/var/log/fedup.log";
|
||||
|
||||
type_string "reboot";
|
||||
send_key "ret";
|
||||
|
||||
assert_screen "grub_fedup", 30;
|
||||
send_key "ret";
|
||||
|
||||
my $counter = 0;
|
||||
|
||||
while (!check_screen ("text_console_login", 10) && $counter < 180) {
|
||||
if (check_screen "tmp_failed_proc", 1) {
|
||||
send_key "ctrl-alt-delete";
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
assert_screen "text_console_login", 10;
|
||||
}
|
||||
|
||||
|
||||
sub test_flags {
|
||||
# without anything - rollback to 'lastgood' snapshot if failed
|
||||
# 'fatal' - whole test suite is in danger if this fails
|
||||
# 'milestone' - after this test succeeds, update 'lastgood'
|
||||
# 'important' - if this fails, set the overall state to 'fail'
|
||||
return { fatal => 1 };
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
# vim: set sw=4 et:
|
Loading…
Reference in New Issue
Block a user