summaryrefslogtreecommitdiff
path: root/selftest/target
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2019-03-14 17:38:22 +1300
committerAndrew Bartlett <abartlet@samba.org>2019-05-31 05:18:20 +0000
commitc9e62513822fa5fce9ad29c164273a2db64ff18d (patch)
tree86d12a486745b8faf25bc8def9efbe3c6b4e7cb7 /selftest/target
parent5635a7ce2fe348a3ed89ff39a02f9db135424367 (diff)
downloadsamba-c9e62513822fa5fce9ad29c164273a2db64ff18d.tar.gz
selftest: Add TESTENV_DIR "env" variable
We store the testenv directory path for the 'ctx' hashmap, but not for the testenv-vars hashmap (and that can be really annoying sometimes). Add it into the second hashmap that selftest actually keeps track of. Currently it's only stored in the hashmap, not actually exported as an environment variable (but we could easily do that if a test-case need this info). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'selftest/target')
-rwxr-xr-xselftest/target/Samba3.pm1
-rwxr-xr-xselftest/target/Samba4.pm3
2 files changed, 3 insertions, 1 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 5e28253dc4e..98863954263 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -2387,6 +2387,7 @@ force_user:x:$gid_force_user:
$ret{SMBD_TEST_LOG} = "$prefix/smbd_test.log";
$ret{SMBD_TEST_LOG_POS} = 0;
$ret{SERVERCONFFILE} = $conffile;
+ $ret{TESTENV_DIR} = $prefix_abs;
$ret{CONFIGURATION} ="-s $conffile";
$ret{LOCK_DIR} = $lockdir;
$ret{SERVER} = $server;
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 56ca8bdd809..609ff837af2 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -376,8 +376,8 @@ sub setup_dns_hub_internal($$$)
$env->{SERVER_IPV6} = Samba::get_ipv6_addr($hostname);
$env->{SOCKET_WRAPPER_DEFAULT_IFACE} = Samba::get_interface($hostname);
$env->{DNS_HUB_LOG} = "$prefix_abs/dns_hub.log";
-
$env->{RESOLV_CONF} = "$prefix_abs/resolv.conf";
+ $env->{TESTENV_DIR} = $prefix_abs;
open(RESOLV_CONF, ">$env->{RESOLV_CONF}");
print RESOLV_CONF "nameserver $env->{SERVER_IP}\n";
@@ -916,6 +916,7 @@ nogroup:x:65534:nobody
PRIVATEDIR => $ctx->{privatedir},
BINDDNSDIR => $ctx->{binddnsdir},
SERVERCONFFILE => $ctx->{smb_conf},
+ TESTENV_DIR => $ctx->{prefix_abs},
CONFIGURATION => $configuration,
SOCKET_WRAPPER_DEFAULT_IFACE => $ctx->{swiface},
NSS_WRAPPER_PASSWD => $ctx->{nsswrap_passwd},