summary refs log tree commit diff
path: root/nixos/lib/testing.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-16 11:36:09 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-16 11:37:38 +0200
commit6dafee8d6704957e123de1b51d3e406848f4aac8 (patch)
treea91bacfa73d9fd189d82fa9030b12a8af7a8dec0 /nixos/lib/testing.nix
parente0db0aaa4d4a9169b5e1f4d1d6e23d6dffc5d0ab (diff)
downloadnixlib-6dafee8d6704957e123de1b51d3e406848f4aac8.tar
nixlib-6dafee8d6704957e123de1b51d3e406848f4aac8.tar.gz
nixlib-6dafee8d6704957e123de1b51d3e406848f4aac8.tar.bz2
nixlib-6dafee8d6704957e123de1b51d3e406848f4aac8.tar.lz
nixlib-6dafee8d6704957e123de1b51d3e406848f4aac8.tar.xz
nixlib-6dafee8d6704957e123de1b51d3e406848f4aac8.tar.zst
nixlib-6dafee8d6704957e123de1b51d3e406848f4aac8.zip
Fix runInMachine
It requires a writable /nix/store to store the build result.  Also,
wait until we've reached multi-user.target before doing the build, and
do a sync at the end to ensure all data to $out is properly written.

http://hydra.nixos.org/build/6496716
Diffstat (limited to 'nixos/lib/testing.nix')
-rw-r--r--nixos/lib/testing.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/nixos/lib/testing.nix b/nixos/lib/testing.nix
index 7be0903ed3a8..3407229e921a 100644
--- a/nixos/lib/testing.nix
+++ b/nixos/lib/testing.nix
@@ -176,7 +176,10 @@ rec {
     let
       vm = buildVM { }
         [ machine
-          { key = "hostname"; networking.hostName = "client"; }
+          { key = "run-in-machine";
+            networking.hostName = "client";
+            nix.readOnlyStore = false;
+          }
         ];
 
       buildrunner = writeText "vm-build" ''
@@ -192,9 +195,11 @@ rec {
 
       testscript = ''
         startAll;
+        $client->waitForUnit("multi-user.target");
         ${preBuild}
         $client->succeed("env -i ${pkgs.bash}/bin/bash ${buildrunner} /tmp/xchg/saved-env >&2");
         ${postBuild}
+        $client->succeed("sync"); # flush all data before pulling the plug
       '';
 
       vmRunCommand = writeText "vm-run" ''