summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-08-02 05:32:39 +0200
committeraszlig <aszlig@nix.build>2018-08-02 06:00:32 +0200
commit6f5a86b189fcaaee88aa421cc7639461bb07d59e (patch)
tree9fc74eb2ac4b45f603eebc61dc514a7607724a39
parent00ab5c5b6af27850268e2cb29479fd54d67b5e02 (diff)
downloadnixlib-6f5a86b189fcaaee88aa421cc7639461bb07d59e.tar
nixlib-6f5a86b189fcaaee88aa421cc7639461bb07d59e.tar.gz
nixlib-6f5a86b189fcaaee88aa421cc7639461bb07d59e.tar.bz2
nixlib-6f5a86b189fcaaee88aa421cc7639461bb07d59e.tar.lz
nixlib-6f5a86b189fcaaee88aa421cc7639461bb07d59e.tar.xz
nixlib-6f5a86b189fcaaee88aa421cc7639461bb07d59e.tar.zst
nixlib-6f5a86b189fcaaee88aa421cc7639461bb07d59e.zip
tests/containers-imperative: Disable useSandbox
Since 4f6df27aee0a3f620d65280c7b6644d5cce094ae, nix.useSandbox defaults
to true which causes the Nix build within the containers-imperative test
to fail while trying to hardlink files into the chroot:

link("/nix/store/foo", "/nix/store/bar.drv.chroot/nix/store/foo")
   = -1 EPERM (Operation not permitted)

The reason this happens is that the hosts store is mounted using 9p and
an overlayfs is mounted on top, so even if we would disable the tmpfs
for the upper directory the hardlink would still cross filesystem
boundaries, which then fails with the above error code.

I haven't yet seen any other test which fails in a similar way, which
might be because building within VM tests is not very common and the
installer tests build in a separate store, so they're not affected.

Signed-off-by: aszlig <aszlig@nix.build>
Issue: https://github.com/NixOS/nix/issues/2324
Cc: @aristidb, @edolstra, @chaoflow, @kampfschlaefer
-rw-r--r--nixos/tests/containers-imperative.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/tests/containers-imperative.nix b/nixos/tests/containers-imperative.nix
index 93b00b5b9772..913d8bed19d0 100644
--- a/nixos/tests/containers-imperative.nix
+++ b/nixos/tests/containers-imperative.nix
@@ -9,6 +9,11 @@ import ./make-test.nix ({ pkgs, ...} : {
   machine =
     { config, pkgs, lib, ... }:
     { imports = [ ../modules/installer/cd-dvd/channel.nix ];
+
+      # XXX: Sandbox setup fails while trying to hardlink files from the host's
+      #      store file system into the prepared chroot directory.
+      nix.useSandbox = false;
+
       virtualisation.writableStore = true;
       virtualisation.memorySize = 1024;
       # Make sure we always have all the required dependencies for creating a