1# Test for NixOS' container nesting.
2
3import ./make-test-python.nix ({ pkgs, ... }: {
4 name = "nested";
5
6 meta = with pkgs.lib.maintainers; { maintainers = [ sorki ]; };
7
8 nodes.machine = { lib, ... }:
9 let
10 makeNested = subConf: {
11 containers.nested = {
12 autoStart = true;
13 privateNetwork = true;
14 config = subConf;
15 };
16 };
17 in makeNested (makeNested { });
18
19 testScript = ''
20 machine.start()
21 machine.wait_for_unit("container@nested.service")
22 machine.succeed("systemd-run --pty --machine=nested -- machinectl list | grep nested")
23 print(
24 machine.succeed(
25 "systemd-run --pty --machine=nested -- systemd-run --pty --machine=nested -- systemctl status"
26 )
27 )
28 '';
29})
30