]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use sub shell to isolate enviroment changes
authorMark Andrews <marka@isc.org>
Thu, 11 May 2023 02:09:26 +0000 (12:09 +1000)
committerMark Andrews <marka@isc.org>
Tue, 1 Aug 2023 23:17:15 +0000 (23:17 +0000)
'HOME=value command' should only change HOME for command but on
some platforms this occasionally sets HOME for the rest of the
test. Explicitly isolate the enviroment change using a sub shell.

bin/tests/system/resolver/tests.sh

index e06a21e12dd9e51bd4ad6911893cce9cc1ad312a..0947045dd57b78a90299cb17c304197c101352e6 100755 (executable)
@@ -470,9 +470,9 @@ n=$((n+1))
 echo_i "check that '-t aaaa' in .digrc does not have unexpected side effects ($n)"
 ret=0
 echo "-t aaaa" > .digrc
-HOME="$(pwd)" dig_with_opts @10.53.0.4 . > dig.out.1.${n} || ret=1
-HOME="$(pwd)" dig_with_opts @10.53.0.4 . A > dig.out.2.${n} || ret=1
-HOME="$(pwd)" dig_with_opts @10.53.0.4 -x 127.0.0.1 > dig.out.3.${n} || ret=1
+(HOME="$(pwd)" dig_with_opts @10.53.0.4 . > dig.out.1.${n}) || ret=1
+(HOME="$(pwd)" dig_with_opts @10.53.0.4 . A > dig.out.2.${n}) || ret=1
+(HOME="$(pwd)" dig_with_opts @10.53.0.4 -x 127.0.0.1 > dig.out.3.${n}) || ret=1
 grep ';\..*IN.*AAAA$' dig.out.1.${n} > /dev/null || ret=1
 grep ';\..*IN.*A$' dig.out.2.${n} > /dev/null || ret=1
 grep 'extra type option' dig.out.2.${n} > /dev/null && ret=1