nixosTests.containers-nested: init
This commit is contained in:
parent
fc2fa3cda5
commit
d23ba22076
|
@ -74,6 +74,7 @@ in
|
||||||
containers-ip = handleTest ./containers-ip.nix {};
|
containers-ip = handleTest ./containers-ip.nix {};
|
||||||
containers-macvlans = handleTest ./containers-macvlans.nix {};
|
containers-macvlans = handleTest ./containers-macvlans.nix {};
|
||||||
containers-names = handleTest ./containers-names.nix {};
|
containers-names = handleTest ./containers-names.nix {};
|
||||||
|
containers-nested = handleTest ./containers-nested.nix {};
|
||||||
containers-physical_interfaces = handleTest ./containers-physical_interfaces.nix {};
|
containers-physical_interfaces = handleTest ./containers-physical_interfaces.nix {};
|
||||||
containers-portforward = handleTest ./containers-portforward.nix {};
|
containers-portforward = handleTest ./containers-portforward.nix {};
|
||||||
containers-reloadable = handleTest ./containers-reloadable.nix {};
|
containers-reloadable = handleTest ./containers-reloadable.nix {};
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
# 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"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue