summaryrefslogtreecommitdiffstats
path: root/features
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2016-12-10 18:45:22 +0100
committeranonym <anonym@riseup.net>2016-12-10 18:45:22 +0100
commitdc854303bff703a82b2b55b10014890cca97b2f3 (patch)
tree0e31212c872fb87f81681fed4ea2b7ce2adacf11 /features
parent84dfae45da165d288686239022e725670b045cda (diff)
parent312873ea8e1f49b4fda05650fcf713b2cc6bc392 (diff)
Merge remote-tracking branch 'origin/stable' into test/11901-mat-does-not-clean-PDF-anymore
Diffstat (limited to 'features')
-rw-r--r--features/config/defaults.yml2
-rw-r--r--features/emergency_shutdown.feature4
-rw-r--r--features/images/CupsTestPage.pngbin2859 -> 1908 bytes
-rw-r--r--features/images/SupportDocumentation.pngbin2099 -> 0 bytes
-rw-r--r--features/images/SupportDocumentationGerman.pngbin2629 -> 0 bytes
-rw-r--r--features/images/TorBrowserSaveOutputFileSelected.pngbin1647 -> 1718 bytes
-rw-r--r--features/images/TorBrowserSavedStartupPage.pngbin1700 -> 1250 bytes
-rw-r--r--features/step_definitions/browser.rb11
-rw-r--r--features/step_definitions/checks.rb15
-rw-r--r--features/step_definitions/common_steps.rb12
-rw-r--r--features/step_definitions/erase_memory.rb4
-rw-r--r--features/step_definitions/icedove.rb2
-rw-r--r--features/step_definitions/torified_misc.rb16
-rw-r--r--features/support/helpers/misc_helpers.rb16
-rw-r--r--features/support/helpers/sikuli_helper.rb33
-rw-r--r--features/support/hooks.rb2
-rw-r--r--features/torified_misc.feature2
17 files changed, 94 insertions, 25 deletions
diff --git a/features/config/defaults.yml b/features/config/defaults.yml
index 993dfe3..1e7f8ea 100644
--- a/features/config/defaults.yml
+++ b/features/config/defaults.yml
@@ -1,7 +1,7 @@
CAPTURE: false
CAPTURE_ALL: false
+INTERACTIVE_DEBUGGING: false
MAX_NEW_TOR_CIRCUIT_RETRIES: 10
-PAUSE_ON_FAIL: false
SIKULI_RETRY_FINDFAILED: false
TMPDIR: "/tmp/TailsToaster"
diff --git a/features/emergency_shutdown.feature b/features/emergency_shutdown.feature
index 144e6c6..3fac61e 100644
--- a/features/emergency_shutdown.feature
+++ b/features/emergency_shutdown.feature
@@ -1,15 +1,11 @@
@product
Feature: Emergency shutdown
- #11616
- @fragile
Scenario: The emergency shutdown applet can shutdown Tails
Given I have started Tails from DVD without network and logged in
When I request a shutdown using the emergency shutdown applet
Then Tails eventually shuts down
- #11616
- @fragile
Scenario: The emergency shutdown applet can reboot Tails
Given I have started Tails from DVD without network and logged in
When I request a reboot using the emergency shutdown applet
diff --git a/features/images/CupsTestPage.png b/features/images/CupsTestPage.png
index 65b3cac..916486e 100644
--- a/features/images/CupsTestPage.png
+++ b/features/images/CupsTestPage.png
Binary files differ
diff --git a/features/images/SupportDocumentation.png b/features/images/SupportDocumentation.png
deleted file mode 100644
index bccfb80..0000000
--- a/features/images/SupportDocumentation.png
+++ /dev/null
Binary files differ
diff --git a/features/images/SupportDocumentationGerman.png b/features/images/SupportDocumentationGerman.png
deleted file mode 100644
index 24c7708..0000000
--- a/features/images/SupportDocumentationGerman.png
+++ /dev/null
Binary files differ
diff --git a/features/images/TorBrowserSaveOutputFileSelected.png b/features/images/TorBrowserSaveOutputFileSelected.png
index 8de38a9..cda7a09 100644
--- a/features/images/TorBrowserSaveOutputFileSelected.png
+++ b/features/images/TorBrowserSaveOutputFileSelected.png
Binary files differ
diff --git a/features/images/TorBrowserSavedStartupPage.png b/features/images/TorBrowserSavedStartupPage.png
index f32a0f9..0d43813 100644
--- a/features/images/TorBrowserSavedStartupPage.png
+++ b/features/images/TorBrowserSavedStartupPage.png
Binary files differ
diff --git a/features/step_definitions/browser.rb b/features/step_definitions/browser.rb
index 896906b..fac23b7 100644
--- a/features/step_definitions/browser.rb
+++ b/features/step_definitions/browser.rb
@@ -116,14 +116,21 @@ end
# This step is limited to the Tor Browser due to #7502 since dogtail
# uses the same interface.
Then /^"([^"]+)" has loaded in the Tor Browser$/ do |title|
- expected_title = "#{title} - Tor Browser"
+ if @language == 'German'
+ browser_name = 'Tor-Browser'
+ reload_action = 'Aktuelle Seite neu laden'
+ else
+ browser_name = 'Tor Browser'
+ reload_action = 'Reload current page'
+ end
+ expected_title = "#{title} - #{browser_name}"
app = Dogtail::Application.new('Firefox')
app.child(expected_title, roleName: 'frame').wait(60)
# The 'Reload current page' button (graphically shown as a looping
# arrow) is only shown when a page has loaded, so once we see the
# expected title *and* this button has appeared, then we can be sure
# that the page has fully loaded.
- app.child('Reload current page', roleName: 'push button').wait(60)
+ app.child(reload_action, roleName: 'push button').wait(60)
end
Then /^the (.*) has no plugins installed$/ do |browser|
diff --git a/features/step_definitions/checks.rb b/features/step_definitions/checks.rb
index 06824b3..507a61b 100644
--- a/features/step_definitions/checks.rb
+++ b/features/step_definitions/checks.rb
@@ -140,7 +140,20 @@ Given /^I setup a filesystem share containing a sample PDF$/ do
end
Then /^the support documentation page opens in Tor Browser$/ do
- @screen.wait("SupportDocumentation#{@language}.png", 120)
+ if @language == 'German'
+ expected_title = 'Tails - Hilfe & Support'
+ expected_heading = 'Die Dokumentation durchsuchen'
+ else
+ expected_title = 'Tails - Support'
+ expected_heading = 'Search the documentation'
+ end
+ step "\"#{expected_title}\" has loaded in the Tor Browser"
+ headings = Dogtail::Application.new('Firefox')
+ .child(expected_title, roleName: 'document frame')
+ .children(roleName: 'heading')
+ assert(
+ headings.any? { |heading| heading.text == expected_heading }
+ )
end
Then /^MAT can clean some sample PDF file$/ do
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index 798aee6..722710d 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -5,7 +5,7 @@ def post_vm_start_hook
# focus to virt-viewer or similar) so we do that now rather than
# having an important click lost. The point we click should be
# somewhere where no clickable elements generally reside.
- @screen.click_point(@screen.w, @screen.h/2)
+ @screen.click_point(@screen.w - 1, @screen.h/2)
end
def activate_filesystem_shares
@@ -462,7 +462,7 @@ end
Given /^the Tor Browser (?:has started and )?load(?:ed|s) the (startup page|Tails roadmap)$/ do |page|
case page
when "startup page"
- title = 'Tails - News'
+ title = 'Tails - Dear Tails user'
when "Tails roadmap"
title = 'Roadmap - Tails - RiseupLabs Code Repository'
else
@@ -593,6 +593,11 @@ end
When /^I request a shutdown using the emergency shutdown applet$/ do
@screen.hide_cursor
@screen.wait_and_click('TailsEmergencyShutdownButton.png', 10)
+ # Sometimes the next button too fast, before the menu has settled
+ # down to its final size and the icon we want to click is in its
+ # final position. dogtail might allow us to fix that, but given how
+ # rare this problem is, it's not worth the effort.
+ step 'I wait 5 seconds'
@screen.wait_and_click('TailsEmergencyShutdownHalt.png', 10)
end
@@ -603,6 +608,9 @@ end
When /^I request a reboot using the emergency shutdown applet$/ do
@screen.hide_cursor
@screen.wait_and_click('TailsEmergencyShutdownButton.png', 10)
+ # See comment on /^I request a shutdown using the emergency shutdown applet$/
+ # that explains why we need to wait.
+ step 'I wait 5 seconds'
@screen.wait_and_click('TailsEmergencyShutdownReboot.png', 10)
end
diff --git a/features/step_definitions/erase_memory.rb b/features/step_definitions/erase_memory.rb
index 246a245..21ea7bd 100644
--- a/features/step_definitions/erase_memory.rb
+++ b/features/step_definitions/erase_memory.rb
@@ -105,9 +105,9 @@ Given /^I fill the guest's memory with a known pattern(| without verifying)$/ do
# The (guest) kernel may freeze when approaching full memory without
# adjusting the OOM killer and memory overcommitment limitations.
- kernel_mem_reserved_k = 64*1024
+ kernel_mem_reserved_k = 64*1024 # Duplicated in /usr/share/initramfs-tools/scripts/init-premount/memory_wipe
kernel_mem_reserved_m = convert_to_MiB(kernel_mem_reserved_k, 'k')
- admin_mem_reserved_k = 128*1024
+ admin_mem_reserved_k = 128*1024 # Duplicated in /usr/share/initramfs-tools/scripts/init-premount/memory_wipe
admin_mem_reserved_m = convert_to_MiB(admin_mem_reserved_k, 'k')
kernel_mem_settings = [
# Let's avoid killing other random processes, and instead focus on
diff --git a/features/step_definitions/icedove.rb b/features/step_definitions/icedove.rb
index 4806622..7e94716 100644
--- a/features/step_definitions/icedove.rb
+++ b/features/step_definitions/icedove.rb
@@ -59,7 +59,7 @@ end
Then /^I see that only the (.+) addons are enabled in Icedove$/ do |addons|
expected_addons = addons.split(/, | and /)
actual_addons =
- @icedove_addons.child('amnesia branding', roleName: 'label')
+ @icedove_addons.child('TorBirdy', roleName: 'label')
.parent.parent.children(roleName: 'list item', recursive: false)
.map { |item| item.name }
expected_addons.each do |addon|
diff --git a/features/step_definitions/torified_misc.rb b/features/step_definitions/torified_misc.rb
index 7112776..7ccdb22 100644
--- a/features/step_definitions/torified_misc.rb
+++ b/features/step_definitions/torified_misc.rb
@@ -1,3 +1,5 @@
+require 'resolv'
+
When /^I query the whois directory service for "([^"]+)"$/ do |domain|
retry_tor do
@vm_execute_res = $vm.execute("whois '#{domain}'", :user => LIVE_USER)
@@ -9,10 +11,18 @@ When /^I query the whois directory service for "([^"]+)"$/ do |domain|
end
end
-When /^I wget "([^"]+)" to stdout(?:| with the '([^']+)' options)$/ do |url, options|
- arguments = "-O - '#{url}'"
- arguments = "#{options} #{arguments}" if options
+When /^I wget "([^"]+)" to stdout(?:| with the '([^']+)' options)$/ do |target, options|
retry_tor do
+ if target == "some Tails mirror"
+ host = 'dl.amnesia.boum.org'
+ address = Resolv.new.getaddresses(host).sample
+ puts "Resolved #{host} to #{address}"
+ url = "http://#{address}/tails/stable/"
+ else
+ url = target
+ end
+ arguments = "-O - '#{url}'"
+ arguments = "#{options} #{arguments}" if options
@vm_execute_res = $vm.execute("wget #{arguments}", :user => LIVE_USER)
if @vm_execute_res.failure?
raise "wget:ing #{url} with options #{options} failed with:\n" +
diff --git a/features/support/helpers/misc_helpers.rb b/features/support/helpers/misc_helpers.rb
index 8f4bcd8..db907e5 100644
--- a/features/support/helpers/misc_helpers.rb
+++ b/features/support/helpers/misc_helpers.rb
@@ -1,4 +1,6 @@
require 'date'
+require 'io/console'
+require 'pry'
require 'timeout'
require 'test/unit'
@@ -266,6 +268,16 @@ end
def pause(message = "Paused")
STDERR.puts
- STDERR.puts "#{message} (Press ENTER to continue!)"
- STDIN.gets
+ STDERR.puts message
+ STDERR.puts
+ loop do
+ STDERR.puts "Return: Continue; d: Debugging REPL"
+ c = STDIN.getch
+ case c
+ when "\r"
+ return
+ when "d"
+ binding.pry(quiet: true)
+ end
+ end
end
diff --git a/features/support/helpers/sikuli_helper.rb b/features/support/helpers/sikuli_helper.rb
index 2eb0667..4455ecc 100644
--- a/features/support/helpers/sikuli_helper.rb
+++ b/features/support/helpers/sikuli_helper.rb
@@ -1,9 +1,19 @@
require 'rjb'
require 'rjbextension'
$LOAD_PATH << ENV['SIKULI_HOME']
-require 'sikuli-script.jar'
+begin
+ require 'sikulixapi.jar'
+ USING_SIKULIX = true
+rescue LoadError
+ require 'sikuli-script.jar'
+ USING_SIKULIX = false
+end
Rjb::load
+def using_sikulix?
+ USING_SIKULIX
+end
+
package_members = [
"java.io.FileOutputStream",
"java.io.PrintStream",
@@ -16,11 +26,18 @@ package_members = [
"org.sikuli.script.Pattern",
"org.sikuli.script.Region",
"org.sikuli.script.Screen",
- "org.sikuli.script.Settings",
]
+if using_sikulix?
+ package_members << "org.sikuli.basics.Settings"
+ package_members << "org.sikuli.script.ImagePath"
+else
+ package_members << "org.sikuli.script.Settings"
+end
+
translations = Hash[
"org.sikuli.script", "Sikuli",
+ "org.sikuli.basics", "Sikuli",
"java.lang", "Java::Lang",
"java.io", "Java::Io",
]
@@ -186,14 +203,20 @@ def sikuli_script_proxy.new(*args)
end
def s.hide_cursor
- self.hover_point(self.w, self.h/2)
+ self.hover_point(self.w - 1, self.h/2)
end
s
end
# Configure sikuli
-java.lang.System.setProperty("SIKULI_IMAGE_PATH", "#{Dir.pwd}/features/images/")
+if using_sikulix?
+ Sikuli::ImagePath.add("#{Dir.pwd}/features/images/")
+else
+ java.lang.System.setProperty("SIKULI_IMAGE_PATH",
+ "#{Dir.pwd}/features/images/")
+ ENV["SIKULI_IMAGE_PATH"] = "#{Dir.pwd}/features/images/"
+end
# ruby and rjb doesn't play well together when it comes to static
# fields (and possibly methods) so we instantiate and access the field
@@ -211,4 +234,4 @@ sikuli_settings.MinSimilarity = 0.9
sikuli_settings.ActionLogs = true
sikuli_settings.DebugLogs = true
sikuli_settings.InfoLogs = true
-sikuli_settings.ProfileLogs = true
+sikuli_settings.ProfileLogs = false
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index 3e2d7e1..6693120 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -253,7 +253,7 @@ After('@product') do |scenario|
info_log
info_log_artifact_location(type, artifact_path)
end
- pause("Scenario failed") if $config["PAUSE_ON_FAIL"]
+ pause("Scenario failed") if $config["INTERACTIVE_DEBUGGING"]
else
if @video_path && File.exist?(@video_path) && not($config['CAPTURE_ALL'])
FileUtils.rm(@video_path)
diff --git a/features/torified_misc.feature b/features/torified_misc.feature
index 5bb83c8..aab694a 100644
--- a/features/torified_misc.feature
+++ b/features/torified_misc.feature
@@ -15,7 +15,7 @@ Feature: Various checks for torified software
And the wget standard output contains "Example Domain"
Scenario: wget(1) with tricky options should work for HTTP and go through Tor.
- When I wget "http://195.154.14.189/tails/stable/" to stdout with the '--spider --header="Host: dl.amnesia.boum.org"' options
+ When I wget "some Tails mirror" to stdout with the '--spider --header="Host: dl.amnesia.boum.org"' options
Then the wget command is successful
Scenario: whois(1) should work and go through Tor.