Merge master into staging-next

This commit is contained in:
github-actions[bot]
2021-02-06 12:19:10 +00:00
committed by GitHub
22 changed files with 97 additions and 317 deletions
+21 -29
View File
@@ -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 = "";
})