GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Unverified Commit 46a81aeb authored by boklm's avatar boklm
Browse files

Bug 18569: run Pluggable Transport tests only once

parent 015ff2e6
......@@ -119,12 +119,14 @@ our @tests = (
descr => 'Access tor using an http proxy',
httpproxy => 1,
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_bridge',
type => 'tor_bootstrap',
descr => 'Access tor using a bridge',
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_bridge_httpproxy',
......@@ -132,12 +134,14 @@ our @tests = (
descr => 'Access tor using a bridge and an http proxy',
httpproxy => 1,
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_obfs3',
type => 'tor_bootstrap',
descr => 'Access tor using obfs3',
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_obfs3_httpproxy',
......@@ -145,12 +149,14 @@ our @tests = (
descr => 'Access tor using obfs3 and an http proxy',
httpproxy => 1,
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_obfs4',
type => 'tor_bootstrap',
descr => 'Access tor using obfs4',
enable => sub { $OSNAME eq 'linux' && $_[0]->{version} !~ m/^4.0/ },
run_once => 1,
},
{
name => 'tor_obfs4_httpproxy',
......@@ -158,12 +164,14 @@ our @tests = (
descr => 'Access tor using obfs4 and an http proxy',
httpproxy => 1,
enable => sub { $OSNAME eq 'linux' && $_[0]->{version} !~ m/^4.0/ },
run_once => 1,
},
{
name => 'tor_fte',
type => 'tor_bootstrap',
descr => 'Access tor using fteproxy',
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_fte_httpproxy',
......@@ -171,12 +179,14 @@ our @tests = (
descr => 'Access tor using fteproxy and an http proxy',
httpproxy => 1,
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_scramblesuit',
type => 'tor_bootstrap',
descr => 'Access tor using scramblesuit',
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_scramblesuit_httpproxy',
......@@ -184,24 +194,28 @@ our @tests = (
descr => 'Access tor using scramblesuit and an http proxy',
httpproxy => 1,
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_meek-google',
type => 'tor_bootstrap',
descr => 'Access tor using meek-google',
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_meek-amazon',
type => 'tor_bootstrap',
descr => 'Access tor using meek-amazon',
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_meek-azure',
type => 'tor_bootstrap',
descr => 'Access tor using meek-azure',
enable => sub { $OSNAME eq 'linux' },
run_once => 1,
},
{
name => 'tor_bootstrap',
......
......@@ -2,6 +2,7 @@ package TBBTestSuite::Tests;
use warnings;
use strict;
use feature 'state';
use English;
use FindBin;
use Cwd qw(getcwd);
......@@ -26,6 +27,7 @@ BEGIN {
sub run_tests {
my ($tbbinfos) = @_;
state %once_tests;
my @enable_tests;
if ($options->{'enable-tests'}) {
@enable_tests = ref $options->{'enable-tests'} ?
......@@ -52,6 +54,10 @@ sub run_tests {
if ($test->{enable} && !$test->{enable}->($tbbinfos, $test)) {
next;
}
if ($test->{run_once}) {
next if $once_tests{$test->{name}};
$once_tests{$test->{name}} = 1;
}
print "\n", '*' x (17 + length($test->{name})), "\n";
print "* Running test $test->{name} *\n";
print '*' x (17 + length($test->{name})), "\n\n";
......
......@@ -68,6 +68,10 @@ enable::
A reference to a perl subroutine that should return false when
the test should be skipped.
run_once::
If set to a true value, when running the testsuite on a series
of bundles, this test will only be run on the first bundle.
Adding a mozmill test
~~~~~~~~~~~~~~~~~~~~~
......
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