summaryrefslogtreecommitdiffstats
path: root/features
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2016-11-29 10:19:15 +0100
committeranonym <anonym@riseup.net>2016-11-29 10:22:03 +0100
commit56f66fb51370273ac0066c10e4ea453bc5205171 (patch)
treec9aba962880bccbd40b5ccea673235b6fe0a965a /features
parent5380ac630077432f469260032106d51c965cb2f8 (diff)
Resolve dl.amnesia.boum.org instead of picking a static address.
Just hours after updating the dustri.org IP address, its web server went down => test suite failures. Let's make this test as robust as actually downloading the Tails ISO image -- if that fails, we probably have more serious problems on our hands than a failing test suite. Will-fix: #11960
Diffstat (limited to 'features')
-rw-r--r--features/step_definitions/torified_misc.rb16
-rw-r--r--features/torified_misc.feature2
2 files changed, 14 insertions, 4 deletions
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/torified_misc.feature b/features/torified_misc.feature
index e73fba1..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://163.172.39.92/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.