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

Add a browserbundle_virustotal testsuite type

parent 12f40dab
......@@ -55,6 +55,11 @@ our %testsuite = (
post_tests => \&post_tests,
);
our %testsuite_virustotal = (
%testsuite,
description => 'Tor Browser Bundle Virustotal checks',
);
our @tests = (
{
name => 'readelf_RELRO',
......@@ -161,11 +166,6 @@ our @tests = (
use_default_config => 1,
no_kill => 1,
},
{
name => 'virustotal',
type => 'virustotal',
descr => 'Analyze files on virustotal.com',
},
{
name => 'screenshots',
type => 'mozmill',
......@@ -308,16 +308,27 @@ sub tbb_filename_infos {
my (undef, undef, $file) = File::Spec->splitpath($tbbfile);
my %res = (filename => $file, tbbfile => $tbbfile);
if ($file =~ m/^tor-browser-linux(..)-([^_]+)_(.+)\.tar\.xz$/) {
@res{qw(type os version language)} = ('browserbundle', 'Linux', $2, $3);
@res{qw(os version language)} = ('Linux', $2, $3);
$res{arch} = $1 eq '64' ? 'x86_64' : 'x86';
} elsif ($file =~ m/^torbrowser-install-([^_]+)_(.+)\.exe$/) {
@res{qw(type os arch version language)} =
('browserbundle', 'Windows', 'x86', $1, $2);
@res{qw(os arch version language)} = ('Windows', 'x86', $1, $2);
} elsif ($file =~ m/^TorBrowserBundle-(.+)-osx32_(.+)\.zip$/) {
@res{qw(type os arch version language)} =
('browserbundle', 'MacOSX', 'x86', $1, $2);
@res{qw(os arch version language)} = ('MacOSX', 'x86', $1, $2);
} else {
return undef;
}
if ($options->{virustotal}) {
$res{type} = 'browserbundle_virustotal';
$res{tests} = [
{
name => 'virustotal',
type => 'virustotal',
descr => 'Analyze files on virustotal.com',
},
];
} else {
$res{type} = 'Unknown';
$res{type} = 'browserbundle';
$res{tests} = [ map { { %$_ } } @tests ];
}
return \%res;
}
......
......@@ -19,6 +19,7 @@ use TBBTestSuite::XServer qw(set_Xmode);
our %testsuite_types = (
browserunit => \%TBBTestSuite::BrowserUnitTests::testsuite,
browserbundle => \%TBBTestSuite::BrowserBundleTests::testsuite,
browserbundle_virustotal => \%TBBTestSuite::BrowserBundleTests::testsuite_virustotal,
);
sub run_tests {
......@@ -122,8 +123,7 @@ sub test_by_name {
sub matching_tbbfile {
my $o = tbb_filename_infos($_[0]);
return $o->{type} eq 'browserbundle' && $o->{os} eq $options->{os}
&& $o->{arch} eq $options->{arch};
return $o && $o->{os} eq $options->{os} && $o->{arch} eq $options->{arch};
}
sub check_gpgsig {
......
......@@ -119,8 +119,8 @@ Available options
you are currently running.
--virustotal::
Enable upload of files for analysis on virustotal.com. It is
disabled by default.
Enable upload of files for analysis on virustotal.com instead
of the regular testsuite.
--email-from::
Set the From header that will be used when sending reports by
......
reports_index_browserbundle.html
\ No newline at end of file
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