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
nixosTests.virtualbox: Port to python #94858
Conversation
@@ -205,96 +205,105 @@ let | |||
}; | |||
|
|||
testSubs = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -314,10 +323,10 @@ let | |||
${pkgs.dhcp}/bin/dhclient \ | |||
-lf /run/dhcp.leases \ | |||
-pf /run/dhclient.pid \ | |||
-v eth0 eth1 | |||
-v enp0s3 enp0s8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
||
otherIP="$(${pkgs.netcat}/bin/nc -l 1234 || :)" | ||
${pkgs.iputils}/bin/ping -I eth1 -c1 "$otherIP" | ||
${pkgs.iputils}/bin/ping -I enp0s8 -c1 "$otherIP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
@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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-hostonlyif
test in the first commit.cc @blitz since you said you were also working on this.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)