mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
30 lines
765 B
Nix
30 lines
765 B
Nix
# Test for NixOS' container nesting.
|
|
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
|
name = "nested";
|
|
|
|
meta = with pkgs.lib.maintainers; { maintainers = [ sorki ]; };
|
|
|
|
machine = { lib, ... }:
|
|
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"
|
|
)
|
|
)
|
|
'';
|
|
})
|
|
|