3 When /^I query the whois directory service for "([^"]+)"$/ do |domain|
5 @vm_execute_res = $vm.execute("whois '#{domain}'", :user => LIVE_USER)
6 if @vm_execute_res.failure? || @vm_execute_res.stdout['LIMIT EXCEEDED']
7 raise "Looking up whois info for #{domain} failed with:\n" +
8 "#{@vm_execute_res.stdout}\n" +
9 "#{@vm_execute_res.stderr}"
14 When /^I wget "([^"]+)" to stdout(?:| with the '([^']+)' options)$/ do |target, options|
16 if target == "some Tails mirror"
17 host = 'dl.amnesia.boum.org'
18 address = Resolv.new.getaddresses(host).sample
19 puts "Resolved #{host} to #{address}"
20 url = "http://#{address}/tails/stable/"
24 arguments = "-O - '#{url}'"
25 arguments = "#{options} #{arguments}" if options
26 @vm_execute_res = $vm.execute("wget #{arguments}", :user => LIVE_USER)
27 if @vm_execute_res.failure?
28 raise "wget:ing #{url} with options #{options} failed with:\n" +
29 "#{@vm_execute_res.stdout}\n" +
30 "#{@vm_execute_res.stderr}"
35 Then /^the (wget|whois) command is successful$/ do |command|
37 @vm_execute_res.success?,
38 "#{command} failed:\n" +
39 "#{@vm_execute_res.stdout}\n" +
40 "#{@vm_execute_res.stderr}"
44 Then /^the (wget|whois) standard output contains "([^"]+)"$/ do |command, text|
46 @vm_execute_res.stdout[text],
47 "The #{command} standard output does not contain #{text}:\n" +
48 "#{@vm_execute_res.stdout}\n" +
49 "#{@vm_execute_res.stderr}"