summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkytv <killyourtv@i2pmail.org>2015-07-11 17:46:02 +0000
committerkytv <killyourtv@i2pmail.org>2015-07-12 17:07:58 +0000
commit3365ccdf9aad0bf29e94dc40a3fa5f50879da47f (patch)
treee81ef836cf3a3fd06ff4581098a088bd31f35f03
parent1e89ccd928c184765965b9d99b7660e643a89622 (diff)
Move code from the 'force tor circuit' step to its related function
...and make the step a wrapper for the function.
-rw-r--r--features/step_definitions/common_steps.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index bb8f913..08f66e2 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -1060,15 +1060,11 @@ When /^I open a page on the LAN web server in the (.*)$/ do |browser|
step "I open the address \"#{@web_server_url}\" in the #{browser}"
end
-def force_new_tor_circuit
+def force_new_tor_circuit(with_vidalia=nil)
assert(!@new_circuit_tries.nil? && @new_circuit_tries >= 0,
'@new_circuit_tries was not initialized before it was used')
@new_circuit_tries += 1
STDERR.puts "Forcing new Tor circuit... (attempt ##{@new_circuit_tries})" if $config["DEBUG"]
- step 'I force Tor to use a new circuit'
-end
-
-Then /^I force Tor to use a new circuit( in Vidalia)?$/ do |with_vidalia|
if with_vidalia
assert_equal('gnome', @theme, "Vidalia is not available in the #{@theme} theme.")
begin
@@ -1099,3 +1095,9 @@ Then /^I force Tor to use a new circuit( in Vidalia)?$/ do |with_vidalia|
@vm.execute_successfully('. /usr/local/lib/tails-shell-library/tor.sh; tor_control_send "signal NEWNYM"')
end
end
+
+Then /^I force Tor to use a new circuit( in Vidalia)?$/ do |with_vidalia|
+ next if @skip_steps_while_restoring_background
+ @new_circuit_tries = 1 if @new_circuit_tries.nil?
+ force_new_tor_circuit(with_vidalia)
+end