Merge master into staging-next
This commit is contained in:
@@ -1,42 +1,34 @@
|
||||
# Test for NixOS' container support.
|
||||
|
||||
import ./make-test-python.nix ({ pkgs, lib, ...} : let
|
||||
|
||||
customPkgs = pkgs // {
|
||||
hello = pkgs.hello.overrideAttrs(old: {
|
||||
name = "custom-hello";
|
||||
customPkgs = pkgs.appendOverlays [ (self: super: {
|
||||
hello = super.hello.overrideAttrs (old: {
|
||||
name = "custom-hello";
|
||||
});
|
||||
};
|
||||
}) ];
|
||||
|
||||
in {
|
||||
name = "containers-hosts";
|
||||
name = "containers-custom-pkgs";
|
||||
meta = with lib.maintainers; {
|
||||
maintainers = [ adisbladis ];
|
||||
maintainers = [ adisbladis earvstedt ];
|
||||
};
|
||||
|
||||
machine =
|
||||
{ ... }:
|
||||
{
|
||||
virtualisation.memorySize = 256;
|
||||
virtualisation.vlans = [];
|
||||
machine = { config, ... }: {
|
||||
assertions = let
|
||||
helloName = (builtins.head config.containers.test.config.system.extraDependencies).name;
|
||||
in [ {
|
||||
assertion = helloName == "custom-hello";
|
||||
message = "Unexpected value: ${helloName}";
|
||||
} ];
|
||||
|
||||
containers.simple = {
|
||||
autoStart = true;
|
||||
pkgs = customPkgs;
|
||||
config = {pkgs, config, ... }: {
|
||||
environment.systemPackages = [
|
||||
pkgs.hello
|
||||
];
|
||||
};
|
||||
containers.test = {
|
||||
autoStart = true;
|
||||
config = { pkgs, config, ... }: {
|
||||
nixpkgs.pkgs = customPkgs;
|
||||
system.extraDependencies = [ 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"
|
||||
)
|
||||
'';
|
||||
# This test only consists of evaluating the test machine
|
||||
testScript = "";
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user