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