2021-02-24 16:02:57 +03:00
|
|
|
# Test for NixOS' container nesting.
|
|
|
|
|
|
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
|
|
|
name = "nested";
|
|
|
|
|
|
|
|
meta = with pkgs.lib.maintainers; { maintainers = [ sorki ]; };
|
|
|
|
|
2022-03-21 02:15:30 +03:00
|
|
|
nodes.machine = { lib, ... }:
|
2021-02-24 16:02:57 +03:00
|
|
|
let
|
|
|
|
makeNested = subConf: {
|
|
|
|
containers.nested = {
|
|
|
|
autoStart = true;
|
|
|
|
privateNetwork = true;
|
|
|
|
config = subConf;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in makeNested (makeNested { });
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.start()
|
|
|
|
machine.wait_for_unit("container@nested.service")
|
|
|
|
machine.succeed("systemd-run --pty --machine=nested -- machinectl list | grep nested")
|
|
|
|
print(
|
|
|
|
machine.succeed(
|
|
|
|
"systemd-run --pty --machine=nested -- systemd-run --pty --machine=nested -- systemctl status"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
|