Unverified Commit a5e8883a authored by Gunes Acar's avatar Gunes Acar Committed by boklm
Browse files

Remove "always" option. Check Tor process id before trying to stop it.

parent 63442ae2
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -156,7 +156,6 @@ our @tests = (
        type   => 'tor_bootstrap',
        descr  => 'Check that we can bootstrap tor',
        fail_type => 'fatal',
        always => 1,
        use_default_config => 1,
        no_kill => 1,
    },
+4 −5
Original line number Diff line number Diff line
@@ -29,16 +29,15 @@ sub run_tests {
        $test->{fail_type} //= 'error';
    }
    foreach my $test (@{$tbbinfos->{tests}}) {
        print "\n", '*' x (17 + length($test->{name})), "\n";
        print "* Running test $test->{name} *\n";
        print '*' x (17 + length($test->{name})), "\n\n";
        if (@enable_tests && !$test->{always}
            && ! grep { $test->{name} eq $_ } @enable_tests) {
        if (@enable_tests && ! grep { $test->{name} eq $_ } @enable_tests) {
            next;
        }
        if ($test->{enable} && !$test->{enable}->($tbbinfos, $test)) {
            next;
        }
        print "\n", '*' x (17 + length($test->{name})), "\n";
        print "* Running test $test->{name} *\n";
        print '*' x (17 + length($test->{name})), "\n\n";
        $test->{start_time} = time;
        $test->{pre}->($tbbinfos, $test) if $test->{pre};
        $test_types->{$test->{type}}->($tbbinfos, $test)
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ sub start_tor {

sub stop_tor {
    my ($tbbinfos, $test) = @_;
    return unless $options->{starttor};
    return unless ($options->{starttor} && $tbbinfos->{torpid});
    kill 15, $tbbinfos->{torpid};
    my ($kid, $i) = (0, 5);
    while ($kid == 0 && $i) {