Unverified Commit d9298c30 authored by boklm's avatar boklm
Browse files

Fail test when bad connections were detected with mbox

parent 28f1784f
...@@ -356,6 +356,16 @@ sub check_opened_connections { ...@@ -356,6 +356,16 @@ sub check_opened_connections {
next unless $line =~ m/ > \[\d+\] -> (.+)/; next unless $line =~ m/ > \[\d+\] -> (.+)/;
$test->{results}{connections}{$1}++; $test->{results}{connections}{$1}++;
} }
my %bad_connections = %{$test->{results}{connections}};
delete $bad_connections{"127.0.0.1:$options->{'tor-control-port'}"};
delete $bad_connections{"127.0.0.1:$options->{'tor-socks-port'}"};
# For some reasons, tor-browser creates two connections to the default
# socks port even when when TOR_SOCKS_PORT is set
# https://lists.torproject.org/pipermail/tbb-dev/2014-May/000050.html
delete $bad_connections{'127.0.0.1:9150'}
if $bad_connections{'127.0.0.1:9150'} <= 2;
$test->{results}{success} = 0 if %bad_connections;
$test->{results}{bad_connections} = \%bad_connections;
} }
sub check_modified_files { sub check_modified_files {
...@@ -459,9 +469,9 @@ sub mozmill_run { ...@@ -459,9 +469,9 @@ sub mozmill_run {
$i++; $i++;
} }
$test->{results} = decode_json(read_file($results_file)); $test->{results} = decode_json(read_file($results_file));
$test->{results}{success} = !$test->{results}{results}->[0]->{failed};
check_opened_connections($tbbinfos, $test); check_opened_connections($tbbinfos, $test);
check_modified_files($tbbinfos, $test); check_modified_files($tbbinfos, $test);
$test->{results}{success} = !$test->{results}{results}->[0]->{failed};
} }
sub selenium_run { sub selenium_run {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<b>List of opened connections:</b> <b>List of opened connections:</b>
<ul> <ul>
[% FOREACH con IN test.results.connections.nsort.reverse %] [% FOREACH con IN test.results.connections.nsort.reverse %]
<li>[% con %]: [% test.results.connections.$con %] connections</li> <li[% IF test.results.bad_connections.$con %] class="text_red"[% END %]>[% con %]: [% test.results.connections.$con %] connections</li>
[% END %] [% END %]
</ul> </ul>
[% END %] [% END %]
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<b>List of opened connections:</b> <b>List of opened connections:</b>
<ul> <ul>
[% FOREACH con IN test.results.connections.nsort.reverse %] [% FOREACH con IN test.results.connections.nsort.reverse %]
<li>[% con %]: [% test.results.connections.$con %] connections</li> <li[% IF test.results.bad_connections.$con %] class="text_red"[% END %]>[% con %]: [% test.results.connections.$con %] connections</li>
[% END %] [% END %]
</ul> </ul>
[% END %] [% END %]
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
.text_red A { .text_red A {
color: #FF0000; color: #FF0000;
} }
.text_red {
color: #FF0000;
}
</style> </style>
[% INCLUDE togglecontent.js %] [% INCLUDE togglecontent.js %]
</head> </head>
......
Markdown is supported
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