From d192ba4e0bd82020ca0f34c620a64e616378524c Mon Sep 17 00:00:00 2001 From: Tim Beale Date: Tue, 26 Feb 2019 15:52:28 +1300 Subject: [PATCH] selftest: Add helper function to create exports file for a testenv This writes out the environment variables that are normally setup in the testenv xterm to a file. This allows them to be sourced later. This function is currently unused. However, it provides an alternative replacement for the selftest-vars.sh script (which is really out of date). I do plan to make use of this function in a subsequent patch-set. Signed-off-by: Tim Beale Reviewed-by: Andrew Bartlett --- selftest/target/Samba.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm index e13952c8256..3a2386202a6 100644 --- a/selftest/target/Samba.pm +++ b/selftest/target/Samba.pm @@ -639,4 +639,14 @@ sub export_envvars } } +sub export_envvars_to_file +{ + my ($filepath, $testenv_vars) = @_; + my $env_str = exported_envvars_str($testenv_vars); + + open(FILE, "> $filepath"); + print FILE "$env_str"; + close(FILE); +} + 1;