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

Bug 20949: Fix some cases where testsuite is not run automatically

Check the gpg signature of sha256sums.txt and that a bundle is complete
before starting to test it (instead of failing and not trying uploads
from other users).
parent 3b2aff20
......@@ -6,6 +6,7 @@ use FindBin;
use TBBTestSuite::Common qw(exit_error);
use Cwd qw(getcwd);
use File::Slurp;
use File::Temp;
use IO::CaptureOutput qw(capture_exec);
use LWP::Simple;
use Digest::SHA qw(sha256_hex);
......@@ -98,6 +99,7 @@ sub branch_list {
sub latest_builds {
$options = shift;
my $build_done = shift // sub { 0; };
my @res;
git_clone_pull;
set_gpgwrapper;
......@@ -105,20 +107,37 @@ sub latest_builds {
foreach my $branch (branch_list) {
my ($version, $build) = latest_tagged_version($branch, $two_weeks_ago);
next unless $version;
foreach my $user (@tbb_builders) {
my $buildname;
USER: foreach my $user (@tbb_builders) {
my $buildname = "$version-$build";
my $url = "https://people.torproject.org/~$user/builds/$version-$build/sha256sums-unsigned-build.txt";
my $sha = get($url);
next unless $sha;
next unless head("$url.asc");
$buildname = "$version-$build";
push @res, {
my $build_infos = {
buildname => $buildname,
version => $version,
build => $build,
url => $url,
user => $user,
};
next if $build_done->($build_infos);
my $sha = get($url);
next unless $sha;
my $sha_sig = get("$url.asc");
next unless $sha_sig;
my $sha_file = File::Temp->new;
write_file($sha_file, $sha);
my $sha_sig_file = File::Temp->new;
write_file($sha_sig_file, $sha_sig);
my (undef, undef, $success) = capture_exec('gpg', '--no-default-keyring',
'--keyring', "$FindBin::Bin/keyring/$user.gpg", '--keyring',
"$FindBin::Bin/keyring/torbrowser.gpg", '--verify',
'--', $sha_sig_file, $sha_file);
next unless $success;
foreach my $file (split "\n", $sha) {
(undef, $file) = split ' ', $file;
chomp $file;
my $file_url = "https://people.torproject.org/~$user/builds/$version-$build/$file";
next USER unless head($file_url);
}
push @res, $build_infos;
}
}
return @res;
......
......@@ -8,7 +8,13 @@ use TBBTestSuite::Tests::Command qw(file_known_issue);
my $system_infos = TBBTestSuite::Common::system_infos;
my $osname = $system_infos->{osname} . '-' . $system_infos->{arch};
my @latest_builds = TBBTestSuite::TBBVersion::latest_builds($options);
my $build_done = sub {
my ($build_infos) = @_;
my $name = "$build_infos->{buildname}-$osname";
return -d "$options->{'reports-dir'}/r/$name";
};
my @latest_builds = TBBTestSuite::TBBVersion::latest_builds($options, $build_done);
foreach my $build (@latest_builds) {
my $name = "$build->{buildname}-$osname";
next if -d "$options->{'reports-dir'}/r/$name";
......
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