tests/containers-custom-pkgs: improve test

- Fix name
- Remove unneeded leftovers that were copied from containers-hosts.nix
- Remove redundant 'start_all()'
This commit is contained in:
Erik Arvstedt 2020-12-15 20:24:57 +01:00
parent 85fa47d04b
commit 34fcfc880b
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -1,5 +1,3 @@
# Test for NixOS' container support.
import ./make-test-python.nix ({ pkgs, lib, ...} : let import ./make-test-python.nix ({ pkgs, lib, ...} : let
customPkgs = pkgs // { customPkgs = pkgs // {
@ -9,34 +7,27 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : let
}; };
in { in {
name = "containers-hosts"; name = "containers-custom-pkgs";
meta = with lib.maintainers; { meta = with lib.maintainers; {
maintainers = [ adisbladis ]; maintainers = [ adisbladis ];
}; };
machine = machine = { ... }: {
{ ... }: containers.test = {
{ autoStart = true;
virtualisation.memorySize = 256; pkgs = customPkgs;
virtualisation.vlans = []; config = {pkgs, config, ... }: {
environment.systemPackages = [
containers.simple = { pkgs.hello
autoStart = true; ];
pkgs = customPkgs;
config = {pkgs, config, ... }: {
environment.systemPackages = [
pkgs.hello
];
};
}; };
}; };
};
testScript = '' testScript = ''
start_all()
machine.wait_for_unit("default.target") machine.wait_for_unit("default.target")
machine.succeed( 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"
) )
''; '';
}) })