Skip to content

Commit

Permalink
Add test boot_into_snapshot_after_upgrade and roll_back_after_upgrade
Browse files Browse the repository at this point in the history
See https://progress.opensuse.org/issues/12964
Introduce BOOT_INTO_SNAPSHOT_AFTER_UPGRADE and ROLL_BACK_AFTER_UPGRADE in
lib/bootloader_setup.pm at function BOOT_INTO_SNAPSHOT
Verifications:
http://10.162.23.47/tests/8142 (Boot_into_snapshot_after_upgrade)
http://10.162.23.47/tests/8143 (Roll_back_after_upgrade)

Needles PR:
os-autoinst/os-autoinst-needles-opensuse#690
  • Loading branch information
Zaoliang committed Sep 11, 2020
1 parent bb6dc46 commit 7932662
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 9 deletions.
56 changes: 47 additions & 9 deletions lib/bootloader_setup.pm
Expand Up @@ -18,7 +18,7 @@ use Mojo::Util 'trim';
use Time::HiRes 'sleep';
use testapi;
use utils;
use version_utils qw(is_caasp is_jeos is_leap is_sle is_tumbleweed);
use version_utils qw(is_caasp is_jeos is_leap is_sle is_tumbleweed is_opensuse);
use mm_network;
use Utils::Backends 'is_pvm';

Expand Down Expand Up @@ -262,20 +262,58 @@ sub boot_local_disk {
sub boot_into_snapshot {
send_key_until_needlematch('boot-menu-snapshot', 'down', 10, 5);
send_key 'ret';
# BOOT_INTO_SNAPSHOT_AFTER_UPGRADE - boot into tumbleweed default.
if (get_var('BOOT_INTO_SNAPSHOT_AFTER_UPGRADE') && is_opensuse) {
send_key_until_needlematch('snap-after-update', 'down', 10, 5);
send_key 'ret';
send_key_until_needlematch('advanced-options-tumbleweed', 'down', 10, 5);
send_key 'ret';
send_key_until_needlematch('boot-tumbleweed-default', 'down', 10, 5);
send_key 'ret';
assert_screen 'opensuse-welcome', 120;
}
# ROLL_BACK_AFTER_UPGRADE - boot into leap before upgradde
elsif (get_var('ROLL_BACK_AFTER_UPGRADE') && is_opensuse) {
send_key_until_needlematch('snap-before-update', 'down', 10, 5);
send_key 'ret';
send_key_until_needlematch('advanced-options-leap', 'down', 10, 5);
send_key 'ret';
send_key_until_needlematch('boot-leap-default', 'down', 10, 5);
send_key 'ret';
assert_screen 'generic-desktop', 120;
}
# assert needle to avoid send down key early in grub_test_snapshot.
assert_screen('snap-default', 120) if (get_var('OFW') || is_pvm);
elsif (get_var('OFW') || is_pvm) {
assert_screen('snap-default', 120);
save_screenshot;
send_key 'ret';
# avoid timeout for booting to HDD
save_screenshot;
send_key 'ret';
}
# in upgrade/migration scenario, we want to boot from snapshot 1 before migration.
if ((get_var('UPGRADE') && !get_var('ONLINE_MIGRATION', 0)) || get_var('ZDUP')) {
elsif ((get_var('UPGRADE') && !get_var('ONLINE_MIGRATION', 0)) || get_var('ZDUP')) {
send_key_until_needlematch('snap-before-update', 'down', 40, 5);
save_screenshot;
send_key 'ret';
# avoid timeout for booting to HDD
save_screenshot;
send_key 'ret';
}
# in an online migration
send_key_until_needlematch('snap-before-migration', 'down', 40, 5) if (get_var('ONLINE_MIGRATION'));
save_screenshot;
send_key 'ret';
# avoid timeout for booting to HDD
save_screenshot;
send_key 'ret';
elsif (get_var('ONLINE_MIGRATION')) {
send_key_until_needlematch('snap-before-migration', 'down', 40, 5);
save_screenshot;
send_key 'ret';
# avoid timeout for booting to HDD
save_screenshot;
send_key 'ret';
}
else {
# avoid timeout for booting to HDD
save_screenshot;
send_key 'ret';
}
}

sub select_bootmenu_option {
Expand Down
19 changes: 19 additions & 0 deletions schedule/functional/boot_into_snapshot_after_upgrade.yaml
@@ -0,0 +1,19 @@
---
name: boot_into_snapshot_after_upgrade
description: >
Maintainer: zluo
Boot into snapshoot after upgrade from DVD-Live installation
schedule:
- installation/isosize
- installation/bootloader
- installation/welcome
- installation/upgrade_select
- installation/online_repos
- installation/resolve_dependency_issues
- installation/installation_overview
- installation/disable_grub_timeout
- installation/start_install
- installation/await_install
- installation/logs_from_installation_system
- installation/reboot_after_installation
- installation/grub_test

0 comments on commit 7932662

Please sign in to comment.