If no locally cached API cert is available, download one and use it throughout all of the tests. Speed-up factor is ~3x. Change-Id: I083985f4e4ec7d8f7f4e0beec3a604be80a4bb59changes/31/12131/2
parent
f4bfa5e555
commit
d117dc39c7
Binary file not shown.
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use Data::Dumper;
|
||||
use File::Slurp qw/read_file/;
|
||||
use IO::Uncompress::Unzip qw/unzip/;
|
||||
|
||||
my $zip = read_file("keys.zip");
|
||||
my $z = IO::Uncompress::Unzip->new(\$zip, MultiStream => 0, Append => 1);
|
||||
|
||||
my $data;
|
||||
while(!$z->eof() && (my $hdr = $z->getHeaderInfo())) {
|
||||
print "+++ found $$hdr{Name}\n";
|
||||
unless($hdr->{Name} =~ /\.pem$/) {
|
||||
# wrong file, just read stream, clear buffer and try next
|
||||
while($z->read($data) > 0) {};
|
||||
$data = undef;
|
||||
$z->nextStream();
|
||||
next;
|
||||
}
|
||||
|
||||
# got our pem file
|
||||
while($z->read($data) > 0) {}
|
||||
last;
|
||||
}
|
||||
$z->close();
|
||||
unless($data) {
|
||||
die "no PEM file found\n";
|
||||
}
|
||||
|
||||
open my $fh, ">:raw", "/tmp/out.zip";
|
||||
print $fh $data;
|
||||
close $fh;
|
Loading…
Reference in new issue