diff options
45 files changed, 296 insertions, 67 deletions
diff --git a/README-sikuli-cucumber b/README-sikuli-cucumber new file mode 100644 index 00000000..24d90aaf --- /dev/null +++ b/README-sikuli-cucumber @@ -0,0 +1,13 @@ +Key names: + + http://doc.sikuli.org/keys.html + +Running the thing by hand: + + ./bin/lvc/run_test_suite --view --iso /var/lib/libvirt/images/debian-8.3.0-amd64-i386-netinst.iso --old-iso /var/lib/libvirt/images/debian-8.3.0-amd64-i386-netinst.iso DebianLive/apt.feature + +FIXME - I added a git repo to: + + /var/lib/jenkins/workspace/lvc_debian-installer_jessie_standard_apt + +in order to shut-up Tail's script that looks for git repos to populate some variables -- need to strip that out, or make it overridable. diff --git a/bin/lvc/run_test_suite b/bin/lvc/run_test_suite index 154a4a6c..5b40c389 100755 --- a/bin/lvc/run_test_suite +++ b/bin/lvc/run_test_suite @@ -264,20 +264,13 @@ fi export SIKULI_HOME="/usr/share/java" export SIKULI_IMAGE_PATH="/srv/jenkins/features/images/" export RUBYLIB="/srv/jenkins" -export FEATURE_PATH="/srv/jenkins/features" export VM_XML_PATH="/srv/jenkins/features/domains" export DISPLAY=${TARGET_DISPLAY} -CUCUMBEROPTS="--verbose --backtrace --expand" check_dependencies cucumber -set -x +# cludge ruby to stop buffering output +RUBY_STDOUT_SYNC=$TMPDIR/.stdout-sync.rb +echo STDOUT.sync = true > $RUBY_STDOUT_SYNC +export RUBYOPT="-r $RUBY_STDOUT_SYNC" -if [ -z "${*}" ]; then - cucumber $CUCUMBEROPTS --format ExtraHooks::Pretty $FEATURE_PATH -else - FEATURES="" - for f in ${*} ; do - FEATURES="$FEATURES $FEATURE_PATH/$f" - done - cucumber $CUCUMBEROPTS --format ExtraHooks::Pretty $FEATURE_PATH/step_definitions $FEATURE_PATH/support $FEATURES -fi +cucumber ${@} 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) diff --git a/job-cfg/lvc.yaml b/job-cfg/lvc.yaml index b5b16f64..ba1fa278 100644 --- a/job-cfg/lvc.yaml +++ b/job-cfg/lvc.yaml @@ -31,7 +31,7 @@ - email: recipients: 'qa-jenkins-scm@lists.alioth.debian.org' - archive: - artifacts: '*.webm, {my_pngs}' + artifacts: 'run-*/*.mkv, {my_pngs}' latest-only: false - image-gallery: - title: '{my_title}' @@ -40,7 +40,7 @@ wrappers: - live-screenshot builders: - - shell: 'rm $WORKSPACE/*.png -f >/dev/null; /srv/jenkins/bin/lvc/run_test_suite {my_params}' + - shell: 'rm $WORKSPACE/*.png $WORKSPACE/*.mvk -f >/dev/null; /srv/jenkins/bin/lvc/run_test_suite {my_params}' triggers: - timed: '{my_time}' @@ -48,13 +48,17 @@ defaults: lvc name: '{name}_debian-live_{distro}_{flavour}_apt' +- job-template: + defaults: lvc + name: '{name}_debian-installer_{distro}_{flavour}_apt' + - project: name: lvc my_title: '{dist_name} {flav_name}' my_time: '23 45 31 12 *' - my_pngs: 'apt-*.png' + my_pngs: 'run-*/*.png' my_description: 'Work in progress...' - my_params: '--capture lvc_debian-live_{distro}_{flavour}_apt.webm --tmpdir $WORKSPACE --iso /srv/live-build/results/{distro}_{flavour}_live_amd64.iso DebianLive/apt.feature' + my_params: '--capture lvc_debian-live_{distro}_{flavour}_apt.webm --tmpdir $WORKSPACE --iso /srv/live-build/results/{distro}_{flavour}_live_amd64.iso -- --verbose --backtrace --expand --format pretty DebianLive/apt.feature' jobs: - '{name}_debian-live_{distro}_{flavour}_apt': distro: @@ -79,10 +83,9 @@ - 'xfce': {flav_name: 'Xfce Desktop'} my_iso: '/srv/live-build/results/{distro}_{flavour}_live_amd64.iso' - - '{name}_debian-live_{distro}_{flavour}_apt': + - '{name}_debian-installer_{distro}_{flavour}_apt': distro: - - 'wheezy': {dist_name: 'Debian Live 7'} + - 'jessie': {dist_name: 'Debian-Installer 8'} flavour: - - 'gnome-desktop': {flav_name: 'GNOME desktop'} - 'standard': {flav_name: 'standard'} - my_params: '--capture lvc_debian-live_{distro}_{flavour}_apt.webm --tmpdir $WORKSPACE --iso /var/lib/jenkins/debian-live-7.7.0-amd64-{flavour}.iso DebianLive/apt.feature' + my_params: '--capture --iso /srv/live-build/results/debian-8.3.0-amd64-netinst.iso --tmpdir $WORKSPACE --old-iso /srv/live-build/results/debian-8.3.0-amd64-netinst.iso -- --format pretty --format pretty_debug --out $WORKSPACE/pretty_debug.log /srv/jenkins/features/step_definitions /srv/jenkins/features/support /srv/jenkins/features/DebianLive/apt.feature' diff --git a/update_jdn.sh b/update_jdn.sh index 130524bf..ecb2d190 100755 --- a/update_jdn.sh +++ b/update_jdn.sh @@ -57,11 +57,17 @@ if ! getent passwd jenkins-adm > /dev/null ; then sudo adduser --system --shell /bin/bash --no-create-home --ingroup jenkins-adm --disabled-login --no-create-home jenkins-adm sudo usermod -G jenkins jenkins-adm fi -for user in helmut holger mattia lunar philh ; do +for user in helmut holger mattia lunar philh phil ; do if [ "$user" = "lunar" ] && [ "$HOSTNAME" != "jenkins" ] ; then # lunar only wants to configure jekyll continue fi + if [ "$user" = "phil" ] && [ "$HOSTNAME" != "jenkins-test-vm" ] ; then + # phil only wants to test stuff + sudo adduser $user libvirt + sudo adduser $user libvirt-qemu + continue + fi if [ "$user" = "philh" ] && [ "$HOSTNAME" != "jenkins-test-vm" ] ; then # philh only wants to test stuff continue @@ -196,10 +202,32 @@ if [ -f /etc/debian_version ] ; then " case $HOSTNAME in jenkins|jenkins-test-vm|profitbricks-build?-amd64) DEBS="$DEBS + cucumber + tesseract-ocr + i18nspector + libav-tools + libsikuli-script-java + libvirt-dev + ovmf + python-jabberbot + python-potr + ruby-guestfs + ruby-libvirt + ruby-net-irc + ruby-packetfu + ruby-rb-inotify + ruby-rjb + ruby-test-unit + tcpdump + unclutter + virt-viewer + xvfb + x11vnc libvirt-bin python3-yaml postfix-pcre squid3" + # make sure that nested KVM is enabled (see whist:/etc/modprobe.d/kvm-intel-nested.conf) ;; *) ;; esac |