selftest: Add common function to return cmd environment variables
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 30 Jan 2019 03:31:40 +0000 (16:31 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 18 Feb 2019 04:42:09 +0000 (05:42 +0100)
commit8f9bb790bc3b2f587267b9ec01be603b4082e39e
treefff6d923850a0826ba0b478087c1aac7bcf68d87
parenta87660b3c47e5bb362a89ad83f7deb2c8306aa24
selftest: Add common function to return cmd environment variables

We prefix samba-tool commands with a bunch of WRAPPER/CONF environment
variables, in order for the command to work properly. These variables
are duplicated all over the place in the selftest code. This patch adds
a helper function to return the variables, so we can reduce the required
code down to a single line in a lot of places.

A couple of exceptions I've left alone:
- drs replicate, which omits the RESOLV_WRAPPER_CONF/_HOSTS variables
  (I'm not sure whether that's deliberate or not).
- create_backup(), which uses the backupfromdc's krb5.conf rather than
  the new testenv.

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