From 61fd315b420f8bb87bb1c867d556227b2fd46e17 Mon Sep 17 00:00:00 2001 From: Felix Stupp <felix.stupp@banananet.work> Date: Sat, 31 Aug 2024 14:18:42 +0000 Subject: [PATCH] nixos/manual: add hint to interactive testing about Internet access verified with following minimal test, embedded in a flake for ease of execution: ```nix { inputs.nixpkgs.url = "github:NixOS/nixpkgs/master"; outputs = { nixpkgs, ... }: let pkgs = import nixpkgs { system = "x86_64-linux"; }; in { nixosTests.x86_64-linux.internet = pkgs.nixosTest { name = "internet"; nodes.machine = { }; # only succeeds in interactive mode testScript = '' machine.wait_for_unit("default.target") print(machine.succeed("curl -4 https://nixos.org")) ''; }; }; } ``` Launch this test interactively as described in the manual & run `test_script()` to verify that the VM has Internet access. --- .../running-nixos-tests-interactively.section.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/doc/manual/development/running-nixos-tests-interactively.section.md b/nixos/doc/manual/development/running-nixos-tests-interactively.section.md index 422dbf174ad568..b65cab9922530d 100644 --- a/nixos/doc/manual/development/running-nixos-tests-interactively.section.md +++ b/nixos/doc/manual/development/running-nixos-tests-interactively.section.md @@ -10,6 +10,12 @@ $ ./result/bin/nixos-test-driver >>> ``` +::: {.note} +By executing the test driver in this way, +the VMs executed may gain network & Internet access via their backdoor control interface, +typically recognized as `eth0`. +::: + You can then take any Python statement, e.g. ```py