diff options
Diffstat (limited to 'features')
41 files changed, 238 insertions, 46 deletions
diff --git a/features/DebianLive/apt.feature b/features/DebianLive/apt.feature index 80f0cddb..3b71b6c2 100644 --- a/features/DebianLive/apt.feature +++ b/features/DebianLive/apt.feature @@ -1,19 +1,14 @@ @product -Feature: Installing packages through APT - As a Tails user - I should be able to install packages using APT +Feature: Doing a trivial d-i install + As a normal user + I should be able to do a text-mode install - Background: - Given a computer - And I capture all network traffic + Scenario Outline: Install Debian and boot to login prompt + Given I have installed <type> Debian And I start the computer - And the computer boots DebianLive - And I save the state so the background can be restored next scenario - - Scenario: APT sources are configured correctly - Then the only hosts in APT sources are "ftp.us.debian.org,http.debian.net,ftp.debian.org,security.debian.org" - - Scenario: Install packages using apt-get - When I update APT using apt-get - Then I should be able to install a package using apt-get + Then I wait for a Login Prompt + Examples: + | type | + | Minimal | + | Gnome Desktop | diff --git a/features/images/DebianInstallerCountrySelection.png b/features/images/DebianInstallerCountrySelection.png Binary files differnew file mode 100644 index 00000000..fe130993 --- /dev/null +++ b/features/images/DebianInstallerCountrySelection.png diff --git a/features/images/DebianInstallerDomainPrompt.png b/features/images/DebianInstallerDomainPrompt.png Binary files differnew file mode 100644 index 00000000..d7fca5f8 --- /dev/null +++ b/features/images/DebianInstallerDomainPrompt.png diff --git a/features/images/DebianInstallerHostnamePrompt.png b/features/images/DebianInstallerHostnamePrompt.png Binary files differnew file mode 100644 index 00000000..f1325c8d --- /dev/null +++ b/features/images/DebianInstallerHostnamePrompt.png diff --git a/features/images/DebianInstallerHttpProxy.png b/features/images/DebianInstallerHttpProxy.png Binary files differnew file mode 100644 index 00000000..04b3e13e --- /dev/null +++ b/features/images/DebianInstallerHttpProxy.png diff --git a/features/images/DebianInstallerInstallingBaseSystem.png b/features/images/DebianInstallerInstallingBaseSystem.png Binary files differnew file mode 100644 index 00000000..0b9e1c7f --- /dev/null +++ b/features/images/DebianInstallerInstallingBaseSystem.png diff --git a/features/images/DebianInstallerMirrorCountry.png b/features/images/DebianInstallerMirrorCountry.png Binary files differnew file mode 100644 index 00000000..9b4df5ea --- /dev/null +++ b/features/images/DebianInstallerMirrorCountry.png diff --git a/features/images/DebianInstallerNameOfUser.png b/features/images/DebianInstallerNameOfUser.png Binary files differnew file mode 100644 index 00000000..e37c7ec4 --- /dev/null +++ b/features/images/DebianInstallerNameOfUser.png diff --git a/features/images/DebianInstallerNoDiskFound.png b/features/images/DebianInstallerNoDiskFound.png Binary files differnew file mode 100644 index 00000000..671f52d6 --- /dev/null +++ b/features/images/DebianInstallerNoDiskFound.png diff --git a/features/images/DebianInstallerPartitioningMethod.png b/features/images/DebianInstallerPartitioningMethod.png Binary files differnew file mode 100644 index 00000000..9e44360e --- /dev/null +++ b/features/images/DebianInstallerPartitioningMethod.png diff --git a/features/images/DebianInstallerPartitioningScheme.png b/features/images/DebianInstallerPartitioningScheme.png Binary files differnew file mode 100644 index 00000000..97105b62 --- /dev/null +++ b/features/images/DebianInstallerPartitioningScheme.png diff --git a/features/images/DebianInstallerRootPassword.png b/features/images/DebianInstallerRootPassword.png Binary files differnew file mode 100644 index 00000000..27368fd7 --- /dev/null +++ b/features/images/DebianInstallerRootPassword.png diff --git a/features/images/DebianInstallerSelectDiskToPartition.png b/features/images/DebianInstallerSelectDiskToPartition.png Binary files differnew file mode 100644 index 00000000..1f14bb1a --- /dev/null +++ b/features/images/DebianInstallerSelectDiskToPartition.png diff --git a/features/images/DebianInstallerSelectLangEnglish.png b/features/images/DebianInstallerSelectLangEnglish.png Binary files differnew file mode 100644 index 00000000..85f848d5 --- /dev/null +++ b/features/images/DebianInstallerSelectLangEnglish.png diff --git a/features/images/DebianInstallerSelectLangEnglishUK.png b/features/images/DebianInstallerSelectLangEnglishUK.png Binary files differnew file mode 100644 index 00000000..c0da761f --- /dev/null +++ b/features/images/DebianInstallerSelectLangEnglishUK.png diff --git a/features/images/DebianInstallerUserPassword.png b/features/images/DebianInstallerUserPassword.png Binary files differnew file mode 100644 index 00000000..bf9964aa --- /dev/null +++ b/features/images/DebianInstallerUserPassword.png diff --git a/features/images/DebianLoginPromptVT.png b/features/images/DebianLoginPromptVT.png Binary files differnew file mode 100644 index 00000000..ec267820 --- /dev/null +++ b/features/images/DebianLoginPromptVT.png diff --git a/features/images/d-i8_bootsplash.png b/features/images/d-i8_bootsplash.png Binary files differnew file mode 100644 index 00000000..086c65cb --- /dev/null +++ b/features/images/d-i8_bootsplash.png diff --git a/features/images/d-i_ArchiveMirror.png b/features/images/d-i_ArchiveMirror.png Binary files differnew file mode 100644 index 00000000..7e53f189 --- /dev/null +++ b/features/images/d-i_ArchiveMirror.png diff --git a/features/images/d-i_ChooseSoftware.png b/features/images/d-i_ChooseSoftware.png Binary files differnew file mode 100644 index 00000000..93447158 --- /dev/null +++ b/features/images/d-i_ChooseSoftware.png diff --git a/features/images/d-i_DesktopTask_No.png b/features/images/d-i_DesktopTask_No.png Binary files differnew file mode 100644 index 00000000..6dbf9df4 --- /dev/null +++ b/features/images/d-i_DesktopTask_No.png diff --git a/features/images/d-i_DesktopTask_Yes.png b/features/images/d-i_DesktopTask_Yes.png Binary files differnew file mode 100644 index 00000000..02cbaa5d --- /dev/null +++ b/features/images/d-i_DesktopTask_Yes.png diff --git a/features/images/d-i_F12BootMenu.png b/features/images/d-i_F12BootMenu.png Binary files differnew file mode 100644 index 00000000..67a21856 --- /dev/null +++ b/features/images/d-i_F12BootMenu.png diff --git a/features/images/d-i_FinishPartitioning.png b/features/images/d-i_FinishPartitioning.png Binary files differnew file mode 100644 index 00000000..50396500 --- /dev/null +++ b/features/images/d-i_FinishPartitioning.png diff --git a/features/images/d-i_GRUBEnterDev.png b/features/images/d-i_GRUBEnterDev.png Binary files differnew file mode 100644 index 00000000..6df484ed --- /dev/null +++ b/features/images/d-i_GRUBEnterDev.png diff --git a/features/images/d-i_GRUB_Debian.png b/features/images/d-i_GRUB_Debian.png Binary files differnew file mode 100644 index 00000000..3b67cfbe --- /dev/null +++ b/features/images/d-i_GRUB_Debian.png diff --git a/features/images/d-i_GRUBdev.png b/features/images/d-i_GRUBdev.png Binary files differnew file mode 100644 index 00000000..9d554d74 --- /dev/null +++ b/features/images/d-i_GRUBdev.png diff --git a/features/images/d-i_HttpProxy.png b/features/images/d-i_HttpProxy.png Binary files differnew file mode 100644 index 00000000..4163a5b3 --- /dev/null +++ b/features/images/d-i_HttpProxy.png diff --git a/features/images/d-i_InstallComplete.png b/features/images/d-i_InstallComplete.png Binary files differnew file mode 100644 index 00000000..a8564464 --- /dev/null +++ b/features/images/d-i_InstallComplete.png diff --git a/features/images/d-i_InstallGRUB.png b/features/images/d-i_InstallGRUB.png Binary files differnew file mode 100644 index 00000000..e491fbd1 --- /dev/null +++ b/features/images/d-i_InstallGRUB.png diff --git a/features/images/d-i_No.png b/features/images/d-i_No.png Binary files differnew file mode 100644 index 00000000..1108addc --- /dev/null +++ b/features/images/d-i_No.png diff --git a/features/images/d-i_ScanCD.png b/features/images/d-i_ScanCD.png Binary files differnew file mode 100644 index 00000000..5790bcce --- /dev/null +++ b/features/images/d-i_ScanCD.png diff --git a/features/images/d-i_SelectBootDev.png b/features/images/d-i_SelectBootDev.png Binary files differnew file mode 100644 index 00000000..7abef3ec --- /dev/null +++ b/features/images/d-i_SelectBootDev.png diff --git a/features/images/d-i_UseNetMirror.png b/features/images/d-i_UseNetMirror.png Binary files differnew file mode 100644 index 00000000..2b41228b --- /dev/null +++ b/features/images/d-i_UseNetMirror.png diff --git a/features/images/d-i_Yes.png b/features/images/d-i_Yes.png Binary files differnew file mode 100644 index 00000000..17fab5b9 --- /dev/null +++ b/features/images/d-i_Yes.png diff --git a/features/images/d-i_popcon.png b/features/images/d-i_popcon.png Binary files differnew file mode 100644 index 00000000..ed0ba618 --- /dev/null +++ b/features/images/d-i_popcon.png 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, diff --git a/features/support/config.rb b/features/support/config.rb index 9db15929..607969ab 100644 --- a/features/support/config.rb +++ b/features/support/config.rb @@ -54,9 +54,9 @@ DEBUG_LOG_PSEUDO_FIFO = "#{$config["TMPDIR"]}/debug_log_pseudo_fifo" DISPLAY = ENV['DISPLAY'] GIT_DIR = ENV['PWD'] KEEP_SNAPSHOTS = !ENV['KEEP_SNAPSHOTS'].nil? -LIVE_USER = cmd_helper(". config/chroot_local-includes/etc/live/config.d/username.conf; echo ${LIVE_USERNAME}").chomp -TAILS_ISO = ENV['TAILS_ISO'] -OLD_TAILS_ISO = ENV['OLD_TAILS_ISO'] || TAILS_ISO +LIVE_USER = "live_user" +TAILS_ISO = ENV['ISO'] +OLD_TAILS_ISO = ENV['OLD_ISO'] || TAILS_ISO TIME_AT_START = Time.now loop do ARTIFACTS_DIR = $config['TMPDIR'] + "/run-" + @@ -76,9 +76,9 @@ end # Constants that are statically initialized. CONFIGURED_KEYSERVER_HOSTNAME = 'hkps.pool.sks-keyservers.net' -LIBVIRT_DOMAIN_NAME = "TailsToaster" +LIBVIRT_DOMAIN_NAME = "DebianToaster" LIBVIRT_DOMAIN_UUID = "203552d5-819c-41f3-800e-2c8ef2545404" -LIBVIRT_NETWORK_NAME = "TailsToasterNet" +LIBVIRT_NETWORK_NAME = "DebianToasterNet" LIBVIRT_NETWORK_UUID = "f2305af3-2a64-4f16-afe6-b9dbf02a597e" MISC_FILES_DIR = "#{Dir.pwd}/features/misc_files" SERVICES_EXPECTED_ON_ALL_IFACES = @@ -104,5 +104,5 @@ TOR_AUTHORITIES = ] VM_XML_PATH = "#{Dir.pwd}/features/domains" -TAILS_SIGNING_KEY = cmd_helper(". #{Dir.pwd}/config/amnesia; echo ${AMNESIA_DEV_KEYID}").tr(' ', '').chomp +#TAILS_SIGNING_KEY = cmd_helper(". #{Dir.pwd}/config/amnesia; echo ${AMNESIA_DEV_KEYID}").tr(' ', '').chomp TAILS_DEBIAN_REPO_KEY = "221F9A3C6FA3E09E182E060BC7988EA7A358D82E" diff --git a/features/support/helpers/exec_helper.rb b/features/support/helpers/exec_helper.rb index 42f6532a..14e12269 100644 --- a/features/support/helpers/exec_helper.rb +++ b/features/support/helpers/exec_helper.rb @@ -1,5 +1,6 @@ require 'json' require 'socket' +require 'io/wait' class VMCommand @@ -12,8 +13,9 @@ class VMCommand def VMCommand.wait_until_remote_shell_is_up(vm, timeout = 90) try_for(timeout, :msg => "Remote shell seems to be down") do - Timeout::timeout(3) do - VMCommand.execute(vm, "echo 'hello?'") + sleep(20) + Timeout::timeout(10) do + VMCommand.execute(vm, "echo 'true'") end end end @@ -34,20 +36,26 @@ class VMCommand socket = TCPSocket.new("127.0.0.1", vm.get_remote_shell_port) debug_log("#{type}ing as #{options[:user]}: #{cmd}") begin - socket.puts(JSON.dump([type, options[:user], cmd])) - s = socket.readline(sep = "\0").chomp("\0") + #socket.puts(JSON.dump([type, options[:user], cmd])) + socket.puts( "\n") + sleep(1) + socket.puts( "\003") + sleep(1) + socket.puts( cmd + "\n") + sleep(1) + while socket.ready? + s = socket.readline(sep = "\n").chomp("\n") + debug_log("#{type} read: #{s}") if not(options[:spawn]) + if ('true' == s) then + break + end + end ensure socket.close end - debug_log("#{type} returned: #{s}") if not(options[:spawn]) - begin - return JSON.load(s) - rescue JSON::ParserError - # The server often returns something unparsable for the very - # first execute() command issued after a VM start/restore - # (generally from wait_until_remote_shell_is_up()) presumably - # because the TCP -> serial link isn't properly setup yet. All - # will be well after that initial hickup, so we just retry. + if ('true' == s) + return true + else return VMCommand.execute(vm, cmd, options) end end diff --git a/features/support/hooks.rb b/features/support/hooks.rb index be8a0235..b3bdecef 100644 --- a/features/support/hooks.rb +++ b/features/support/hooks.rb @@ -129,7 +129,7 @@ end BeforeFeature('@product') do |feature| if TAILS_ISO.nil? - raise "No Tails ISO image specified, and none could be found in the " + + raise "No ISO image specified, and none could be found in the " + "current directory" end if File.exist?(TAILS_ISO) |