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