From 5264388dc568187b3d1013c5ff69bc8c890b1642 Mon Sep 17 00:00:00 2001 From: Josef Skladanka Date: Mon, 26 Jan 2015 15:58:07 +0100 Subject: [PATCH] Added 'server_simple' testsuite --- main.pm | 15 +++- needles/anaconda_main_hub_server.json | 2 +- needles/bootloader_server.json | 2 +- needles/text_console_login.json | 4 +- templates | 85 +------------------ tests/_boot_to_anaconda.pm | 40 +++++++++ ...ll_simple.pm => _do_install_and_reboot.pm} | 28 +----- tests/_wait_for_login_screen.pm | 22 +++++ tests/disk_guided_empty.pm | 28 ++++++ 9 files changed, 115 insertions(+), 111 deletions(-) create mode 100644 tests/_boot_to_anaconda.pm rename tests/{install_simple.pm => _do_install_and_reboot.pm} (61%) create mode 100644 tests/_wait_for_login_screen.pm create mode 100644 tests/disk_guided_empty.pm diff --git a/main.pm b/main.pm index 73e74ed7..d6cfd7f4 100644 --- a/main.pm +++ b/main.pm @@ -18,7 +18,20 @@ use strict; use testapi; use autotest; -autotest::loadtest get_var('CASEDIR')."/tests/install_simple.pm"; +# Boot to anaconda Hub in English +autotest::loadtest get_var('CASEDIR')."/tests/_boot_to_anaconda.pm"; + +## Disk partitioning +if (get_var('DISK_GUIDED_EMPTY')){ + autotest::loadtest get_var('CASEDIR')."/tests/disk_guided_empty.pm"; +} + +# Start installation, set user & root passwords, reboot +autotest::loadtest get_var('CASEDIR')."/tests/_do_install_and_reboot.pm"; + + +# Wait for the login screen +autotest::loadtest get_var('CASEDIR')."/tests/_wait_for_login_screen.pm"; 1; diff --git a/needles/anaconda_main_hub_server.json b/needles/anaconda_main_hub_server.json index ca845cbd..52dbfaad 100644 --- a/needles/anaconda_main_hub_server.json +++ b/needles/anaconda_main_hub_server.json @@ -44,7 +44,7 @@ } ], "tags": [ - "anaconda_main_hub_server", + "anaconda_main_hub", "ENV-DESKTOP-default", "ENV-DISTRI-fedora", "ENV-INSTLANG-en_US" diff --git a/needles/bootloader_server.json b/needles/bootloader_server.json index 90b2499a..1c2bffd3 100644 --- a/needles/bootloader_server.json +++ b/needles/bootloader_server.json @@ -16,7 +16,7 @@ } ], "tags": [ - "bootloader_server", + "bootloader", "ENV-DESKTOP-default", "ENV-DISTRI-fedora", "ENV-INSTLANG-en_US" diff --git a/needles/text_console_login.json b/needles/text_console_login.json index 81a4746c..83936989 100644 --- a/needles/text_console_login.json +++ b/needles/text_console_login.json @@ -3,7 +3,7 @@ "ENV-DESKTOP-default", "ENV-DISTRI-fedora", "ENV-INSTLANG-en_US", - "text_console_login" + "clean_install_login" ], "area": [ { @@ -14,4 +14,4 @@ "type": "match" } ] -} \ No newline at end of file +} diff --git a/templates b/templates index be54ff28..a23b1a52 100755 --- a/templates +++ b/templates @@ -14,16 +14,10 @@ flavor => "server", version => "rawhide", }, - test_suite => { name => "Server Simple" }, + test_suite => { name => "server_simple" }, }, ], Machines => [ - { - backend => "qemu", - name => "32bit", - settings => [{ key => "QEMUCPU", value => "kvm32" }], - variables => "", - }, { backend => "qemu", name => "64bit", @@ -32,26 +26,6 @@ }, ], Products => [ - { - arch => "x86_64", - distri => "fedora", - flavor => "workstation", - name => "", - settings => [ - ], - variables => "", - version => "rawhide", - }, - { - arch => "i686", - distri => "fedora", - flavor => "workstation", - name => "", - settings => [ - ], - variables => "", - version => "rawhide", - }, { arch => "x86_64", distri => "fedora", @@ -62,64 +36,13 @@ variables => "", version => "rawhide", }, - { - arch => "i686", - distri => "fedora", - flavor => "server", - name => "", - settings => [ - ], - variables => "", - version => "rawhide", - }, - { - arch => "x86_64", - distri => "fedora", - flavor => "workstation", - name => "", - settings => [ - ], - variables => "", - version => "branched", - }, - { - arch => "i686", - distri => "fedora", - flavor => "workstation", - name => "", - settings => [ - ], - variables => "", - version => "branched", - }, - { - arch => "x86_64", - distri => "fedora", - flavor => "server", - name => "", - settings => [ - ], - variables => "", - version => "branched", - }, - { - arch => "i686", - distri => "fedora", - flavor => "server", - name => "", - settings => [ - ], - variables => "", - version => "branched", - }, ], TestSuites => [ { - name => "Server Simple", - prio => 50, + name => "server_simple", + prio => 1, settings => [ - { key => "HDDMODEL", value => "virtio-blk" }, - { key => "PRODUCTNAME", value => "server" }, + { key => "DISK_GUIDED_EMPTY", value => "1" }, ], variables => "", }, diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm new file mode 100644 index 00000000..33ef27ed --- /dev/null +++ b/tests/_boot_to_anaconda.pm @@ -0,0 +1,40 @@ +use base "basetest"; +use strict; +use testapi; + +sub run { + # Wait for bootloader to appear + + assert_screen "bootloader", 30; + + if ( get_var("FLAVOR") eq "server") + { + # Skip the media check on DVD + send_key "up"; + } + + send_key "ret"; + + # Select install language + assert_screen "anaconda_select_install_lang", 300; + type_string "english"; + assert_and_click "anaconda_select_install_lang_english_filtered"; + assert_screen "anaconda_select_install_lang_english_selected", 3; + assert_and_click "anaconda_select_install_lang_continue"; + + # Anaconda hub + assert_screen "anaconda_main_hub", 300; # +} + + +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 { milestone => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/install_simple.pm b/tests/_do_install_and_reboot.pm similarity index 61% rename from tests/install_simple.pm rename to tests/_do_install_and_reboot.pm index e863d735..3beba5fd 100644 --- a/tests/install_simple.pm +++ b/tests/_do_install_and_reboot.pm @@ -3,30 +3,12 @@ use strict; use testapi; sub run { - # Wait for bootloader to appear - - assert_screen "bootloader_".get_var("FLAVOR"), 30; - - # Skip the media check - send_key "up"; - send_key "ret"; - # Select install language - assert_screen "anaconda_select_install_lang", 300; - type_string "english"; - assert_and_click "anaconda_select_install_lang_english_filtered"; - assert_screen "anaconda_select_install_lang_english_selected", 3; - assert_and_click "anaconda_select_install_lang_continue"; - # Anaconda hub - assert_screen "anaconda_main_hub_".get_var("FLAVOR"), 300; # - - # Default install destination (hdd should be empty for new KVM machine) - assert_and_click "anaconda_main_hub_install_destination"; - assert_and_click "anaconda_spoke_done"; + assert_screen "anaconda_main_hub", 300; # # Begin installation assert_and_click "anaconda_main_hub_begin_installation"; - + # Set root password assert_and_click "anaconda_install_root_password"; type_string "fedora"; @@ -54,10 +36,6 @@ sub run { # Wait for install to end assert_screen "anaconda_install_done", 1800; assert_and_click "anaconda_install_finish"; - - # Reboot and wait for the text login - assert_screen "text_console_login", 300; - } sub test_flags { @@ -65,7 +43,7 @@ sub test_flags { # '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 { important => 1 }; + return { milestone => 1 }; } 1; diff --git a/tests/_wait_for_login_screen.pm b/tests/_wait_for_login_screen.pm new file mode 100644 index 00000000..41a658b8 --- /dev/null +++ b/tests/_wait_for_login_screen.pm @@ -0,0 +1,22 @@ +use base "basetest"; +use strict; +use testapi; + +sub run { + + # Reboot and wait for the text login + assert_screen "clean_install_login", 300; + +} + +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 { milestone => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/disk_guided_empty.pm b/tests/disk_guided_empty.pm new file mode 100644 index 00000000..5d4996cc --- /dev/null +++ b/tests/disk_guided_empty.pm @@ -0,0 +1,28 @@ +use base "basetest"; +use strict; +use testapi; + +sub run { + # Anaconda hub + assert_screen "anaconda_main_hub", 300; # + + # Default install destination (hdd should be empty for new KVM machine) + assert_and_click "anaconda_main_hub_install_destination"; + assert_and_click "anaconda_spoke_done"; + + # Anaconda hub + assert_screen "anaconda_main_hub", 300; # + +} + +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 { important => 1 }; +} + +1; + +# vim: set sw=4 et: