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