summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2016-07-21 19:20:07 +0000
committerintrigeri <intrigeri@boum.org>2016-07-21 19:20:07 +0000
commita0614eb19bc19542056e154e96abd0025fabe5df (patch)
treee642f0fd69c82b84fd8230b6caaeb5218b0c03e7
parent590ff198613725896f0d5f42b26f43ac8164e1dd (diff)
parent5fc72cb990e69274e9f17b9a37bff4d027ae3516 (diff)
Merge remote-tracking branch 'origin/stable' into bugfix/10720-installer-freezes-on-jenkins
-rw-r--r--features/apt.feature3
-rw-r--r--features/config/defaults.yml2
-rw-r--r--features/images/GitCloneDone.pngbin0 -> 2974 bytes
-rw-r--r--features/images/GnomeCloseTopButton.pngbin0 -> 399 bytes
-rw-r--r--features/images/SSHError.pngbin0 -> 635 bytes
-rw-r--r--features/ssh.feature5
-rw-r--r--features/step_definitions/apt.rb26
-rw-r--r--features/step_definitions/git.rb24
-rw-r--r--features/step_definitions/ssh.rb38
-rw-r--r--features/torified_git.feature20
10 files changed, 83 insertions, 35 deletions
diff --git a/features/apt.feature b/features/apt.feature
index b0ece1f..02a122c 100644
--- a/features/apt.feature
+++ b/features/apt.feature
@@ -11,8 +11,7 @@ Feature: Installing packages through APT
Scenario: APT sources are configured correctly
Then the only hosts in APT sources are "ftp.us.debian.org,security.debian.org,deb.tails.boum.org,deb.torproject.org"
- #10496: apt-get scenarios are fragile
- @check_tor_leaks @fragile
+ @check_tor_leaks
Scenario: Install packages using apt
When I update APT using apt
Then I should be able to install a package using apt
diff --git a/features/config/defaults.yml b/features/config/defaults.yml
index bd2f130..993dfe3 100644
--- a/features/config/defaults.yml
+++ b/features/config/defaults.yml
@@ -33,4 +33,4 @@ Unsafe_SSH_private_key: |
NWema+bArbaF0rKVJpwvpkZWGcr6qRn94Ts0kJAzR+VIVTOjB9sVwdxjadwWHRs5
kKnpY0tnSF7hyVRwN7GOsNDJEaFjCW7k4+55D2ZNBy2iN3beW8CZ
-----END RSA PRIVATE KEY-----
-Unsafe_SSH_public_key: = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8xQ2BRQz+TK6jbqb5fDuKAbrOAYUwVtLe7yblK0awk6fvMuInw/kyaX9H7i105LqjBVThFplM+w1lkr8KViY4+GY28nTilUKGTYNnwABGD9MA2PeqMqzcP4x4puTVu3oSwDnmSAaxNSTLlOLxxzZadrbmOqNqAiLIzzbY8Yb2aYjr/MthHpAtSLM1pyJetEzdDhHixCQSt5WUd6ic8SIZSz3PHSzAKku08zlQhi17U9UeCTB4+xTq8zxSpVMr9XC0suAtqdeewwW7OrsNMBc+rj35dIU2rgmXFsQXr49Bdm9hnk15bTQars1Kk8/y6gevp/Un6YzHGczzmPNi1HH5 amnesia@amnesia"
+Unsafe_SSH_public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8xQ2BRQz+TK6jbqb5fDuKAbrOAYUwVtLe7yblK0awk6fvMuInw/kyaX9H7i105LqjBVThFplM+w1lkr8KViY4+GY28nTilUKGTYNnwABGD9MA2PeqMqzcP4x4puTVu3oSwDnmSAaxNSTLlOLxxzZadrbmOqNqAiLIzzbY8Yb2aYjr/MthHpAtSLM1pyJetEzdDhHixCQSt5WUd6ic8SIZSz3PHSzAKku08zlQhi17U9UeCTB4+xTq8zxSpVMr9XC0suAtqdeewwW7OrsNMBc+rj35dIU2rgmXFsQXr49Bdm9hnk15bTQars1Kk8/y6gevp/Un6YzHGczzmPNi1HH5 amnesia@amnesia"
diff --git a/features/images/GitCloneDone.png b/features/images/GitCloneDone.png
new file mode 100644
index 0000000..f81dd59
--- /dev/null
+++ b/features/images/GitCloneDone.png
Binary files differ
diff --git a/features/images/GnomeCloseTopButton.png b/features/images/GnomeCloseTopButton.png
new file mode 100644
index 0000000..b5a2f7f
--- /dev/null
+++ b/features/images/GnomeCloseTopButton.png
Binary files differ
diff --git a/features/images/SSHError.png b/features/images/SSHError.png
new file mode 100644
index 0000000..b2cec40
--- /dev/null
+++ b/features/images/SSHError.png
Binary files differ
diff --git a/features/ssh.feature b/features/ssh.feature
index 0e64e86..695f1b6 100644
--- a/features/ssh.feature
+++ b/features/ssh.feature
@@ -1,5 +1,4 @@
-#10498: SSH tests are fragile
-@product @fragile
+@product
Feature: Logging in via SSH
As a Tails user
When I connect to SSH servers on the Internet
@@ -12,7 +11,6 @@ Feature: Logging in via SSH
Scenario: Connecting to an SSH server on the Internet
Given I have the SSH key pair for an SSH server
When I connect to an SSH server on the Internet
- And I verify the SSH fingerprint for the SSH server
Then I have sucessfully logged into the SSH server
@check_tor_leaks
@@ -26,5 +24,4 @@ Feature: Logging in via SSH
Scenario: Connecting to an SFTP server on the Internet using the GNOME "Connect to Server" feature
Given I have the SSH key pair for an SFTP server
When I connect to an SFTP server on the Internet
- And I verify the SSH fingerprint for the SFTP server
Then I successfully connect to the SFTP server
diff --git a/features/step_definitions/apt.rb b/features/step_definitions/apt.rb
index 8756803..f96795a 100644
--- a/features/step_definitions/apt.rb
+++ b/features/step_definitions/apt.rb
@@ -12,18 +12,30 @@ Given /^the only hosts in APT sources are "([^"]*)"$/ do |hosts_str|
end
When /^I update APT using apt$/ do
- Timeout::timeout(30*60) do
- $vm.execute_successfully("echo #{@sudo_password} | " +
- "sudo -S apt update", :user => LIVE_USER)
+ recovery_proc = Proc.new do
+ step 'I kill the process "apt"'
+ $vm.execute('rm -rf /var/lib/apt/lists/*')
+ end
+ retry_tor(recovery_proc) do
+ Timeout::timeout(15*60) do
+ $vm.execute_successfully("echo #{@sudo_password} | " +
+ "sudo -S apt update", :user => LIVE_USER)
+ end
end
end
Then /^I should be able to install a package using apt$/ do
package = "cowsay"
- Timeout::timeout(120) do
- $vm.execute_successfully("echo #{@sudo_password} | " +
- "sudo -S apt install #{package}",
- :user => LIVE_USER)
+ recovery_proc = Proc.new do
+ step 'I kill the process "apt"'
+ $vm.execute("apt purge #{package}")
+ end
+ retry_tor(recovery_proc) do
+ Timeout::timeout(2*60) do
+ $vm.execute_successfully("echo #{@sudo_password} | " +
+ "sudo -S apt install #{package}",
+ :user => LIVE_USER)
+ end
end
step "package \"#{package}\" is installed"
end
diff --git a/features/step_definitions/git.rb b/features/step_definitions/git.rb
index bf6f869..579c5c7 100644
--- a/features/step_definitions/git.rb
+++ b/features/step_definitions/git.rb
@@ -1,3 +1,27 @@
+When /^I clone the Git repository "([\S]+)" in GNOME Terminal$/ do |repo|
+ repo_directory = /[\S]+\/([\S]+)(\.git)?$/.match(repo)[1]
+ assert(!$vm.directory_exist?("/home/#{LIVE_USER}/#{repo_directory}"))
+
+ recovery_proc = Proc.new do
+ $vm.execute("rm -rf /home/#{LIVE_USER}/#{repo_directory}",
+ :user => LIVE_USER)
+ step 'I kill the process "git"'
+ @screen.type('clear' + Sikuli::Key.ENTER)
+ end
+
+ retry_tor(recovery_proc) do
+ step "I run \"git clone #{repo}\" in GNOME Terminal"
+ m = /^(https?|git):\/\//.match(repo)
+ unless m
+ step 'I verify the SSH fingerprint for the Git repository'
+ end
+ try_for(180, :msg => 'Git process took too long') {
+ !$vm.has_process?('/usr/bin/git')
+ }
+ @screen.wait('GitCloneDone.png', 10)
+ end
+end
+
Then /^the Git repository "([\S]+)" has been cloned successfully$/ do |repo|
assert($vm.directory_exist?("/home/#{LIVE_USER}/#{repo}/.git"))
assert($vm.file_exist?("/home/#{LIVE_USER}/#{repo}/.git/config"))
diff --git a/features/step_definitions/ssh.rb b/features/step_definitions/ssh.rb
index 64c6841..e998101 100644
--- a/features/step_definitions/ssh.rb
+++ b/features/step_definitions/ssh.rb
@@ -60,6 +60,7 @@ end
Given /^I (?:am prompted to )?verify the SSH fingerprint for the (?:Git|SSH) (?:repository|server)$/ do
@screen.wait("SSHFingerprint.png", 60)
+ sleep 1 # brief pause to ensure that the following keystrokes do not get lost
@screen.type('yes' + Sikuli::Key.ENTER)
end
@@ -95,8 +96,17 @@ When /^I connect to an SSH server on the (Internet|LAN)$/ do |location|
cmd = "ssh #{@ssh_username}@#{@ssh_host} #{ssh_port_suffix}"
step 'process "ssh" is not running'
- step "I run \"#{cmd}\" in GNOME Terminal"
- step 'process "ssh" is running within 10 seconds'
+
+ recovery_proc = Proc.new do
+ step 'I kill the process "ssh"' if $vm.has_process?("ssh")
+ step 'I run "clear" in GNOME Terminal'
+ end
+
+ retry_tor(recovery_proc) do
+ step "I run \"#{cmd}\" in GNOME Terminal"
+ step 'process "ssh" is running within 10 seconds'
+ step 'I verify the SSH fingerprint for the SSH server'
+ end
end
Then /^I have sucessfully logged into the SSH server$/ do
@@ -105,17 +115,29 @@ end
Then /^I connect to an SFTP server on the Internet$/ do
read_and_validate_ssh_config "SFTP"
+
@sftp_port ||= 22
@sftp_port = @sftp_port.to_s
- step 'I start "Files" via the GNOME "Accessories" applications menu'
- @screen.wait_and_click("GnomeFilesConnectToServer.png", 10)
- @screen.wait("GnomeConnectToServerWindow.png", 10)
- @screen.type("sftp://" + @sftp_username + "@" + @sftp_host + ":" + @sftp_port)
- @screen.wait_and_click("GnomeConnectToServerConnectButton.png", 10)
+
+ recovery_proc = Proc.new do
+ step 'I kill the process "ssh"'
+ @screen.type(Sikuli::Key.ESC)
+ @screen.click("GnomeCloseTopButton.png")
+ @screen.waitVanish("GnomeCloseTopButton.png", 10)
+ end
+
+ retry_tor(recovery_proc) do
+ step 'I start "Files" via the GNOME "Accessories" applications menu'
+ @screen.wait_and_click("GnomeFilesConnectToServer.png", 10)
+ @screen.wait("GnomeConnectToServerWindow.png", 10)
+ @screen.type("sftp://" + @sftp_username + "@" + @sftp_host + ":" + @sftp_port)
+ @screen.wait_and_click("GnomeConnectToServerConnectButton.png", 10)
+ step "I verify the SSH fingerprint for the SFTP server"
+ end
end
Then /^I verify the SSH fingerprint for the SFTP server$/ do
- @screen.wait_and_click("GnomeSSHVerificationConfirm.png", 60)
+ @screen.wait_and_click("GnomeSSHVerificationConfirm.png", 2*60)
end
Then /^I successfully connect to the SFTP server$/ do
diff --git a/features/torified_git.feature b/features/torified_git.feature
index 64f93a6..cbb3963 100644
--- a/features/torified_git.feature
+++ b/features/torified_git.feature
@@ -1,4 +1,4 @@
-@product @check_tor_leaks @fragile
+@product @check_tor_leaks
Feature: Cloning a Git repository
As a Tails user
when I clone a Git repository
@@ -7,23 +7,17 @@ Feature: Cloning a Git repository
Background:
Given I have started Tails from DVD and logged in and the network is connected
+ #11563
@fragile
Scenario: Cloning a Git repository anonymously over HTTPS
- When I run "git clone https://git-tails.immerda.ch/myprivatekeyispublic/testing" in GNOME Terminal
- Then process "git" is running within 10 seconds
- And process "git" has stopped running after at most 180 seconds
- And the Git repository "testing" has been cloned successfully
+ When I clone the Git repository "https://git-tails.immerda.ch/myprivatekeyispublic/testing" in GNOME Terminal
+ Then the Git repository "testing" has been cloned successfully
Scenario: Cloning a Git repository anonymously over the Git protocol
- When I run "git clone git://git.tails.boum.org/myprivatekeyispublic/testing" in GNOME Terminal
- Then process "git" is running within 10 seconds
- And process "git" has stopped running after at most 180 seconds
- And the Git repository "testing" has been cloned successfully
+ When I clone the Git repository "git://git.tails.boum.org/myprivatekeyispublic/testing" in GNOME Terminal
+ Then the Git repository "testing" has been cloned successfully
Scenario: Cloning git repository over SSH
Given I have the SSH key pair for a Git repository
- When I run "git clone tails@git.tails.boum.org:myprivatekeyispublic/testing" in GNOME Terminal
- Then process "git" is running within 10 seconds
- When I verify the SSH fingerprint for the Git repository
- And process "git" has stopped running after at most 180 seconds
+ When I clone the Git repository "tails@git.tails.boum.org:myprivatekeyispublic/testing" in GNOME Terminal
Then the Git repository "testing" has been cloned successfully