summary refs log tree commit diff
path: root/nixos/tests/containers-custom-pkgs.nix
diff options
context:
space:
mode:
authorErik Arvstedt <erik.arvstedt@gmail.com>2020-12-15 20:24:57 +0100
committerErik Arvstedt <erik.arvstedt@gmail.com>2020-12-15 20:25:58 +0100
commit34fcfc880bdc3c23c936e7b4d19bd0a93558d8f1 (patch)
tree376e1d66c511a6ce065fa84289c6548bf2c16d6b /nixos/tests/containers-custom-pkgs.nix
parent85fa47d04b0f9ec5bfefcb0ac66f68e319d7daae (diff)
downloadnixpkgs-34fcfc880bdc3c23c936e7b4d19bd0a93558d8f1.tar
nixpkgs-34fcfc880bdc3c23c936e7b4d19bd0a93558d8f1.tar.gz
nixpkgs-34fcfc880bdc3c23c936e7b4d19bd0a93558d8f1.tar.bz2
nixpkgs-34fcfc880bdc3c23c936e7b4d19bd0a93558d8f1.tar.lz
nixpkgs-34fcfc880bdc3c23c936e7b4d19bd0a93558d8f1.tar.xz
nixpkgs-34fcfc880bdc3c23c936e7b4d19bd0a93558d8f1.tar.zst
nixpkgs-34fcfc880bdc3c23c936e7b4d19bd0a93558d8f1.zip
tests/containers-custom-pkgs: improve test
- Fix name
- Remove unneeded leftovers that were copied from containers-hosts.nix
- Remove redundant 'start_all()'
Diffstat (limited to 'nixos/tests/containers-custom-pkgs.nix')
-rw-r--r--nixos/tests/containers-custom-pkgs.nix31
1 files changed, 11 insertions, 20 deletions
diff --git a/nixos/tests/containers-custom-pkgs.nix b/nixos/tests/containers-custom-pkgs.nix
index 397a4a905e6..47509892e52 100644
--- a/nixos/tests/containers-custom-pkgs.nix
+++ b/nixos/tests/containers-custom-pkgs.nix
@@ -1,5 +1,3 @@
-# Test for NixOS' container support.
-
 import ./make-test-python.nix ({ pkgs, lib, ...} : let
 
   customPkgs = pkgs // {
@@ -9,34 +7,27 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : let
   };
 
 in {
-  name = "containers-hosts";
+  name = "containers-custom-pkgs";
   meta = with lib.maintainers; {
     maintainers = [ adisbladis ];
   };
 
-  machine =
-    { ... }:
-    {
-      virtualisation.memorySize = 256;
-      virtualisation.vlans = [];
-
-      containers.simple = {
-        autoStart = true;
-        pkgs = customPkgs;
-        config = {pkgs, config, ... }: {
-          environment.systemPackages = [
-            pkgs.hello
-          ];
-        };
+  machine = { ... }: {
+    containers.test = {
+      autoStart = true;
+      pkgs = customPkgs;
+      config = {pkgs, config, ... }: {
+        environment.systemPackages = [
+          pkgs.hello
+        ];
       };
-
     };
+  };
 
   testScript = ''
-    start_all()
     machine.wait_for_unit("default.target")
     machine.succeed(
-        "test $(nixos-container run simple -- readlink -f /run/current-system/sw/bin/hello) = ${customPkgs.hello}/bin/hello"
+        "test $(nixos-container run test -- readlink -f /run/current-system/sw/bin/hello) = ${customPkgs.hello}/bin/hello"
     )
   '';
 })