# Debugging NixOS tests

Tests may fail and infrastructure offers access to inspect machine state.

To prevent test from stopping and cleaning up, insert a sleep command:

    $machine->succeed("sleep 84000");

As soon as machine starts run as root:

    nix-shell -p socat --run "socat STDIO,raw,echo=0,escape=0x11 UNIX:/tmp/nix-build-vm-test-run-*.drv-0/vm-state-machine/backdoor"

You may need to find the correct path, replacing `/tmp`, `*` or `machine`.

Press "enter" to open up console and login as "root". After you're done, press "ctrl-q" to exit the console.