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
  • Loading branch information
Zaoliang committed Sep 10, 2020
1 parent 225350b commit f8099ce
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 10 deletions.
42 changes: 32 additions & 10 deletions lib/bootloader_setup.pm
Expand Up @@ -262,20 +262,42 @@ sub boot_local_disk {
sub boot_into_snapshot {
send_key_until_needlematch('boot-menu-snapshot', 'down', 10, 5);
send_key 'ret';
# assert needle to avoid send down key early in grub_test_snapshot.
assert_screen('snap-default', 120) if (get_var('OFW') || is_pvm);
# BOOT_INTO_SNAPSHOT_AFTER_UPGRADE - boot into tumbleweed default.
if (get_var('BOOT_INTO_SNAPSHOT_AFTER_UPGRADE')) {
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')) {
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;
}
elsif (get_var('OFW') || is_pvm) {
# assert needle to avoid send down key early in grub_test_snapshot.
assert_screen('snap-default', 120);
}
# 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;
# 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';
}
# 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';
}

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 f8099ce

Please sign in to comment.