Commit Graph

12 Commits

Author SHA1 Message Date
Felix Stupp
61fd315b42
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.
2024-08-31 14:40:14 +00:00
Pedro O. A. Regis
015e29a742 doc: removes extra backtick 2024-06-07 15:21:57 -03:00
Niklas Hambüchen
f9611764c6 manual: Fix QEMU_NET_OPTS VM-side address.
In my earlier commit

    manual: Don't suggest exposing VM port to local network.

I made a side change titled

    Use `127.0.0.1` also on the VM side, otherwise connections to
    services that, in the VM, bind to `127.0.0.1` only
    (doing the safe approach) do not work.

Unfortunately, that was wrong:

QEMU inside the VM always communicates via the virtualised
Ethernet interface, not via the VM's loopback interface.
So trying to connect to `127.0.0.1` on the VM's side cannot work.
2023-11-11 15:40:55 +01:00
Niklas Hambüchen
dcceeb9868 manual: tests: Describe how to port-forward into test VMs 2023-11-10 22:29:12 +01:00
Jörg Thalheim
29db54c373 nixos/tests: extend shell_interact to accept alternative socat addresses
`shell_interact()` is currently not nice to use.  If you try to cancel
the socat process, it will also break the nixos test. Furthermore
ptpython creates it's own terminal that subprocesses are running in,
which breaks some of the terminal features of socat.
Hence this commit extends `shell_interact` to allow also to connect to
arbitrary servers i.e. tcp servers started by socat.
2023-01-27 13:09:25 +01:00
Robert Hensing
216c5dc10d nixos/doc: Disambiguate test option ids
Changing this later on would break external links into the manual.
2022-09-29 12:41:59 +02:00
Robert Hensing
7cdc9bc340 nixos/testing: Improve interactive docs 2022-09-24 17:42:52 +01:00
Robert Hensing
6e2f753989 nixos/doc/running-nixos-tests-interactively: Describe interactive option 2022-09-24 17:38:08 +01:00
Marijan Petričević
d590556d5c update docs 2022-01-26 10:46:46 +01:00
Patrick Hilhorst
d4dc638d77
nixos/test-driver: also passthru driverInteractive 2022-01-04 14:52:37 +01:00
David Arnold
926fb93968
nixos/tests/test-driver: normalise test driver entrypoint(s)
Previously the driver was configured exclusively through convoluted
environment variables.

Now the driver's defaults are configured through env variables.

Some additional concerns are in the github comments of this PR.
2021-08-05 19:07:11 -05:00
Bobby Rong
47fe2c7e93 nixos: nixos/doc/manual/development/running-nixos-tests-interactively.xml to CommonMark 2021-07-02 20:24:02 +08:00