NixOS tests are pretty cool!

I've been fixing an issue where, if you do a deployment to a remote machine (with 'nixos-rebuild switch --target-host=foo'), and the connection would get broken off during the 'switch', the switch would be aborted - worst-case leading to that connection not getting restored.

I initially tested this manually, with the Raspberry Pi I encountered this problem with, which was elaborate and painful (especially when I got something wrong and the connection was lost). What's more, this would be useless to someone reviewing my code, as they don't have my pi sitting on their desk.

I now recreated the situation in a NixOS test, which spins up 2 VM's and exercises them with some Python code. Very smooth, and there's also an 'interactive' mode where you get access to the Python REPL and the consoles of the QEMU VM's for manual inspection and manipulation.

github.com/NixOS/nixpkgs/pull/

Also at arnout.engelen.eu/blog/nixos-t

The 'deployer' and 'target' QEMU VM consoles in interactive mode
0

If you have a fediverse account, you can quote this note from your own instance. Search https://merveilles.town/users/raboof/statuses/115740680326416143 on your instance and quote it. (Note that quoting is not supported in Mastodon.)