Commit a4bd4a3b authored by anonym's avatar anonym
Browse files

Merge remote-tracking branch 'origin/bugfix/12130-stream-isolation-vs-control-port' into devel

Fix-committed: 12130
parents 711cab4c 3279136c
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment