diff --git a/lib/fedoralog.pm b/lib/fedoralog.pm index c7cbeb06..0fa9701c 100644 --- a/lib/fedoralog.pm +++ b/lib/fedoralog.pm @@ -20,11 +20,17 @@ sub login_as_root { assert_screen "root_logged_in", 10; } -sub boot_and_login { +sub boot_to_login_screen { my $self = shift; - wait_still_screen 10; + my $boot_done_screen = shift; + my $stillscreen = shift || 10; + my $timeout = shift || 60; - $self->login_as_root(3); + wait_still_screen $stillscreen, $timeout; + + if ($boot_done_screen ne "") { + assert_screen $boot_done_screen; + } } sub post_fail_hook { diff --git a/main.pm b/main.pm index 112ceaed..189f810a 100644 --- a/main.pm +++ b/main.pm @@ -57,8 +57,8 @@ if (get_var("ENTRYPOINT")) } 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_preinstall.pm"; + autotest::loadtest get_var('CASEDIR')."/tests/upgrade_run.pm"; autotest::loadtest get_var('CASEDIR')."/tests/upgrade_postinstall_".get_var("UPGRADE").".pm"; } else diff --git a/needles/graphical_login_gdm.json b/needles/graphical_login_gdm.json index 42df7160..5599c253 100644 --- a/needles/graphical_login_gdm.json +++ b/needles/graphical_login_gdm.json @@ -1,17 +1,18 @@ { "tags": [ - "ENV-DESKTOP-gnome", + "graphical_login", "ENV-DISTRI-fedora", "ENV-INSTLANG-en_US", - "graphical_login" + "ENV-FLAVOR-develop" ], + "properties": [], "area": [ { - "xpos": 335, - "ypos": 423, - "width": 67, - "height": 12, - "type": "match" + "width": 206, + "type": "match", + "xpos": 405, + "height": 106, + "ypos": 645 } ] } diff --git a/needles/graphical_login_gdm.png b/needles/graphical_login_gdm.png index 28f65cfa..a1601fd7 100644 Binary files a/needles/graphical_login_gdm.png and b/needles/graphical_login_gdm.png differ diff --git a/needles/graphical_login_gdm_input.json b/needles/graphical_login_gdm_input.json new file mode 100644 index 00000000..becff622 --- /dev/null +++ b/needles/graphical_login_gdm_input.json @@ -0,0 +1,25 @@ +{ + "area": [ + { + "xpos": 341, + "ypos": 372, + "width": 343, + "height": 65, + "type": "match" + }, + { + "xpos": 600, + "ypos": 470, + "width": 80, + "height": 30, + "type": "match" + } + ], + "tags": [ + "graphical_login_input", + "ENV-DISTRI-fedora", + "ENV-INSTLANG-en_US", + "ENV-FLAVOR-develop" + ], + "properties": [] +} diff --git a/needles/graphical_login_gdm_input.png b/needles/graphical_login_gdm_input.png new file mode 100644 index 00000000..30dd3aba Binary files /dev/null and b/needles/graphical_login_gdm_input.png differ diff --git a/needles/text_console_login.json b/needles/text_console_login.json index 6b104da3..297a7066 100644 --- a/needles/text_console_login.json +++ b/needles/text_console_login.json @@ -1,17 +1,18 @@ { "tags": [ - "ENV-DESKTOP-default", + "text_console_login", "ENV-DISTRI-fedora", "ENV-INSTLANG-en_US", - "text_console_login" + "ENV-FLAVOR-develop" ], + "properties": [], "area": [ { + "width": 128, "xpos": 0, + "type": "match", "ypos": 49, - "width": 140, - "height": 50, - "type": "match" + "height": 30 } ] -} +} \ No newline at end of file diff --git a/needles/text_console_login.png b/needles/text_console_login.png index baa85f45..400f61b4 100644 Binary files a/needles/text_console_login.png and b/needles/text_console_login.png differ diff --git a/templates b/templates index e3812e79..29889b1b 100755 --- a/templates +++ b/templates @@ -186,6 +186,16 @@ }, test_suite => { name => "fedup_minimal" }, }, + { + machine => { name => "64bit" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "fedup_desktop" }, + }, ], Machines => [ { @@ -397,10 +407,21 @@ settings => [ { key => "ROOT_PASSWORD", value => "weakpassword" }, { key => "BOOTFROM", value => "c" }, - { key => "HDD_1", value => "disk_f21.img" }, + { key => "HDD_1", value => "disk_f21_minimal.img" }, { key => "UPGRADE", value => "minimal" }, ], variables => "", }, + { + name => "fedup_desktop", + prio => 15, + settings => [ + { key => "ROOT_PASSWORD", value => "weakpassword" }, + { key => "BOOTFROM", value => "c" }, + { key => "HDD_1", value => "disk_f21_desktop.img" }, + { key => "UPGRADE", value => "desktop" }, + ], + variables => "", + }, ], } diff --git a/tests/upgrade_preinstall_minimal.pm b/tests/upgrade_postinstall_desktop.pm similarity index 60% rename from tests/upgrade_preinstall_minimal.pm rename to tests/upgrade_postinstall_desktop.pm index 6cae59f7..0074518a 100644 --- a/tests/upgrade_preinstall_minimal.pm +++ b/tests/upgrade_postinstall_desktop.pm @@ -2,25 +2,18 @@ use base "fedoralog"; use strict; use testapi; + sub run { my $self = shift; + my $password = get_var("PASSWORD", "weakpassword"); - $self->boot_and_login(); + $self->boot_to_login_screen("graphical_login", 20); - type_string 'yum -y update; echo $?'; send_key "ret"; - - assert_screen "console_command_success", 1800; - - type_string "reboot"; + assert_screen "graphical_login_input"; + type_string $password; send_key "ret"; - - $self->boot_and_login(); - - type_string 'yum -y install fedup; echo $?'; - send_key "ret"; - - assert_screen "console_command_success", 1800; + assert_screen "graphical_desktop_clean", 30; } diff --git a/tests/upgrade_postinstall_minimal.pm b/tests/upgrade_postinstall_minimal.pm index 66b4569a..bd86aa3d 100644 --- a/tests/upgrade_postinstall_minimal.pm +++ b/tests/upgrade_postinstall_minimal.pm @@ -6,7 +6,8 @@ use testapi; sub run { my $self = shift; - $self->boot_and_login(); + $self->boot_to_login_screen(); + $self->login_as_root(3); assert_screen "console_f22_installed"; } diff --git a/tests/upgrade_preinstall.pm b/tests/upgrade_preinstall.pm new file mode 100644 index 00000000..72a1a5c4 --- /dev/null +++ b/tests/upgrade_preinstall.pm @@ -0,0 +1,49 @@ +use base "fedoralog"; +use strict; +use testapi; + +sub run { + my $self = shift; + + if (get_var('UPGRADE') eq "desktop") { + $self->boot_to_login_screen("graphical_login", 30); # GDM takes time to load + #} elsif (get_var('UPGRADE' eq "minimal")) { + } else { + $self->boot_to_login_screen(); + } + $self->login_as_root(3); + + type_string 'yum -y update; echo $?'; + send_key "ret"; + + assert_screen "console_command_success", 1800; + + type_string "reboot"; + send_key "ret"; + + if (get_var('UPGRADE') eq "desktop") { + $self->boot_to_login_screen("graphical_login", 30); # GDM takes time to load + #} elsif (get_var('UPGRADE' eq "minimal")) { + } else { + $self->boot_to_login_screen(); + } + $self->login_as_root(3); + + 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: diff --git a/tests/upgrade_run_minimal.pm b/tests/upgrade_run.pm similarity index 85% rename from tests/upgrade_run_minimal.pm rename to tests/upgrade_run.pm index c59f40de..50e4c9dc 100644 --- a/tests/upgrade_run_minimal.pm +++ b/tests/upgrade_run.pm @@ -28,7 +28,12 @@ sub run { assert_screen "grub_fedup", 30; send_key "ret"; - assert_screen "text_console_login", 6000; + if (get_var('UPGRADE') eq "desktop") { + assert_screen "graphical_login", 6000; + #} elsif (get_var('UPGRADE' eq "minimal")) { + } else { + assert_screen "text_console_login", 6000; + } }