From 9fa30d3bad80faa60e961147ca9b68a8abb46134 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 4 May 2016 19:53:43 +0200 Subject: [PATCH] nixos/tests/containers-imperative: Fix test Make sure that we always have everything available within the store of the VM, so let's evaluate/build the test container fully on the host system and propagate all dependencies to the VM. This way, even if there are additional default dependencies that come with containers in the future we should be on the safe side as these dependencies should now be included for the test as well. Signed-off-by: aszlig Cc: @kampfschlaefer, @edolstra --- nixos/tests/containers-imperative.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nixos/tests/containers-imperative.nix b/nixos/tests/containers-imperative.nix index 8d100fedf78c..81c98a56e077 100644 --- a/nixos/tests/containers-imperative.nix +++ b/nixos/tests/containers-imperative.nix @@ -7,11 +7,20 @@ import ./make-test.nix ({ pkgs, ...} : { }; machine = - { config, pkgs, ... }: + { config, pkgs, system, lib, ... }: { imports = [ ../modules/installer/cd-dvd/channel.nix ]; virtualisation.writableStore = true; virtualisation.memorySize = 768; - virtualisation.pathsInNixDB = [ pkgs.stdenv ]; + # Make sure we always have all the required dependencies for creating a + # container available within the VM, because we don't have network access. + virtualisation.pathsInNixDB = let + emptyContainer = import ../lib/eval-config.nix { + inherit (config.nixpkgs) system; + modules = lib.singleton { + containers.foo.config = {}; + }; + }; + in [ pkgs.stdenv emptyContainer.config.containers.foo.path ]; }; testScript =