nixos/lib/testing: Fix unsetting $xchg
Regression introduced by 4dcb685af940efd74a7b2b66ae917129ef232d83.
Unsetting the environment variable shortly before using it is not going
to end up very well, so let's just filter out the variable from the
output of export and unset it shortly afterwards.
This fixes the runInMachine NixOS test.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
commitb4e2b6bc6aac50094dad02a01d34d0aaca7eb3f4
authoraszlig <aszlig@redmoonstudios.org>
dateSun 11 Sep 2016, 17:27 (10 years ago)
parent38ae858
nixos/lib/testing.nix+4−2
@@ -181,9 +181,11 @@ rec {
181181 eval $i2=/tmp/xchg/$_basename
182182 ${coreutils}/bin/ls -la $xchg
183183 done
184− unset i i2 _basename xchg
185184
186− export > $xchg/saved-env
185+ unset i i2 _basename
186+ export | ${gnugrep}/bin/grep -v '^xchg=' > $xchg/saved-env
187+ unset xchg
188+
187189 export tests='${testScript}'
188190 ${testDriver}/bin/nixos-test-driver ${vm.config.system.build.vm}/bin/run-*-vm
189191 ''; # */