[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 37/62] TestSupport: Provide target_getfile_root_stash



This convenient function selects a local filename based on a target
filename, and copies the target file to the selected stash file.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index a5870e4d..ec867e4f 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -61,6 +61,7 @@ BEGIN {
                       target_cmd_inputfh_root sshuho
                       target_getfile target_getfile_root
                       target_putfile target_putfile_root
+                     target_getfile_root_stash
                       target_putfilecontents_stash
                      target_putfilecontents_root_stash
                       target_put_guest_image target_editfile
@@ -553,6 +554,14 @@ sub target_getfile_root ($$$$) {
     my ($ho,$timeout, $rsrc,$ldst) = @_;
     tgetfileex('root', @_);
 }
+sub target_getfile_root_stash ($$$;$) {
+    my ($ho,$timeout,$rsrc, $lleaf) = @_; # => full path of local file
+    target_somefile_leaf(\$lleaf, $rsrc, $ho);
+    open_unique_stashfile(\$lleaf); # discard filehandle, leave file
+    my $lfile = "$stash/$lleaf";
+    target_getfile_root($ho,$timeout,$rsrc,$lfile);
+    return $lfile;
+}
 
 sub tputfileex {
     my ($ruser, $ho,$timeout, $lsrc,$rdst, $rsync) = @_;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.