brizental pushed to branch main at The Tor Project / Applications / tor-browser-bundle-testsuite

Commits:

22 changed files:

Changes:

  • TBBTestSuite/Options.pm
    ... ... @@ -49,8 +49,6 @@ my %default_options = (
    49 49
         xvfb       => 0,
    
    50 50
         xdummy     => $OSNAME ne 'cygwin',
    
    51 51
         use_strace => 0,
    
    52
    -    virustotal => 0,
    
    53
    -    'virustotal-api-key-file' => "$ENV{HOME}/.virustotal.api-key",
    
    54 52
         'email-to' => [],
    
    55 53
         'email-from' => 'TBB Test Report <tbbtest@example.com>',
    
    56 54
         'email-subject' => '[test result: [% success ? "ok" : "failed" %]] [% options.name %]',
    
    ... ... @@ -71,7 +69,7 @@ sub get_options {
    71 69
                          tor-socks-port=i reports-dir=s gpgcheck! keyring=s
    
    72 70
                          xvfb! name=s download-dir=s config=s
    
    73 71
                          action=s enable-tests=s upload-to=s os=s arch=s
    
    74
    -                     virustotal! email-to=s@ email-from=s email-subject=s
    
    72
    +                     email-to=s@ email-from=s email-subject=s
    
    75 73
                          reports-url=s http-proxy-port=i
    
    76 74
                          xdummy! disable-tests=s testrequests_types=s testsuite=s
    
    77 75
                          cleanup! PTtests!);
    

  • TBBTestSuite/TestSuite/BrowserBundleTests.pm
    ... ... @@ -19,7 +19,6 @@ use LWP::UserAgent;
    19 19
     use IO::CaptureOutput qw(capture_exec);
    
    20 20
     use TBBTestSuite::Common qw(exit_error winpath clone_strip_coderef screenshot_thumbnail);
    
    21 21
     use TBBTestSuite::Options qw($options);
    
    22
    -use TBBTestSuite::Tests::VirusTotal qw(virustotal_run);
    
    23 22
     use TBBTestSuite::Tests::Command qw(command_run);
    
    24 23
     use TBBTestSuite::Tests::TorBootstrap;
    
    25 24
     use TBBTestSuite::XServer qw(start_X stop_X set_Xmode);
    
    ... ... @@ -28,7 +27,6 @@ sub test_types {
    28 27
         return {
    
    29 28
             tor_bootstrap => \&TBBTestSuite::Tests::TorBootstrap::start_tor,
    
    30 29
             marionette    => \&marionette_run,
    
    31
    -        virustotal    => \&virustotal_run,
    
    32 30
             command       => \&command_run,
    
    33 31
         };
    
    34 32
     }
    

  • TBBTestSuite/TestSuite/BrowserBundleVirusTotal.pm deleted
    1
    -package TBBTestSuite::TestSuite::BrowserBundleVirusTotal;
    
    2
    -
    
    3
    -use parent 'TBBTestSuite::TestSuite::BrowserBundleTests';
    
    4
    -
    
    5
    -sub description {
    
    6
    -    'Tor Browser Bundle Virustotal checks';
    
    7
    -}
    
    8
    -
    
    9
    -sub type {
    
    10
    -    'browserbundle_virustotal';
    
    11
    -}
    
    12
    -
    
    13
    -sub new {
    
    14
    -    my ($ts, $testsuite) = @_;
    
    15
    -    return undef unless $testsuite->{os} eq 'Windows';
    
    16
    -    $testsuite->{type} = 'browserbundle_virustotal';
    
    17
    -    $testsuite->{tests} = [
    
    18
    -        {
    
    19
    -            name   => 'virustotal',
    
    20
    -            type   => 'virustotal',
    
    21
    -            descr  => 'Analyze files on virustotal.com',
    
    22
    -        },
    
    23
    -    ];
    
    24
    -    return bless $testsuite;
    
    25
    -}
    
    26
    -
    
    27
    -1;

  • TBBTestSuite/TestSuite/BrowserRebaseTests.pm deleted
    1
    -package TBBTestSuite::TestSuite::BrowserRebaseTests;
    
    2
    -
    
    3
    -use strict;
    
    4
    -
    
    5
    -use parent 'TBBTestSuite::TestSuite';
    
    6
    -
    
    7
    -use File::Slurp;
    
    8
    -use IO::CaptureOutput qw(capture_exec);
    
    9
    -use TBBTestSuite::BrowserGit qw(git_clone_fetch get_commits_by_branch
    
    10
    -                                parent_commit git_cmd git_cmd_ch);
    
    11
    -
    
    12
    -sub test_types {
    
    13
    -    return {
    
    14
    -        cherry_pick => \&cherry_pick,
    
    15
    -    };
    
    16
    -}
    
    17
    -
    
    18
    -sub type {
    
    19
    -    'browserrebase';
    
    20
    -}
    
    21
    -
    
    22
    -sub description {
    
    23
    -    'Tor Browser rebase tests';
    
    24
    -}
    
    25
    -
    
    26
    -sub test_name {
    
    27
    -    my ($commit) = @_;
    
    28
    -    my ($res) = git_cmd_ch('git', 'show', '-s', '--abbrev=12',
    
    29
    -                           '--format=%h-%f', $commit);
    
    30
    -    return $res;
    
    31
    -}
    
    32
    -
    
    33
    -
    
    34
    -sub new {
    
    35
    -    my ($ts, $infos) = @_;
    
    36
    -    git_clone_fetch;
    
    37
    -    my $testsuite = {
    
    38
    -        %$infos,
    
    39
    -        type => $ts->type(),
    
    40
    -        filename => 'browser-rebase',
    
    41
    -        tests => [],
    
    42
    -    };
    
    43
    -    my @commits = reverse get_commits_by_branch($infos->{tb_branch},
    
    44
    -                                        $infos->{esr_branch});
    
    45
    -    shift @commits;
    
    46
    -    foreach my $commit (@commits) {
    
    47
    -        my $test = {
    
    48
    -            name => test_name($commit),
    
    49
    -            type => 'cherry_pick',
    
    50
    -            descr => "Cherry pick commit $commit\n",
    
    51
    -            commit => $commit,
    
    52
    -            retry => 1,
    
    53
    -        };
    
    54
    -        push @{$testsuite->{tests}}, $test;
    
    55
    -    }
    
    56
    -    return bless $testsuite, $ts;
    
    57
    -}
    
    58
    -
    
    59
    -sub pre_tests {
    
    60
    -    my ($tbbinfos) = @_;
    
    61
    -    chdir $TBBTestSuite::BrowserGit::clone_dir;
    
    62
    -    git_cmd('git', 'clean', '-fx');
    
    63
    -    git_cmd('git', 'checkout', '-f', '--detach');
    
    64
    -    if (-f '.git/refs/heads/rebase-test') {
    
    65
    -        print "Removing rebase-test branch\n";
    
    66
    -        my ($out) = git_cmd('git', 'branch', '-D', 'rebase-test');
    
    67
    -        print $out;
    
    68
    -    }
    
    69
    -    git_cmd('git', 'branch', '-f', 'rebase-test', 'gecko-dev/master');
    
    70
    -    git_cmd('git', 'checkout', '-f', 'rebase-test');
    
    71
    -}
    
    72
    -
    
    73
    -sub cherry_pick {
    
    74
    -    my ($tbbinfos, $test) = @_;
    
    75
    -    print "Rebase $test->{commit}\n";
    
    76
    -    my ($out, $err, $success) = capture_exec('git', 'cherry-pick', '-Xpatience',
    
    77
    -                                '--allow-empty', '--ff', $test->{commit});
    
    78
    -    $test->{results}{success} = $success;
    
    79
    -    if (!$success) {
    
    80
    -        $test->{results}{git_out} = $out;
    
    81
    -        $test->{results}{git_err} = $err;
    
    82
    -        ($test->{results}{failed_diff}) = git_cmd_ch('git', 'diff');
    
    83
    -        $test->{results}{success} = 1 unless $test->{results}{failed_diff};
    
    84
    -        git_cmd('git', 'reset', '--hard');
    
    85
    -    } else {
    
    86
    -        my ($patch) = git_cmd_ch('git', 'format-patch', '--stdout', 'HEAD^');
    
    87
    -        write_file("$tbbinfos->{'results-dir'}/$test->{name}.patch", $patch);
    
    88
    -        $test->{results}{patch_file} = 1;
    
    89
    -    }
    
    90
    -}
    
    91
    -
    
    92
    -1;

  • TBBTestSuite/TestSuite/TorMailBuild.pm deleted
    1
    -package TBBTestSuite::TestSuite::TorMailBuild;
    
    2
    -
    
    3
    -use strict;
    
    4
    -use parent 'TBBTestSuite::TestSuite::RBMBuild';
    
    5
    -
    
    6
    -use TBBTestSuite::GitRepo;
    
    7
    -
    
    8
    -sub description {
    
    9
    -    'Tor Mail Build';
    
    10
    -}
    
    11
    -
    
    12
    -sub type {
    
    13
    -    'tor-mail_build';
    
    14
    -};
    
    15
    -
    
    16
    -sub set_tests {
    
    17
    -    my ($testsuite) = @_;
    
    18
    -    $testsuite->{tests} = [
    
    19
    -        {
    
    20
    -            name  => 'linux-x86_64',
    
    21
    -            descr => 'build tor-mail linux-x86_64',
    
    22
    -            type  => 'rbm_build',
    
    23
    -            project => 'tor-mail',
    
    24
    -            targets => [
    
    25
    -                'noint',
    
    26
    -                'linux-x86_64',
    
    27
    -                'tor-mail',
    
    28
    -            ],
    
    29
    -            publish_dir => 'linux-x86_64',
    
    30
    -        },
    
    31
    -        {
    
    32
    -            name  => 'linux-i686',
    
    33
    -            descr => 'build tor-mail linux-i686',
    
    34
    -            type  => 'rbm_build',
    
    35
    -            project => 'tor-mail',
    
    36
    -            targets => [
    
    37
    -                'noint',
    
    38
    -                'linux-i686',
    
    39
    -                'tor-mail',
    
    40
    -            ],
    
    41
    -            publish_dir => 'linux-i686',
    
    42
    -        },
    
    43
    -    ];
    
    44
    -}
    
    45
    -
    
    46
    -sub pre_tests {
    
    47
    -    my ($tbbinfos) = @_;
    
    48
    -    my $gr = TBBTestSuite::GitRepo->new({
    
    49
    -            name => 'tor-mail',
    
    50
    -            git_url => 'https://git.torproject.org/tor-messenger-build.git',
    
    51
    -        });
    
    52
    -    $gr->clone_fetch;
    
    53
    -    $gr->cmd('git', 'checkout', 'master');
    
    54
    -    chdir $gr->clone_dir();
    
    55
    -    system('make', 'submodule-update');
    
    56
    -    system('make', 'fetch');
    
    57
    -}
    
    58
    -
    
    59
    -1;

  • TBBTestSuite/TestSuite/TorMessengerBuild.pm deleted
    1
    -package TBBTestSuite::TestSuite::TorMessengerBuild;
    
    2
    -
    
    3
    -use strict;
    
    4
    -use parent 'TBBTestSuite::TestSuite::RBMBuild';
    
    5
    -
    
    6
    -use TBBTestSuite::GitRepo;
    
    7
    -
    
    8
    -sub description {
    
    9
    -    'Tor Messenger Build';
    
    10
    -}
    
    11
    -
    
    12
    -sub type {
    
    13
    -    'tor-messenger_build';
    
    14
    -};
    
    15
    -
    
    16
    -sub set_tests {
    
    17
    -    my ($testsuite) = @_;
    
    18
    -    $testsuite->{tests} = [
    
    19
    -        {
    
    20
    -            name  => 'linux-x86_64',
    
    21
    -            descr => 'build tor-messenger linux-x86_64',
    
    22
    -            type  => 'rbm_build',
    
    23
    -            project => 'tor-messenger',
    
    24
    -            targets => [
    
    25
    -                'noint',
    
    26
    -                'linux-x86_64',
    
    27
    -                'tor-messenger',
    
    28
    -            ],
    
    29
    -            publish_dir => 'linux-x86_64',
    
    30
    -        },
    
    31
    -        {
    
    32
    -            name  => 'linux-i686',
    
    33
    -            descr => 'build tor-messenger linux-i686',
    
    34
    -            type  => 'rbm_build',
    
    35
    -            project => 'tor-messenger',
    
    36
    -            targets => [
    
    37
    -                'noint',
    
    38
    -                'linux-i686',
    
    39
    -                'tor-messenger',
    
    40
    -            ],
    
    41
    -            publish_dir => 'linux-i686',
    
    42
    -        },
    
    43
    -        {
    
    44
    -            name  => 'windows-i686',
    
    45
    -            descr => 'build tor-messenger windows-i686',
    
    46
    -            type  => 'rbm_build',
    
    47
    -            project => 'tor-messenger',
    
    48
    -            targets => [
    
    49
    -                'noint',
    
    50
    -                'windows-i686',
    
    51
    -                'tor-messenger',
    
    52
    -            ],
    
    53
    -            publish_dir => 'windows-i686',
    
    54
    -        },
    
    55
    -        {
    
    56
    -            name  => 'osx-x86_64',
    
    57
    -            descr => 'build tor-messenger osx-x86_64',
    
    58
    -            type  => 'rbm_build',
    
    59
    -            project => 'tor-messenger',
    
    60
    -            targets => [
    
    61
    -                'noint',
    
    62
    -                'osx-x86_64',
    
    63
    -                'tor-messenger',
    
    64
    -            ],
    
    65
    -            publish_dir => 'osx-x86_64',
    
    66
    -        },
    
    67
    -    ];
    
    68
    -}
    
    69
    -
    
    70
    -sub pre_tests {
    
    71
    -    my ($tbbinfos) = @_;
    
    72
    -    my $gr = TBBTestSuite::GitRepo->new({
    
    73
    -            name => 'tor-messenger',
    
    74
    -            git_url => 'https://git.torproject.org/tor-messenger-build.git',
    
    75
    -        });
    
    76
    -    $gr->clone_fetch;
    
    77
    -    $gr->cmd('git', 'checkout', 'master');
    
    78
    -    chdir $gr->clone_dir();
    
    79
    -    system('make', 'submodule-update');
    
    80
    -    system('make', 'fetch');
    
    81
    -}
    
    82
    -
    
    83
    -1;

  • TBBTestSuite/TestSuites.pm
    ... ... @@ -4,18 +4,14 @@ use strict;
    4 4
     
    
    5 5
     use TBBTestSuite::TestSuite::TestTestSuite;
    
    6 6
     use TBBTestSuite::TestSuite::BrowserBundleTests;
    
    7
    -use TBBTestSuite::TestSuite::BrowserBundleVirusTotal;
    
    8 7
     use TBBTestSuite::TestSuite::BrowserUnitTests;
    
    9
    -use TBBTestSuite::TestSuite::BrowserRebaseTests;
    
    10 8
     use TBBTestSuite::TestSuite::RBMBuild;
    
    11
    -use TBBTestSuite::TestSuite::TorMailBuild;
    
    12
    -use TBBTestSuite::TestSuite::TorMessengerBuild;
    
    13 9
     use TBBTestSuite::TestSuite::TorBrowserBuild;
    
    14 10
     use TBBTestSuite::TestSuite::BrowserBundleHardening;
    
    15 11
     
    
    16
    -my @testsuite_list = qw(TestTestSuite BrowserBundleTests BrowserBundleVirusTotal
    
    17
    -                        BrowserUnitTests BrowserRebaseTests RBMBuild TorMailBuild
    
    18
    -                        TorMessengerBuild TorBrowserBuild BrowserBundleHardening);
    
    12
    +my @testsuite_list = qw(TestTestSuite BrowserBundleTests
    
    13
    +                        BrowserUnitTests RBMBuild TorBrowserBuild
    
    14
    +                        BrowserBundleHardening);
    
    19 15
     my %testsuite_types;
    
    20 16
     sub testsuite_types {
    
    21 17
         return %testsuite_types if %testsuite_types;
    

  • TBBTestSuite/Tests.pm
    ... ... @@ -154,9 +154,7 @@ sub tbb_filename_infos {
    154 154
         if ($options->{testsuite}) {
    
    155 155
             return TBBTestSuite::TestSuites::new_by_type($options->{testsuite}, \%res);
    
    156 156
         }
    
    157
    -    return $options->{virustotal} ?
    
    158
    -        TBBTestSuite::TestSuite::BrowserBundleVirusTotal->new(\%res)
    
    159
    -        : TBBTestSuite::TestSuite::BrowserBundleTests->new(\%res);
    
    157
    +    return TBBTestSuite::TestSuite::BrowserBundleTests->new(\%res);
    
    160 158
     }
    
    161 159
     
    
    162 160
     sub check_gpgsig {
    

  • TBBTestSuite/Tests/VirusTotal.pm deleted
    1
    -package TBBTestSuite::Tests::VirusTotal;
    
    2
    -
    
    3
    -use strict;
    
    4
    -use Cwd;
    
    5
    -use JSON;
    
    6
    -use LWP::UserAgent;
    
    7
    -use File::Slurp;
    
    8
    -use File::Spec;
    
    9
    -use File::Find;
    
    10
    -use Digest::SHA qw(sha256_hex);
    
    11
    -use Data::Dump qw(dd);
    
    12
    -use TBBTestSuite::Options qw($options);
    
    13
    -
    
    14
    -our (@ISA, @EXPORT_OK);
    
    15
    -BEGIN {
    
    16
    -    require Exporter;
    
    17
    -    @ISA       = qw(Exporter);
    
    18
    -    @EXPORT_OK = qw(virustotal_run);
    
    19
    -}
    
    20
    -
    
    21
    -my %urls = (
    
    22
    -    report => 'https://www.virustotal.com/vtapi/v2/file/report',
    
    23
    -    scan   => 'https://www.virustotal.com/vtapi/v2/file/scan',
    
    24
    -);
    
    25
    -
    
    26
    -my $min_time = 15; # minimal time between requests (in seconds)
    
    27
    -my $last_req = 0;
    
    28
    -sub req {
    
    29
    -    my ($ua, @args) = @_;
    
    30
    -    if ($last_req && time - $last_req < $min_time) {
    
    31
    -        sleep($min_time - (time - $last_req));
    
    32
    -    }
    
    33
    -    $last_req = time;
    
    34
    -    my $r = $ua->post(@args);
    
    35
    -    return undef unless $r->is_success;
    
    36
    -    my $res = eval { JSON::decode_json $r->content };
    
    37
    -    print STDERR $@, "\n" unless defined $res;
    
    38
    -    return undef unless defined $res;
    
    39
    -    return $res->{response_code} ? $res : undef;
    
    40
    -}
    
    41
    -
    
    42
    -sub scan_file {
    
    43
    -    my ($file) = @_;
    
    44
    -    my $apikey = read_file($options->{'virustotal-api-key-file'});
    
    45
    -    my (undef, undef, $filename) = File::Spec->splitpath($file);
    
    46
    -    print "Checking $filename on virustotal\n";
    
    47
    -    my $sha = sha256_hex(read_file($file));
    
    48
    -    my $params_report = {
    
    49
    -        resource => $sha,
    
    50
    -        apikey => $apikey,
    
    51
    -    };
    
    52
    -    my $ua = LWP::UserAgent->new;
    
    53
    -    my $r = req($ua, $urls{report}, $params_report);
    
    54
    -    return $r if defined $r;
    
    55
    -    my $params_scan = {
    
    56
    -        apikey => $apikey,
    
    57
    -        file => [ $file, $filename ],
    
    58
    -    };
    
    59
    -    $r = req($ua, $urls{scan}, Content_Type => 'multipart/form-data',
    
    60
    -                               Content => $params_scan);
    
    61
    -    return $r unless defined $r;
    
    62
    -    return $r unless $r->{response_code};
    
    63
    -    my $retry = 20;
    
    64
    -    while ($retry) {
    
    65
    -        $retry--;
    
    66
    -        sleep(30);
    
    67
    -        $r = req($ua, $urls{report}, $params_report);
    
    68
    -        return $r if $r->{response_code};
    
    69
    -    }
    
    70
    -    return $r;
    
    71
    -}
    
    72
    -
    
    73
    -sub virustotal_run {
    
    74
    -    my ($tbbinfos, $test) = @_;
    
    75
    -    return unless $options->{virustotal};
    
    76
    -    my $files = {};
    
    77
    -    $files->{$tbbinfos->{filename}} = scan_file("$tbbinfos->{tmpdir}/$tbbinfos->{filename}");
    
    78
    -    my $cwd = getcwd;
    
    79
    -    my $scanfile = sub {
    
    80
    -        my $file = $File::Find::name;
    
    81
    -        return unless -f $file;
    
    82
    -        return unless $file =~ m/\.exe$/;
    
    83
    -        my $relative = $file;
    
    84
    -        $relative =~ s/^$cwd\///;
    
    85
    -        $files->{$relative} = scan_file($File::Find::name);
    
    86
    -    };
    
    87
    -    find($scanfile, $cwd);
    
    88
    -    $test->{results}{files} = $files;
    
    89
    -    $test->{results}{success} = 1;
    
    90
    -    foreach my $file (keys %$files) {
    
    91
    -        if (!$files->{$file}{response_code} || $files->{$file}{positives}) {
    
    92
    -            $test->{results}{success} = 0;
    
    93
    -        }
    
    94
    -    }
    
    95
    -}
    
    96
    -
    
    97
    -1;

  • config/browser-rebase deleted
    1
    -# vim: filetype=perl expandtab
    
    2
    -
    
    3
    -use strict;
    
    4
    -use FindBin;
    
    5
    -use TBBTestSuite::Common;
    
    6
    -use TBBTestSuite::TestSuite::BrowserRebaseTests;
    
    7
    -use TBBTestSuite::BrowserGit qw(git_clone_fetch get_commits_by_branch
    
    8
    -                                parent_commit git_cmd_ch);
    
    9
    -
    
    10
    -my $torbrowser_branch = 'tor-browser-31.6.0esr-4.5-1',
    
    11
    -my $esr_branch = 'esr31';
    
    12
    -my $testsuite_version = '1';
    
    13
    -
    
    14
    -my ($commit) = git_cmd_ch('git', 'show', '-s', '--format=%H',
    
    15
    -                                          "$torbrowser_branch^{commit}");
    
    16
    -my $name = "rebase-$testsuite_version-$commit";
    
    17
    -my $tbbinfos = TBBTestSuite::TestSuite::BrowserRebaseTests->new({
    
    18
    -        tb_branch => $torbrowser_branch,
    
    19
    -        esr_branch => $esr_branch,
    
    20
    -    });
    
    21
    -
    
    22
    -my %res = (
    
    23
    -    name => $name,
    
    24
    -    args => [ $tbbinfos ],
    
    25
    -    tags => [ $torbrowser_branch ],
    
    26
    -);
    
    27
    -%res;

  • config/linus-nightly-virustotal deleted
    1
    -# vim: filetype=perl expandtab
    
    2
    -
    
    3
    -use strict;
    
    4
    -use Data::Dump qw(dd);
    
    5
    -use LWP::Simple;
    
    6
    -use TBBTestSuite::Common qw(last_days);
    
    7
    -
    
    8
    -my $system_infos = TBBTestSuite::Common::system_infos;
    
    9
    -my ($name, $shaurl);
    
    10
    -my @dates = last_days(6);
    
    11
    -my $ok = 0;
    
    12
    -
    
    13
    -foreach my $date (@dates) {
    
    14
    -    $shaurl = "https://people.torproject.org/~linus/builds/tbb-nightly-$date/sha256sums-unsigned-build.txt";
    
    15
    -    $name = "tbb-nightly-$date-win32-virustotal";
    
    16
    -    if (-d "$options->{'reports-dir'}/r/$name") {
    
    17
    -        print "Doing nothing: $name already done\n";
    
    18
    -        return ( args => [] );
    
    19
    -    }
    
    20
    -
    
    21
    -    if (get($shaurl)) {
    
    22
    -        $ok = 1;
    
    23
    -        last;
    
    24
    -    }
    
    25
    -}
    
    26
    -return ( args => [] ) unless $ok;
    
    27
    -
    
    28
    -(
    
    29
    -    name    => $name,
    
    30
    -    keyring => 'linus-nightly.gpg',
    
    31
    -    args    => [ $shaurl ],
    
    32
    -    virustotal => 1,
    
    33
    -    os      => 'Windows',
    
    34
    -    arch    => 'x86',
    
    35
    -    starttor => 0,
    
    36
    -    'email-from' => 'TBB Nightly Tests <boklm@torproject.org>',
    
    37
    -    'email-to'   => [ 'boklm@mars-attacks.org', ],
    
    38
    -    'reports-url' => 'http://tbb-test-reports.mars-attacks.org/reports/',
    
    39
    -);

  • config/release-virustotal deleted
    1
    -# vim: filetype=perl expandtab
    
    2
    -
    
    3
    -use strict;
    
    4
    -use TBBTestSuite::TBBVersion;
    
    5
    -
    
    6
    -my @latest_builds = TBBTestSuite::TBBVersion::latest_builds($options);
    
    7
    -foreach my $build (@latest_builds) {
    
    8
    -    my $name = "$build->{buildname}-win32-virustotal";
    
    9
    -    next if -d "$options->{'reports-dir'}/r/$name";
    
    10
    -    return (
    
    11
    -        name => $name,
    
    12
    -        keyring => "$build->{user}.gpg",
    
    13
    -        args => [ $build->{url} ],
    
    14
    -        tags => [ "$build->{version}-$build->{build}" ],
    
    15
    -        virustotal => 1,
    
    16
    -        os         => 'Windows',
    
    17
    -        arch       => 'x86',
    
    18
    -        starttor   => 0,
    
    19
    -        'reports-url' => 'http://tbb-test-reports.mars-attacks.org/reports/',
    
    20
    -        'email-from'  => 'TBB Tests <boklm@torproject.org>',
    
    21
    -        'email-to'    => [ 'tor-qa@lists.torproject.org', 'boklm@mars-attacks.org', ],
    
    22
    -    );
    
    23
    -}
    
    24
    -return ( args => [] );

  • config/tor-mail_build deleted
    1
    -# vim: filetype=perl expandtab
    
    2
    -use strict;
    
    3
    -use FindBin;
    
    4
    -use DateTime;
    
    5
    -use TBBTestSuite::TestSuite::TorMailBuild;
    
    6
    -
    
    7
    -my $date = DateTime->now->ymd;
    
    8
    -my $name = "tor-mail-$date";
    
    9
    -
    
    10
    -if (-d "$options->{'reports-dir'}/r/$name") {
    
    11
    -    print "Doing nothing: $name already done\n";
    
    12
    -    return ( args => [] );
    
    13
    -}
    
    14
    -
    
    15
    -my $testsuite = TBBTestSuite::TestSuite::TorMailBuild->new({
    
    16
    -        publish_dir => "$FindBin::Bin/tor-mail-builds/$date",
    
    17
    -        publish_url => "http://paganini.erinn.org/~boklm/builds/tor-mail/$date",
    
    18
    -    });
    
    19
    -
    
    20
    -my %res = (
    
    21
    -    name => $name,
    
    22
    -    args => [ $testsuite ],
    
    23
    -    tags => [ 'nightly' ],
    
    24
    -);
    
    25
    -%res;

  • config/tor-messenger_build deleted
    1
    -# vim: filetype=perl expandtab
    
    2
    -use strict;
    
    3
    -use FindBin;
    
    4
    -use DateTime;
    
    5
    -use TBBTestSuite::TestSuite::TorMessengerBuild;
    
    6
    -
    
    7
    -my $date = DateTime->now->ymd;
    
    8
    -my $name = "tor-messenger-$date";
    
    9
    -
    
    10
    -if (-d "$options->{'reports-dir'}/r/$name") {
    
    11
    -    print "Doing nothing: $name already done\n";
    
    12
    -    return ( args => [] );
    
    13
    -}
    
    14
    -
    
    15
    -my $testsuite = TBBTestSuite::TestSuite::TorMessengerBuild->new({
    
    16
    -        publish_dir => "$FindBin::Bin/tor-messenger-builds/$date",
    
    17
    -        publish_url => "http://paganini.erinn.org/~boklm/builds/tor-messenger/$date",
    
    18
    -    });
    
    19
    -
    
    20
    -my %res = (
    
    21
    -    name => $name,
    
    22
    -    args => [ $testsuite ],
    
    23
    -    tags => [ 'nightly' ],
    
    24
    -);
    
    25
    -%res;

  • doc/usage.txt
    ... ... @@ -112,10 +112,6 @@ Available options
    112 112
             using a sha256sums-unsigned-build.txt file. By default, it is
    
    113 113
             the architecture you are currently running.
    
    114 114
     
    
    115
    ---virustotal::
    
    116
    -        Enable upload of files for analysis on virustotal.com instead
    
    117
    -        of the regular testsuite.
    
    118
    -
    
    119 115
     --email-from::
    
    120 116
             Set the From header that will be used when sending reports by
    
    121 117
             email.
    

  • tmpl/details_cherry_pick.html deleted
    1
    -[% IF test.results.success %]
    
    2
    -  [% IF test.results.patch_file %]
    
    3
    -  <a href="results-[% tbbfile %]/[% test.name %].patch">rebased patch</a>
    
    4
    -  [% ELSE %]
    
    5
    -  Skipped
    
    6
    -  [% END %]
    
    7
    -[% ELSE %]
    
    8
    -Failed diff:
    
    9
    -<pre>[% FILTER html_entity %][% test.results.failed_diff %][% END %]</pre>
    
    10
    -[% END %]

  • tmpl/details_virustotal.html deleted
    1
    -<ul>
    
    2
    -    [% FOREACH file IN test.results.files.keys %]
    
    3
    -    <li>virustotal report:
    
    4
    -    <span [% IF test.results.files.$file.positives %]class="text_red"[% END %]>
    
    5
    -        <a href="[% test.results.files.$file.permalink %]">[% file %]</a>
    
    6
    -    </span>
    
    7
    -    <ul>
    
    8
    -        [% FOREACH av IN test.results.files.$file.scans.keys %]
    
    9
    -          [% IF test.results.files.$file.scans.$av.result %]
    
    10
    -                <li>[% av %]: [% test.results.files.$file.scans.$av.result %]</li>
    
    11
    -          [% END %]
    
    12
    -        [% END %]
    
    13
    -    </ul>
    
    14
    -    </li>
    
    15
    -    [% END %]
    
    16
    -</ul>

  • tmpl/report_browserbundle_virustotal.txt deleted
    1
    -Bundle infos
    
    2
    -  Filename: [% tbbfiles.$tbbfile.filename %]
    
    3
    -  sha256sum: [% tbbfiles.$tbbfile.sha256sum %]
    
    4
    -
    
    5
    -Results
    
    6
    -
    
    7
    -[% IF tbbfiles.$tbbfile.pre_tests_error -%]
    
    8
    -  pre_tests error:
    
    9
    -[% FILTER indent('   ') -%]
    
    10
    -[% tbbfiles.$tbbfile.pre_tests_error %]
    
    11
    -[% END %]
    
    12
    -[% END -%]
    
    13
    -[%
    
    14
    -FOREACH test IN tbbfiles.$tbbfile.tests;
    
    15
    -NEXT IF test.type != 'virustotal';
    
    16
    -positives = [];
    
    17
    -negatives = [];
    
    18
    -FOREACH file IN test.results.files.keys.sort;
    
    19
    - IF test.results.files.$file.positives;
    
    20
    -    positives.push(file);
    
    21
    - ELSE;
    
    22
    -    negatives.push(file);
    
    23
    - END;
    
    24
    -END;
    
    25
    -
    
    26
    -IF positives.size == 0 -%]
    
    27
    -   No positives
    
    28
    -[% ELSE -%]
    
    29
    -   Positives:
    
    30
    -[% FOREACH file IN positives -%]
    
    31
    -    - [% file %]
    
    32
    -[%    FOREACH av IN test.results.files.$file.scans.keys.sort -%]
    
    33
    -[%       IF test.results.files.$file.scans.$av.result -%]
    
    34
    -      [% av %]: [% test.results.files.$file.scans.$av.result %]
    
    35
    -[%       END -%]
    
    36
    -[%    END -%]
    
    37
    -      [% test.results.files.$file.permalink %]
    
    38
    -[% END -%]
    
    39
    -
    
    40
    -[% END;
    
    41
    -IF negatives.size == 0 -%]
    
    42
    -   No negatives
    
    43
    -[% ELSE  -%]
    
    44
    -   Negatives:
    
    45
    -[% FOREACH file IN negatives -%]
    
    46
    -    - [% file %]
    
    47
    -[% END -%]
    
    48
    -[% END -%]
    
    49
    -[% END -%]

  • tmpl/reports_index_browserbundle_virustotal.html deleted
    1
    -[% USE date -%]
    
    2
    -<html>
    
    3
    -    <head>
    
    4
    -        <title>Tests reports</title>
    
    5
    -        <style type="text/css">
    
    6
    -            .test_ok {
    
    7
    -                color: #006600;
    
    8
    -                font-weight: bold;
    
    9
    -            }
    
    10
    -            .test_ok A {
    
    11
    -                color: #006600;
    
    12
    -                font-weight: bold;
    
    13
    -            }
    
    14
    -            .test_notok {
    
    15
    -                color: #FF0000;
    
    16
    -                font-weight: bold;
    
    17
    -            }
    
    18
    -            .test_notok A {
    
    19
    -                color: #FF0000;
    
    20
    -            }
    
    21
    -            .reportdate {
    
    22
    -                font-size: small;
    
    23
    -            }
    
    24
    -        </style>
    
    25
    -    </head>
    
    26
    -    <body>
    
    27
    -        <h1>[% title %]</h1>
    
    28
    -        <table>
    
    29
    -            <tr>
    
    30
    -                <th>Name</th>
    
    31
    -                <th>Date</th>
    
    32
    -                <th>Version</th>
    
    33
    -                <th>Result</th>
    
    34
    -            </tr>
    
    35
    -            [% FOREACH report IN reports_list %]
    
    36
    -            <tr>
    
    37
    -                <td valign="top"><a href="r/[% report %]/index.html">[% report %]</a></td>
    
    38
    -                <td valign="top">[% date.format(reports.$report.time, '%Y-%m-%d %H:%M') %]</td>
    
    39
    -                <td valign="top">[% IF reports.$report.options.tags %]
    
    40
    -                                        <a href="index-browserbundle-[% reports.$report.options.tags.0 %].html">[% reports.$report.options.tags.0 %]</a>
    
    41
    -                                 [% END %]
    
    42
    -                                    </td>
    
    43
    -                <td valign="top">
    
    44
    -                    [% failed = 0 %]
    
    45
    -                    [% FOREACH tbbfile IN reports.$report.tbbfiles.keys %]
    
    46
    -                      [% IF ! reports.$report.tbbfiles.$tbbfile.success %]
    
    47
    -                        [% failed = 1 %]
    
    48
    -                      [% END %]
    
    49
    -                    [% END %]
    
    50
    -
    
    51
    -                    [% IF failed == 0 %]
    
    52
    -                      <span class="test_ok"><a href="r/[% report %]/index.html">OK</a></span>
    
    53
    -                    [% ELSE %]
    
    54
    -                    <span class="test_notok">Failed:</span>
    
    55
    -                    <ul>
    
    56
    -                    [% FOREACH tbbfile IN reports.$report.tbbfiles.keys %]
    
    57
    -                      [% IF ! reports.$report.tbbfiles.$tbbfile.success %]
    
    58
    -                        <li><a href="r/[% report %]/[% tbbfile %].html">[% tbbfile %]</a>
    
    59
    -                            <ul>
    
    60
    -                            [%
    
    61
    -                            FOREACH test IN reports.$report.tbbfiles.$tbbfile.tests;
    
    62
    -                              NEXT IF test.type != 'virustotal';
    
    63
    -                              FOREACH file IN test.results.files.keys;
    
    64
    -                                 NEXT UNLESS test.results.files.$file.positives;
    
    65
    -                                 %]<li><a href="[% test.results.files.$file.permalink %]">[% file %]</a>
    
    66
    -                                 <ul>
    
    67
    -                                 [% FOREACH av IN test.results.files.$file.scans.keys;
    
    68
    -                                      IF test.results.files.$file.scans.$av.result %]
    
    69
    -                                      <li>[% av %]: [% test.results.files.$file.scans.$av.result %]</li>
    
    70
    -                                 [%   END;
    
    71
    -                                    END -%]
    
    72
    -                                 </ul>
    
    73
    -                                 </li>[%
    
    74
    -                              END;
    
    75
    -                            END;
    
    76
    -                            %]
    
    77
    -                            </ul>
    
    78
    -                        </li>
    
    79
    -                        [% failed = 1 %]
    
    80
    -                      [% END %]
    
    81
    -                    [% END %]
    
    82
    -                    </ul>
    
    83
    -                    [% END %]
    
    84
    -                </td>
    
    85
    -            </tr>
    
    86
    -            [% END %]
    
    87
    -        </table>
    
    88
    -    </body>
    
    89
    -</html>

  • tmpl/reports_index_browserrebase.html deleted
    1
    -[% USE date -%]
    
    2
    -<html>
    
    3
    -    <head>
    
    4
    -        <title>Tests reports</title>
    
    5
    -        <style type="text/css">
    
    6
    -            .test_ok {
    
    7
    -                color: #006600;
    
    8
    -                font-weight: bold;
    
    9
    -            }
    
    10
    -            .test_ok A {
    
    11
    -                color: #006600;
    
    12
    -                font-weight: bold;
    
    13
    -            }
    
    14
    -            .test_notok {
    
    15
    -                color: #FF0000;
    
    16
    -                font-weight: bold;
    
    17
    -            }
    
    18
    -            .test_notok A {
    
    19
    -                color: #FF0000;
    
    20
    -            }
    
    21
    -            .reportdate {
    
    22
    -                font-size: small;
    
    23
    -            }
    
    24
    -        </style>
    
    25
    -        [% INCLUDE togglecontent.js %]
    
    26
    -    </head>
    
    27
    -    <body>
    
    28
    -        <h1>Tor Browser Rebase Test Reports: [% title %]</h1>
    
    29
    -        [% FOREACH report IN reports_list %]
    
    30
    -        [%
    
    31
    -          SET tbbfiles = reports.$report.tbbfiles;
    
    32
    -          SET tbbfile = reports.$report.tbbfiles.keys.0;
    
    33
    -        %]
    
    34
    -        <ul>
    
    35
    -            <li><a href="r/[% report %]/[% tbbfile %].html">Details</a></li>
    
    36
    -        </ul>
    
    37
    -        <hr />
    
    38
    -        [% END %]
    
    39
    -    </body>
    
    40
    -</html>

  • tools/paganini-builds deleted
    1
    -#!/bin/sh
    
    2
    -cd $(dirname $0)/..
    
    3
    -./tools/pull
    
    4
    -export RBM_BUILDNAME=nightly
    
    5
    -./tbb-testsuite --config=tor-mail_build "$@"
    
    6
    -./tbb-testsuite --config=tor-messenger_build "$@"

  • tools/run-tests-virustotal deleted
    1
    -#!/bin/sh
    
    2
    -cd $(dirname $0)/..
    
    3
    -./tools/pull
    
    4
    -./tbb-testsuite --config=release-virustotal "$@"
    
    5
    -./tbb-testsuite --config=linus-nightly-virustotal "$@"