Skip to content

Nix development

Open a Python shell in a test virtual machine

  1. Start the interactive test driver:

    nix run .#checks.x86_64-linux.<machine-name>-test.driverInteractive
    

    To exit the test driver, use the CTRL-d key combination.

  2. Start all machines:

    start_all()
    
  3. Open a Linux shell:

    machine.shell_interact()
    

How to inspect the generated Nix test script

Because the Python test script is dynamically generated via Nix string interpolation, you cannot read it directly in the host's test.nix.

To dry-run evaluate and inspect the exact compiled Python script that will be executed for a given host, run:

nix eval --raw .#checks.x86_64-linux.<hostname>-test.testScript

This will print the complete generated Python source directly to your terminal.