]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
TestSupport: Add interface to compress stash files
authorIan Campbell <ian.campbell@citrix.com>
Thu, 31 Oct 2013 16:53:14 +0000 (16:53 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 31 Oct 2013 17:50:57 +0000 (17:50 +0000)
Use it in ts-logs-capture

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm
ts-logs-capture

index f4ec0557bd5e19b32c613c59da79d54b18e03ac6..dba5cef7b1207cacacbe87f251efdc04fa2376aa 100644 (file)
@@ -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 ($) {
index 2dd95ea81745277e8994c6c1288bb5806420f76a..a0bd936da1381d8dad019818630c89900250912d 100755 (executable)
@@ -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;
             }) {