mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2024-12-22 10:23:09 +00:00
Add QA:Testcase_RpmOstree_Rebase for iot testing (#167)
Signed-off-by: Paul Whalen <pwhalen@fedoraproject.org>
This commit is contained in:
parent
8c40583ee6
commit
fd440bfd3a
@ -1518,6 +1518,20 @@
|
||||
"START_AFTER_TEST": "install_default_upload"
|
||||
}
|
||||
},
|
||||
"iot_rpmostree_rebase": {
|
||||
"profiles": {
|
||||
"fedora-IoT-dvd_ostree-iso-aarch64-*-aarch64": 20,
|
||||
"fedora-IoT-dvd_ostree-iso-x86_64-*-64bit": 40
|
||||
},
|
||||
"settings": {
|
||||
"BOOTFROM": "c",
|
||||
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
|
||||
"POSTINSTALL": "iot_rpmostree_rebase",
|
||||
"ROOT_PASSWORD": "weakpassword",
|
||||
"START_AFTER_TEST": "install_default_upload",
|
||||
"USER_LOGIN": "false"
|
||||
}
|
||||
},
|
||||
"mediakit_fileconflicts": {
|
||||
"profiles": {
|
||||
"fedora-Server-dvd-iso-aarch64-*-aarch64": 10,
|
||||
|
61
tests/iot_rpmostree_rebase.pm
Normal file
61
tests/iot_rpmostree_rebase.pm
Normal file
@ -0,0 +1,61 @@
|
||||
use base "installedtest";
|
||||
use strict;
|
||||
use testapi;
|
||||
use utils;
|
||||
|
||||
sub run {
|
||||
|
||||
my $self = shift;
|
||||
$self->root_console(tty=>3);
|
||||
|
||||
# list available branches
|
||||
assert_script_run "ostree remote refs fedora-iot";
|
||||
|
||||
# check arch
|
||||
my $arch = lc(get_var("ARCH"));
|
||||
|
||||
# set default for rawhide or devel
|
||||
my $rebase = "stable";
|
||||
|
||||
# if testing the current release, rebase to devel
|
||||
unless (script_run "rpm-ostree status -b | grep stable") {
|
||||
$rebase = "devel"
|
||||
}
|
||||
# rebase to the appropriate release, arch
|
||||
validate_script_output "rpm-ostree rebase fedora/${rebase}/${arch}/iot", sub { m/systemctl reboot/ }, 300;
|
||||
script_run "systemctl reboot", 0;
|
||||
|
||||
boot_to_login_screen;
|
||||
$self->root_console(tty=>3);
|
||||
|
||||
# check booted branch to make sure successful rebase
|
||||
if ($rebase eq "devel") {
|
||||
validate_script_output "rpm-ostree status -b", sub { m/devel/ }, 300;
|
||||
}
|
||||
if ($rebase eq "stable") {
|
||||
validate_script_output "rpm-ostree status -b", sub { m/stable/ }, 300;
|
||||
}
|
||||
|
||||
# rollback and reboot
|
||||
validate_script_output "rpm-ostree rollback", sub { m/systemctl reboot/ }, 300;
|
||||
script_run "systemctl reboot", 0;
|
||||
|
||||
boot_to_login_screen;
|
||||
$self->root_console(tty=>3);
|
||||
|
||||
# check to make sure rollback successful, also account for branched (devel)
|
||||
if ($rebase eq "devel") {
|
||||
validate_script_output "rpm-ostree status -b", sub { m/stable/ }, 300;
|
||||
}
|
||||
if ($rebase eq "stable") {
|
||||
validate_script_output "rpm-ostree status -b", sub { m/rawhide|devel/ }, 300;
|
||||
}
|
||||
}
|
||||
|
||||
sub test_flags {
|
||||
return { fatal => 1 };
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
# vim: set sw=4 et:
|
Loading…
Reference in New Issue
Block a user