summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-03-27 04:15:44 +0200
committeraszlig <aszlig@redmoonstudios.org>2017-03-27 04:53:17 +0200
commitee39d4b98a285bb2812c6e6ab51f4038ac013173 (patch)
tree02c950e7932ca3635c6886c2bc65620781c5d6ce /nixos
parentc46600d47b12ba81f8cc88dc4240ac58cad467f3 (diff)
downloadnixlib-ee39d4b98a285bb2812c6e6ab51f4038ac013173.tar
nixlib-ee39d4b98a285bb2812c6e6ab51f4038ac013173.tar.gz
nixlib-ee39d4b98a285bb2812c6e6ab51f4038ac013173.tar.bz2
nixlib-ee39d4b98a285bb2812c6e6ab51f4038ac013173.tar.lz
nixlib-ee39d4b98a285bb2812c6e6ab51f4038ac013173.tar.xz
nixlib-ee39d4b98a285bb2812c6e6ab51f4038ac013173.tar.zst
nixlib-ee39d4b98a285bb2812c6e6ab51f4038ac013173.zip
nixos/tests/virtualbox: Fix @shell@ expansion
This has surfaced since f803270b7e00fa7124282809838d5652083b6aad.

The commit bumped bash to version 4.4, which caused to change the order
of --subst-var flags in substituteAll, which this test was relying on,
because it added a @shell@ to boot.initrd.postMountCommands.

Our substituter is currently working a bit like this:

original.replace('@var1@', 'val1').replace('@var2@', 'val2')...

Unfortunately, this means that if @var2@ occurs within @var1@ it is
replaced by the new value, so the order of the substvars actually
matter. I highly doubt that we want a behaviour like this and I'm
wondering why it didn't occur to me as a problem while writing the
initial implementation of the VirtualBox tests.

Whether to get rid of this and disallowing substitution of substvars
within substvars is another topic which I think needs discussion in a
different place.

As for now, I'm using stdenv.shell, because the closure size of this
should fit within the initrd, so it's fine especially because it's just
a test.

Tested with the net-hostonlyif and systemd-detect-virt tests and they
both succeed with this change.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Reported-by: @globin on IRC
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/virtualbox.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/tests/virtualbox.nix b/nixos/tests/virtualbox.nix
index 376c4f21dc04..4f7cb176d96f 100644
--- a/nixos/tests/virtualbox.nix
+++ b/nixos/tests/virtualbox.nix
@@ -65,7 +65,7 @@ let
       touch /mnt-root/boot-done
       hostname "${vmName}"
       mkdir -p /nix/store
-      unshare -m "@shell@" -c '
+      unshare -m ${escapeShellArg pkgs.stdenv.shell} -c '
         mount -t vboxsf nixstore /nix/store
         exec "$stage2Init"
       '