selftest: Rework setting env variables for other forked binaries
authorTim Beale <timbeale@catalyst.net.nz>
Thu, 23 May 2019 03:47:46 +0000 (15:47 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 24 May 2019 03:19:17 +0000 (03:19 +0000)
commit746e137777e559afb7851a359d56580c58231ddd
treec078014a00b5e6508b7ad49afbd86f04bf2b94e2
parentae3e33d492904ae05d4ff24c3d8f50fecaca2971
selftest: Rework setting env variables for other forked binaries

Final refactor to merge the fork-and-exec code into a common function.

We can now use $daemon_ctx{ENV_VARS} to customize differences between
the forked binaries:
- samba: add in extra env variables on top of the defaults.
- dns_hub: there are no ENV variables we need to export.
- winbindd/smbd: these use the defaults, so they pass through an
undefined $daemon_ctx{ENV_VARS} (purely to make the code common across
all 5 places).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/target/Samba3.pm
selftest/target/Samba4.pm