Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
30 lines
771 B
Nix
30 lines
771 B
Nix
# Test for NixOS' container nesting.
|
|
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
|
name = "nested";
|
|
|
|
meta = with pkgs.lib.maintainers; { maintainers = [ sorki ]; };
|
|
|
|
nodes.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"
|
|
)
|
|
)
|
|
'';
|
|
})
|
|
|