selftest: Add TESTENV_DIR "env" variable
authorTim Beale <timbeale@catalyst.net.nz>
Thu, 14 Mar 2019 04:38:22 +0000 (17:38 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 31 May 2019 05:18:20 +0000 (05:18 +0000)
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>
selftest/target/Samba3.pm
selftest/target/Samba4.pm

index 5e28253dc4e2479152bc921188b9ce3b87efa118..988639542634391c9fae243c9550649d645085b0 100755 (executable)
@@ -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;
index 56ca8bdd8092954cdcd89a92c7fcb0eca33cc75b..609ff837af26060a9ff4c8edd189113873659c30 100755 (executable)
@@ -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},