From: Ian Campbell Date: Thu, 31 Oct 2013 16:53:14 +0000 (+0000) Subject: TestSupport: Add interface to compress stash files X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=97917477c27cac3dbed1e2cdbca66f36dd44f627;p=people%2Fdariof%2Fosstest.git TestSupport: Add interface to compress stash files Use it in ts-logs-capture Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index f4ec055..dba5cef 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -66,7 +66,7 @@ BEGIN { serial_fetch_logs propname_massage - get_stashed open_unique_stashfile + get_stashed open_unique_stashfile compress_stashed dir_identify_vcs build_clone built_stash hg_dir_revision git_dir_revision vcs_dir_revision store_revision store_vcs_revision @@ -843,6 +843,12 @@ sub get_stashed ($$) { return "$c{Stash}/$oflight/$ojob/$path"; } +sub compress_stashed($) { + my ($path) = @_; + my $r= system 'gzip','-9vf','--',"$stash/$path"; + die "$r $!" if $r; +} + #---------- other stuff ---------- sub host_reboot ($) { diff --git a/ts-logs-capture b/ts-logs-capture index 2dd95ea..a0bd936 100755 --- a/ts-logs-capture +++ b/ts-logs-capture @@ -61,10 +61,7 @@ END target_getfile_root($lho,60, $logfile,"$stash/$llogfile"); if ($logfile !~ m/\.gz$/) { stat("$stash/$llogfile") or die "$stash/$llogfile $!"; - if ((stat _)[7] > 100000) { - my $r= system 'gzip','-9vf','--',"$stash/$llogfile"; - die "$r $!" if $r; - } + compress_stashed($llogfile) if(stat _)[7] > 100000; } 1; }) {