diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..d38c149c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.swp +*~ diff --git a/main.pm b/main.pm index 82b026d5..2a5a7ad7 100644 --- a/main.pm +++ b/main.pm @@ -41,7 +41,10 @@ unless (get_var("KICKSTART")) # Wait for the login screen autotest::loadtest get_var('CASEDIR')."/tests/_wait_for_login_screen.pm"; - +if (get_var('DISK_GUIDED_MULTI')) +{ + autotest::loadtest get_var('CASEDIR')."/tests/disk_guided_multi_postinstall.pm"; +} 1; # vim: set sw=4 et: diff --git a/needles/anaconda_install_destination_two_disks.json b/needles/anaconda_install_destination_two_disks.json new file mode 100644 index 00000000..44baa98c --- /dev/null +++ b/needles/anaconda_install_destination_two_disks.json @@ -0,0 +1,17 @@ +{ + "tags": [ + "anaconda_install_destination_two_disks", + "ENV-DISTRI-fedora", + "ENV-INSTLANG-en_US", + "ENV-FLAVOR-server" + ], + "area": [ + { + "xpos": 57, + "ypos": 203, + "width": 322, + "height": 46, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/anaconda_install_destination_two_disks.png b/needles/anaconda_install_destination_two_disks.png new file mode 100644 index 00000000..e80a235d Binary files /dev/null and b/needles/anaconda_install_destination_two_disks.png differ diff --git a/needles/console_command_success.json b/needles/console_command_success.json new file mode 100644 index 00000000..99976f01 --- /dev/null +++ b/needles/console_command_success.json @@ -0,0 +1,17 @@ +{ + "tags": [ + "console_command_success", + "ENV-DISTRI-fedora", + "ENV-INSTLANG-en_US", + "ENV-FLAVOR-server" + ], + "area": [ + { + "xpos": 0, + "ypos": 0, + "width": 204, + "height": 13, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/console_command_success.png b/needles/console_command_success.png new file mode 100644 index 00000000..4ffa51a8 Binary files /dev/null and b/needles/console_command_success.png differ diff --git a/needles/provided_disk_intact.json b/needles/provided_disk_intact.json new file mode 100644 index 00000000..d6b45092 --- /dev/null +++ b/needles/provided_disk_intact.json @@ -0,0 +1,17 @@ +{ + "tags": [ + "provided_disk_intact", + "ENV-DISTRI-fedora", + "ENV-INSTLANG-en_US", + "ENV-FLAVOR-server" + ], + "area": [ + { + "xpos": 0, + "ypos": 0, + "width": 104, + "height": 155, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/provided_disk_intact.png b/needles/provided_disk_intact.png new file mode 100644 index 00000000..0b76aa94 Binary files /dev/null and b/needles/provided_disk_intact.png differ diff --git a/templates b/templates index ffa6a136..6c4e0ffd 100755 --- a/templates +++ b/templates @@ -72,7 +72,7 @@ settings => [ { key => "KICKSTART", value => "1" }, { key => "BOOT_KICKSTART_HTTP", value => "1" }, - { key => "CHECK_LOGIN", value => "1" }, + { key => "DO_LOGIN", value => "1" }, { key => "USER_LOGIN", value => "test" }, { key => "USER_PASSWORD", value => "test" }, { key => "ROOT_PASSWORD", value => "111111" }, diff --git a/tests/_wait_for_login_screen.pm b/tests/_wait_for_login_screen.pm index 56c4bd07..ab099ca5 100644 --- a/tests/_wait_for_login_screen.pm +++ b/tests/_wait_for_login_screen.pm @@ -11,21 +11,33 @@ sub run { # Reboot and wait for the text login assert_screen "clean_install_login", $wait_time; - if (get_var("CHECK_LOGIN")) + if (get_var("DO_LOGIN")) { if (get_var("FLAVOR") eq "server") { - type_string get_var("USER_LOGIN"); - send_key "ret"; - type_string get_var("USER_PASSWORD"); - send_key "ret"; - assert_screen "user_logged_in", 10; - + my $user_logged_in = 0; + if (get_var("USER_LOGIN")) + { + type_string get_var("USER_LOGIN"); + send_key "ret"; + type_string get_var("USER_PASSWORD"); + send_key "ret"; + assert_screen "user_logged_in", 10; + $user_logged_in = 1; + } if (get_var("ROOT_PASSWORD")) { - type_string "su -"; - send_key "ret"; - assert_screen "console_password_required", 10; + if ($user_logged_in == 1) + { + type_string "su -"; + send_key "ret"; + assert_screen "console_password_required", 10; + } + else + { + type_string "root"; + send_key "ret"; + } type_string get_var("ROOT_PASSWORD"); send_key "ret"; assert_screen "root_logged_in", 10; diff --git a/tests/disk_guided_multi.pm b/tests/disk_guided_multi.pm index 52aec51e..3fb10406 100644 --- a/tests/disk_guided_multi.pm +++ b/tests/disk_guided_multi.pm @@ -6,10 +6,11 @@ sub run { # Anaconda hub assert_screen "anaconda_main_hub", 300; # - # Select both disks + # Select the first disk assert_and_click "anaconda_main_hub_install_destination"; + + assert_screen "anaconda_install_destination_two_disks"; assert_and_click "anaconda_install_destination_select_disk_1"; - assert_and_click "anaconda_install_destination_select_disk_2"; assert_and_click "anaconda_spoke_done"; # Anaconda hub diff --git a/tests/disk_guided_multi_postinstall.pm b/tests/disk_guided_multi_postinstall.pm new file mode 100644 index 00000000..12d1d074 --- /dev/null +++ b/tests/disk_guided_multi_postinstall.pm @@ -0,0 +1,25 @@ +use base "basetest"; +use strict; +use testapi; + +sub run { + assert_screen "root_logged_in"; + type_string "reset; mount /dev/sdb1 /mnt; echo $?"; + send_key "ret"; + assert_screen "console_command_success"; + type_string "reset; cat /mnt/testfile"; + send_key "ret"; + assert_screen "provided_disk_intact"; +} + +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: