@@ -50,6 +50,7 @@ BEGIN {
store_runvar get_runvar get_runvar_maybe
get_runvar_default need_runvars
unique_incrementing_runvar next_unique_name
+ stashfilecontents
target_cmd_root target_cmd target_cmd_build
target_cmd_output_root target_cmd_output
@@ -520,6 +521,16 @@ sub target_putfilecontents_root_stash ($$$$;$) {
tpfcs_core(\&target_putfile_root, @_);
}
+sub stashfilecontents ($$;$) {
+ my ($filedata,$leafbase, $leafref) = @_;
+ # returns full pathname
+ $$leafref = $leafbase;
+ my $fh = open_unique_stashfile($leafref);
+ print $fh $filedata or die "$$leafref: $!";
+ close $fh or die "$$leafref: $!";
+ return "$stash/$$leafref";
+}
+
sub target_file_exists ($$) {
my ($ho,$rfile) = @_;
my $out= target_cmd_output($ho, "if test -e $rfile; then echo y; fi");
Like target_putfilecontents_* but for files on controller. No callers yet. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> --- Osstest/TestSupport.pm | 11 +++++++++++ 1 file changed, 11 insertions(+)