mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-10 17:54:53 +01:00
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.
|
||
|---|---|---|
| .. | ||
| activation-script.section.md | ||
| assertions.section.md | ||
| bootspec.chapter.md | ||
| building-parts.chapter.md | ||
| developing-the-test-driver.chapter.md | ||
| development.md | ||
| etc-overlay.section.md | ||
| freeform-modules.section.md | ||
| importing-modules.section.md | ||
| linking-nixos-tests-to-packages.section.md | ||
| meta-attributes.section.md | ||
| nixos-tests.chapter.md | ||
| non-switchable-systems.section.md | ||
| option-declarations.section.md | ||
| option-def.section.md | ||
| option-types.section.md | ||
| replace-modules.section.md | ||
| running-nixos-tests-interactively.section.md | ||
| running-nixos-tests.section.md | ||
| settings-options.section.md | ||
| sources.chapter.md | ||
| testing-installer.chapter.md | ||
| unit-handling.section.md | ||
| what-happens-during-a-system-switch.chapter.md | ||
| writing-documentation.chapter.md | ||
| writing-modules.chapter.md | ||
| writing-nixos-tests.section.md | ||