Skip to content

Commit

Permalink
selftest: Add TESTENV_DIR "env" variable
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
tlbeale authored and abartlet committed May 31, 2019
1 parent 5635a7c commit c9e6251
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions selftest/target/Samba3.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion selftest/target/Samba4.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit c9e6251

Please sign in to comment.