summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkytv <killyourtv@i2pmail.org>2015-07-11 17:52:34 +0000
committerkytv <killyourtv@i2pmail.org>2015-07-12 17:08:55 +0000
commit368b6db71c611b32aac985d32c8b418ccd1d3161 (patch)
treec49301cede41f3cba885a471254db6f8a9ad0421
parent3365ccdf9aad0bf29e94dc40a3fa5f50879da47f (diff)
Raise WhoisLookupFailure for LIMIT EXCEEDED
-rw-r--r--features/step_definitions/torified_misc.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/features/step_definitions/torified_misc.rb b/features/step_definitions/torified_misc.rb
index d984ae1..c038fbf 100644
--- a/features/step_definitions/torified_misc.rb
+++ b/features/step_definitions/torified_misc.rb
@@ -7,13 +7,14 @@ When /^I successfully query the whois directory service for "([^"]+)"$/ do |doma
until @new_circuit_tries == $config["MAX_NEW_TOR_CIRCUIT_RETRIES"] do
begin
@vm_execute_res = @vm.execute("whois '#{domain}'", LIVE_USER)
- assert(!@vm_execute_res.stdout['LIMIT EXCEEDED'])
- raise WhoisLookupFailure unless @vm_execute_res.success?
+ if !@vm_execute_res.success? || @vm_execute_res.stdout['LIMIT EXCEEDED']
+ raise WhoisLookupFailure
+ end
break
- rescue Test::Unit::AssertionFailedError
- force_new_tor_circuit
rescue WhoisLookupFailure => e
- if @vm_execute_res.stderr['Timeout'] || @vm_execute_res.stderr['Unable to resolve']
+ if @vm_execute_res.stderr['Timeout'] || \
+ @vm_execute_res.stderr['Unable to resolve'] || \
+ @vm_execute_res.stdout['LIMIT EXCEEDED']
force_new_tor_circuit
else
raise e