nixosTests.virtualbox: Port to python#94858
Conversation
nixos/tests/virtualbox.nix
Outdated
There was a problem hiding this comment.
This is pretty ugly and the reason why I used the name attribute back then was to work around lack of serialisation. With Python however, json is part of the kitchen sink, so we can simply toJSON the attributes above.
There was a problem hiding this comment.
I felt that it would be more appropriate to keep this a simple port/translation rather than start refactoring. I can change this to use a dict, though, if you prefer?
There was a problem hiding this comment.
I would also make this as much of a 1:1 translation as possible for the time being.
There was a problem hiding this comment.
I am generally also in favor of starting with a 1:1 translation generally. but @aszlig's suggestion is too good to not do it right now.
nixos/tests/virtualbox.nix
Outdated
There was a problem hiding this comment.
Note that this should be inside the guest without systemd, so there shouldn't be predictable interface names. Did you actually test this?
There was a problem hiding this comment.
Stage 1 runs udev, which renames the interfaces, so it seems something has changed along the way.
However, I realized this can be changed to just networking.usePredictableInterfaceNames = false in testVMConfig above. I’ll go ahead and do that.
nixos/tests/virtualbox.nix
Outdated
|
@liff Awesome that you took this on! I wouldn't worry too much about 32-bit tests. If 64-bit guests work with nested virtualization enabled on the host, I'm good. (This should be the default since Linux 5.1) @flokli I'm without a laptop for a week. Maybe @tfc can find someone to review in the meantime. |
b805580 to
5f5c990
Compare
|
@tfc can you take a look at this? |
|
This worked for me on the second try. On the first one of the tests hung on shutting down the VM. (This also happened to me for the Perl tests IIRC). |
|
This also worked for me on the second try: |
blitz
left a comment
There was a problem hiding this comment.
I think this is an excellent first step towards rescuing this important test. We can improve on it later on to make it more reliable.
I'm personally in favor of using the 64-bit / nested KVM options by default, but that can be a different PR.
|
For some reason this both stalls on my Intel Laptop, as well as AMD workstation, even after multiple tries. On the workstation, I also saw some resets of the (virtual) ATA port in the guests' dmesg: I also tried toggling |
|
Apparently I had more luck with Let's merge this, we can improve these things later. |
|
Thanks a lot for all the work! |
Motivation for this change
Making progress on #72828.
I can only get these to run with
use64bitGuest=true. The 32-bit VMs just boot very slowly and then stall completely. Not sure if this makes these tests broken?Includes a fix for network interface names in
net-hostonlyiftest in the first commit.cc @blitz since you said you were also working on this.
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)