summaryrefslogtreecommitdiffstats
path: root/features/step_definitions/tor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'features/step_definitions/tor.rb')
-rw-r--r--features/step_definitions/tor.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/features/step_definitions/tor.rb b/features/step_definitions/tor.rb
index ff78d81..73b3abb 100644
--- a/features/step_definitions/tor.rb
+++ b/features/step_definitions/tor.rb
@@ -256,7 +256,8 @@ def stream_isolation_info(application)
when "Tor Browser"
{
:grep_monitor_expr => '/firefox\>',
- :socksport => 9150
+ :socksport => 9150,
+ :controller => true,
}
when "Gobby"
{
@@ -288,17 +289,19 @@ When /^I monitor the network connections of (.*)$/ do |application|
end
Then /^I see that (.+) is properly stream isolated$/ do |application|
- expected_port = stream_isolation_info(application)[:socksport]
+ info = stream_isolation_info(application)
+ expected_ports = [info[:socksport]]
+ expected_ports << 9051 if info[:controller]
assert_not_nil(@process_monitor_log)
log_lines = $vm.file_content(@process_monitor_log).split("\n")
assert(log_lines.size > 0,
"Couldn't see any connection made by #{application} so " \
"something is wrong")
log_lines.each do |line|
- addr_port = line.split(/\s+/)[4]
- assert_equal("127.0.0.1:#{expected_port}", addr_port,
- "#{application} should use SocksPort #{expected_port} but " \
- "was seen connecting to #{addr_port}")
+ ip_port = line.split(/\s+/)[4]
+ assert(expected_ports.map { |port| "127.0.0.1:#{port}" }.include?(ip_port),
+ "#{application} should only connect to #{expected_ports} but " \
+ "was seen connecting to #{ip_port}")
end
end