Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos-test-driver: allow configuration of net frontend and backend #65212

Merged
merged 1 commit into from Jul 22, 2019

Conversation

thefloweringash
Copy link
Member

When IPXE tests were added, an option was added for configuring only
the frontend, and the backend configuration was dropped entirely. This
caused most installer tests to fail.

Motivation for this change

Restore installer tests.

Tested:

  • tests.installer.simple.x86_64-linux
  • tests.boot.biosNetboot.x86_64-linux
  • tests.boot.uefiNetboot.x86_64-linux
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

When IPXE tests were added, an option was added for configuring only
the frontend, and the backend configuration was dropped entirely. This
caused most installer tests to fail.
@abbradar
Copy link
Member

That's strange; I checked my changes and there wasn't a frontend configuration before. I also grepped for net user and netdev and nothing in installer tests comes up. So - how did it work before?

@samueldr
Copy link
Member

Adding more context:

@cleverca22 bisected to 81d35a9 for the first commit making tests fail for tested. The failures happen for non-PXE tests.

@abbradar
Copy link
Member

Thanks, I'm testing it now! I'll also investigate how did it break things, I feel I misunderstand something about qemu options.

@thefloweringash
Copy link
Member Author

how did it work before?

The Qemu wiki has a page on Networking which explains things better than I can, but the super short version is: the old command line used the legacy option -net nic,... to configure both frontend and backend. Specifying just -device TYPE,netdev=net0 is defining a frontend for a non-existent backend net0. The netboot tests passed by defining the corresponding backend with -netdev user,id=net0,....

@cleverca22
Copy link
Contributor

nix-build nixos/release.nix -A tests.bittorrent.x86_64-linux

this is one of the tests that involves multiple network devices in qemu, to setup a full router with upnp, and then test torrents going thru it

the test fails on my end, on rev 771985dd3091fdd216060ec154b8094ac31a497b
cause not clear yet

@thefloweringash
Copy link
Member Author

That test is passing for me, I've uploaded my log to a gist.

@abbradar
Copy link
Member

@thefloweringash I see, -net nic automatically creates a hub and that's why it only issues a warning when no backend is specified. I assumed the same behavior happens with new options but it turns out they require a backend.

I also misunderstood how tests work - Machine.pm default arguments aren't usually used, instead NixOS testing harness passes a script built by qemu-vm.nix which has its own set of qemu arguments. That's why other random tests that I tried succeeded - I needed to explicitly test ones that use createMachine.

@abbradar
Copy link
Member

Ran the same tests (installer and netboot), they succeed for me.

@cleverca22 BitTorrent test succeeds for me on this revision, there may be test flakiness in motion. Can you post your log?

Let's merge; this blocks master.

@abbradar abbradar merged commit d214475 into NixOS:master Jul 22, 2019
@abbradar abbradar mentioned this pull request Jul 22, 2019
10 tasks
@thefloweringash thefloweringash deleted the installer-tests branch July 22, 2019 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants