diff options
author | Philip Hands <phil@hands.com> | 2016-04-28 18:21:04 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-04-28 21:52:10 +0200 |
commit | 268339aa08aebba31eba5ab49c79ca5c85c85b56 (patch) | |
tree | 3fb8bc5cd34f3fc088d7b9bdcbc52cca165d2ce0 /features/step_definitions | |
parent | da080c472fc415b0ce918f4dd4a1ab143bb1bca4 (diff) | |
download | jenkins.debian.net-268339aa08aebba31eba5ab49c79ca5c85c85b56.tar.xz |
lvc based off of recent Tails
Diffstat (limited to 'features/step_definitions')
-rw-r--r-- | features/step_definitions/common_steps.rb | 165 | ||||
-rw-r--r-- | features/step_definitions/snapshots.rb | 46 |
2 files changed, 200 insertions, 11 deletions
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb index d7097a0d..a04ca2c8 100644 --- a/features/step_definitions/common_steps.rb +++ b/features/step_definitions/common_steps.rb @@ -257,15 +257,157 @@ When /^I destroy the computer$/ do $vm.destroy_and_undefine end -Given /^the computer (re)?boots DebianLive(|\d+)$/ do |reboot,version| - next if @skip_steps_while_restoring_background +Given /^the computer (re)?boots DebianInstaller(|\d+)$/ do |reboot,version| + + boot_timeout = 30 + # We need some extra time for memory wiping if rebooting + + @screen.wait("d-i8_bootsplash.png", boot_timeout) + @screen.type(Sikuli::Key.TAB) + + @screen.type(' preseed/early_command="echo ttyS0::askfirst:-/bin/sh>>/etc/inittab;kill -HUP 1"' + " blacklist=psmouse #{@boot_options}" + + Sikuli::Key.ENTER) + $vm.wait_until_remote_shell_is_up +end + +Given /^I select British English$/ do + @screen.wait("DebianInstallerSelectLangEnglish.png", 30) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("DebianInstallerCountrySelection.png", 10) + @screen.type(Sikuli::Key.UP) + @screen.waitVanish("DebianInstallerCountrySelection.png", 10) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("DebianInstallerSelectLangEnglishUK.png", 10) + @screen.type(Sikuli::Key.ENTER) +end + +Given /^I accept the hostname, using "([^"]*)" as the domain$/ do |domain| + @screen.wait("DebianInstallerHostnamePrompt.png", 5*60) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("DebianInstallerDomainPrompt.png", 10) + @screen.type(domain + Sikuli::Key.ENTER) + @screen.waitVanish("DebianInstallerDomainPrompt.png", 10) +end + +Given /^I set the root password to "([^"]*)"$/ do |rootpw| +# Root Password, twice + @screen.wait("DebianInstallerRootPassword.png", 30) + @screen.type(rootpw + Sikuli::Key.ENTER) + @screen.waitVanish("DebianInstallerRootPassword.png", 10) + @screen.type(rootpw + Sikuli::Key.ENTER) +end + +Given /^I set the password for "([^"]*)" to be "([^"]*)"$/ do |fullname,password| +# Username, and password twice + @screen.wait("DebianInstallerNameOfUser.png", 10) + @screen.type(fullname + Sikuli::Key.ENTER) + @screen.waitVanish("DebianInstallerNameOfUser.png", 10) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("DebianInstallerUserPassword.png", 10) + @screen.type(password + Sikuli::Key.ENTER) + @screen.waitVanish("DebianInstallerUserPassword.png", 10) + @screen.type(password + Sikuli::Key.ENTER) +end + + #@screen.wait("DebianInstallerNoDiskFound.png", 60) + +Given /^I select full-disk, single-filesystem partitioning$/ do + @screen.wait("DebianInstallerPartitioningMethod.png", 60) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("DebianInstallerSelectDiskToPartition.png", 10) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("DebianInstallerPartitioningScheme.png", 10) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("d-i_FinishPartitioning.png", 10) + sleep(5) # FIXME -- why do we need this? It's weird that the wait is not enough + @screen.type(Sikuli::Key.ENTER) + # prompt about Writing Partitions to disk: + @screen.wait("d-i_No.png", 10) + @screen.type(Sikuli::Key.TAB) + @screen.wait("d-i_Yes.png", 10) + @screen.type(Sikuli::Key.ENTER) +end + +Given /^I note that the Base system is being installed$/ do + @screen.wait("DebianInstallerInstallingBaseSystem.png", 30) + @screen.waitVanish("DebianInstallerInstallingBaseSystem.png", 15 * 60) +end + +Given /^I accept the default mirror$/ do + @screen.wait("DebianInstallerMirrorCountry.png", 10 * 60) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("d-i_ArchiveMirror.png", 5) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("d-i_HttpProxy.png", 5) + @screen.type(Sikuli::Key.ENTER) +end + +Given /^I neglect to scan more CDs$/ do + @screen.wait("d-i_ScanCD.png", 15 * 60) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("d-i_UseNetMirror.png", 10) + @screen.wait("d-i_Yes.png", 10) + @screen.type(Sikuli::Key.TAB) + @screen.wait("d-i_No.png", 10) + @screen.type(Sikuli::Key.ENTER) +end + +Given /^I ignore Popcon$/ do + #@screen.wait("d-i_popcon.png", 10 * 60) + @screen.wait("d-i_No.png", 10 * 60) + @screen.type(Sikuli::Key.ENTER) +end + +Given /^we reach the Tasksel prompt$/ do + @screen.wait("d-i_ChooseSoftware.png", 5 * 60) +end + +Given /^I hit ENTER$/ do + @screen.type(Sikuli::Key.ENTER) +end + +Given /^I select the Desktop task$/ do + @screen.wait("d-i_ChooseSoftware.png", 10) + @screen.type(Sikuli::Key.SPACE) + @screen.type(Sikuli::Key.DOWN) + @screen.type(Sikuli::Key.SPACE) + @screen.wait("d-i_DesktopTask_Yes.png", 10) + @screen.type(Sikuli::Key.ENTER) +end + +Given /^I install GRUB$/ do + #@screen.wait("d-i_InstallGRUB.png", 80 * 60) + @screen.wait("Install the GRUB", 80 * 60) + @screen.type(Sikuli::Key.ENTER) + @screen.wait("d-i_GRUBEnterDev.png", 10 * 60) + @screen.type(Sikuli::Key.DOWN) + @screen.wait("d-i_GRUBdev.png", 10) + @screen.type(Sikuli::Key.ENTER) +end + +Given /^I allow reboot after the install is complete$/ do + @screen.wait("d-i_InstallComplete.png", 2 * 60) + @screen.type(Sikuli::Key.ENTER) +end + +Given /^I wait for the reboot$/ do + @screen.wait(bootsplash, 10 * 60) +end + +Given /^I make sure that we boot from disk$/ do + @screen.wait("d-i_GRUB_Debian.png", 5 * 60) +end + +Given /^I wait for a Login Prompt$/ do + @screen.wait("amnesia", 60) +end def bootsplash case @os_loader when "UEFI" 'TailsBootSplashUEFI.png' else - 'TailsBootSplash.png' + 'd-i8_bootsplash.png' end end @@ -274,15 +416,16 @@ def bootsplash_tab_msg when "UEFI" 'TailsBootSplashTabMsgUEFI.png' else - if reboot - bootsplash = 'TailsBootSplashPostReset.png' - bootsplash_tab_msg = 'TailsBootSplashTabMsgPostReset.png' - boot_timeout = 120 - else - bootsplash = "DebianLive#{version}BootSplash.png" - bootsplash_tab_msg = "DebianLive#{version}BootSplashTabMsg.png" + #if reboot + # bootsplash = 'TailsBootSplashPostReset.png' + # bootsplash_tab_msg = 'TailsBootSplashTabMsgPostReset.png' + # boot_timeout = 120 + #else + #bootsplash = "DebianLive#{version}BootSplash.png" + bootsplash = "DebianLiveBootSplash.png" + bootsplash_tab_msg = "DebianLiveBootSplashTabMsg.png" boot_timeout = 30 - end + #end end end diff --git a/features/step_definitions/snapshots.rb b/features/step_definitions/snapshots.rb index 0e9ae3b2..13e4a5b6 100644 --- a/features/step_definitions/snapshots.rb +++ b/features/step_definitions/snapshots.rb @@ -1,5 +1,51 @@ def checkpoints { + 'boot-d-i-to-tasksel' => { + :description => "I have started Debian Installer and stopped at the Tasksel prompt", + #:parent_checkpoint => 'no-network-logged-in', + :steps => [ + 'I create a 8 GiB disk named "target"', + 'I plug ide drive "target"', + 'I start the computer', + 'the computer boots DebianInstaller', + 'I select British English', + 'I accept the hostname, using "example.com" as the domain', + 'I set the root password to "rootme"', + 'I set the password for "Philip Hands" to be "verysecret"', + 'I select full-disk, single-filesystem partitioning', + 'I note that the Base system is being installed', + 'I accept the default mirror', + 'I ignore Popcon', + 'we reach the Tasksel prompt', + ], + }, + + 'debian-minimal-install' => { + :description => "I have installed Minimal Debian", + :parent_checkpoint => 'boot-d-i-to-tasksel', + :steps => [ + 'I hit ENTER', + 'I install GRUB', + 'I allow reboot after the install is complete', + 'I wait for the reboot', + 'I power off the computer', + 'the computer is set to boot from ide drive "target"', + ], + }, + + 'debian-gnome-install' => { + :description => "I have installed Gnome Desktop Debian", + :parent_checkpoint => 'boot-d-i-to-tasksel', + :steps => [ + 'I select the Desktop task', + 'I install GRUB', + 'I allow reboot after the install is complete', + 'I wait for the reboot', + 'I power off the computer', + 'the computer is set to boot from ide drive "target"', + ], + }, + 'tails-greeter' => { :description => "I have started Tails from DVD without network and stopped at Tails Greeter's login screen", :parent_checkpoint => nil, |