about summary refs log tree commit diff
path: root/nixos/tests/virtualbox.nix
AgeCommit message (Collapse)AuthorFilesLines
2024-02-28nixosTests.virtualbox: add happy path KVM testJulian Stecklina1-2/+28
The KVM support is still new and experimental. There is no point in doing extensive testing. Just check whether it works in general.
2024-02-28nixosTests.virtualbox: allow additional parameters for testsJulian Stecklina1-7/+10
2023-08-23nixosTests.virtualbox: fix evalAlyssa Ross1-1/+1
There's no "lib" in scope here. The test uses "with pkgs.lib;", so this failed to evaluate. Fixes: 6672dde558ea ("treewide: use optionalAttrs instead of 'else {}'")
2023-06-25treewide: use optionalAttrs instead of 'else {}'Felix Buehler1-1/+1
2023-06-02nixosTests.virtualbox: remove cdepillabout as maintainerDennis Gosnell1-1/+1
2022-11-21dbus: remove unused daemon passhtruSandro Jäckel1-2/+2
2022-06-27nixosTests.virtualbox: fix on AMDAlyssa Ross1-1/+1
2022-06-26nixosTests.virtualbox.net-hostonlyif: use dhcpcdAlyssa Ross1-5/+3
dhclient is no longer built by default in the dhcp package, so this test has been broken since that change was made. To fix, switch to dhcpcd. dhcpcd insists on writing into /var/run, so we need to ensure that exists. Fixes: a2c379d4b6d ("dhcp: make client and relay component optional")
2022-06-26nixosTests.virtualbox: fix for blocking stdoutAlyssa Ross1-1/+1
Fixes: 1640359f333 ("nixos/test-runner: Fix execute() flakiness")
2022-06-26nixosTests.virtualbox: fix logging serviceAlyssa Ross1-0/+1
This used to be StandardOutput=syslog, which was removed because syslog is deprecated, but that caused the test to fail. So bring it back, but set it to the non-deprecated "journal" value instead (which is what systemd interprets "syslog" as now anyway). Fixes: 962e15aebcc ("nixos: remove StandardOutput=syslog, StandardError=syslog lines")
2022-06-26nixosTests.virtualbox: create shared dir before VMAlyssa Ross1-1/+1
Otherwise, since the update to Virtualbox 6.1.22, the test would fail due to the shared directory not existing. Fixes: ba0da8a076e ("virtualbox: 6.1.18 -> 6.1.22")
2022-06-26nixosTests.virtualbox.host-usb-permissions: import sysAlyssa Ross1-0/+2
Otherwise, sys.stderr is not defined. Fixes: db614e11d67 ("nixos/tests/test-driver: better control test env symbols")
2022-06-26nixosTests.virtualbox: always use nested KVMAlyssa Ross1-12/+2
Nested KVM has been enabled by default on Linux on Intel for a long time now, and since Virtualbox 6.1.0, the test won't run without it because Virtualbox now only supports running hardware-accelerated VMs. Additionally, this means we can 64-bit guests by default. The 32-bit guest additions don't currently build, so this is important to have the tests work with the default options.
2022-05-05treewide: chown user:group instead of user.group to fix warnings from ↵Ivan Kozik1-1/+1
coreutils 9.1
2022-03-28treewide: machine -> nodes.machineRobert Hensing1-1/+1
2021-11-05nixosTests: Redirect stdout to stderr when detachingRobert Hensing1-1/+1
Avoids blocking on stdout.
2021-05-09nixos/test/virtualbox: Fix linting errorsaszlig1-13/+7
There were a bunch of unnecessary f-strings in there and I also removed the "# fmt: on/off" comments, because we no longer use Black and thus won't need those comments anymore. Signed-off-by: aszlig <aszlig@nix.build>
2021-01-10treewide: simplify pkgs.stdenv.lib -> pkgs.libDominik Xaver Hörl1-1/+1
The library does not depend on stdenv, that `stdenv` exposes `lib` is an artifact of the ancient origins of nixpkgs.
2020-11-24utillinux: rename to util-linuxGraham Christensen1-3/+3
2020-08-26Merge pull request #94858 from liff/virtualbox-python-testFlorian Klink1-203/+215
nixosTests.virtualbox: Port to python
2020-08-17nixosTests.virtualbox: Port to pythonOlli Helenius1-203/+213
2020-08-17nixosTests.virtualbox: Disable predictable interface names in guestOlli Helenius1-0/+2
2020-08-13nixos: remove StandardOutput=syslog, StandardError=syslog linesFlorian Klink1-1/+0
Since systemd 243, docs were already steering users towards using `journal`: https://github.com/systemd/systemd/commit/eedaf7f322a850c5d9f49346d43420423fc6f593 systemd 246 will go one step further, it shows warnings for these units during bootup, and will [automatically convert these occurences to `journal`](https://github.com/systemd/systemd/commit/f3dc6af20f410702beb8e45ddf77e92289fc90c7): > [ 6.955976] systemd[1]: /nix/store/hwyfgbwg804vmr92fxc1vkmqfq2k9s17-unit-display-manager.service/display-manager.service:27: Standard output type syslog is obsolete, automatically updating to journal. Please update│······················ your unit file, and consider removing the setting altogether. So there's no point of keeping `syslog` here, and it's probably a better idea to just not set it, due to: > This setting defaults to the value set with DefaultStandardOutput= in > systemd-system.conf(5), which defaults to journal.
2020-04-07treewide: use runtimeShell in nixos/Jörg Thalheim1-2/+2
This is needed for cross-compilation.
2020-01-29nixos/display-managers/auto: removeworldofpeace1-1/+1
This module allows root autoLogin, so we would break that for users, but they shouldn't be using it anyways. This gives the impression like auto is some special display manager, when it's just lightdm and special pam rules to allow root autoLogin. It was created for NixOS's testing so I believe this is where it belongs.
2019-09-05tests/virtualbox: Clean up unnecessary things.Ambroz Bizjak1-18/+6
Always enable the UART because the VirtualBug bug that required running without the UART was fixed in 6.0.10. Stop using an old kernel version because the tests work with the default kernel. (cherry picked from commit ae93571e8d04cebd69491a789d902d6481e05d3f)
2019-05-09virtualbox: 5.2.28 -> 6.0.6Ambroz Bizjak1-8/+34
Quite some fixing was needed to get this to work. Changes in VirtualBox and additions: - VirtualBox is no longer officially supported on 32-bit hosts so i686-linux is removed from platforms for VirtualBox and the extension pack. 32-bit additions still work. - There was a refactoring of kernel module makefiles and two resulting bugs affected us which had to be patched. These bugs were reported to the bug tracker (see comments near patches). - The Qt5X11Extras makefile patch broke. Fixed it to apply again, making the libraries logic simpler and more correct (it just uses a different base path instead of always linking to Qt5X11Extras). - Added a patch to remove "test1" and "test2" kernel messages due to forgotten debugging code. - virtualbox-host NixOS module: the VirtualBoxVM executable should be setuid not VirtualBox. This matches how the official installer sets it up. - Additions: replaced a for loop for installing kernel modules with just a "make install", which seems to work without any of the things done in the previous code. - Additions: The package defined buildCommand which resulted in phases not running, including RUNPATH stripping in fixupPhase, and installPhase was defined which was not even run. Fixed this by refactoring using phases. Had to set dontStrip otherwise binaries were broken by stripping. The libdbus path had to be added later in fixupPhase because it is used via dlopen not directly linked. - Additions: Added zlib and libc to patchelf, otherwise runtime library errors result from some binaries. For some reason the missing libc only manifested itself for mount.vboxsf when included in the initrd. Changes in nixos/tests/virtualbox: - Update the simple-gui test to send the right keys to start the VM. With VirtualBox 5 it was enough to just send "return", but with 6 the Tools thing may be selected by default. Send "home" to reliably select Tools, "down" to move to the VM and "return" to start it. - Disable the VirtualBox UART by default because it causes a crash due to a regression in VirtualBox (specific to software virtualization and serial port usage). It can still be enabled using an option but there is an assert that KVM nested virtualization is enabled, which works around the problem (see below). - Add an option to enable nested KVM virtualization, allowing VirtualBox to use hardware virtualization. This works around the UART problem and also allows using 64-bit guests, but requires a kernel module parameter. - Add an option to run 64-bit guests. Tested that the tests pass with that. As mentioned this requires KVM nested virtualization.
2019-01-26treewide: remove wkennington as maintainerJörg Thalheim1-1/+1
He prefers to contribute to his own nixpkgs fork triton. Since he is still marked as maintainer in many packages this leaves the wrong impression he still maintains those.
2018-11-11tests: refactor to carry the package set as an argumentLéo Gaspard1-3/+8
This way, the package set will be possible to pass without re-importing all the time
2018-08-28virtualbox: Change the virtualbox tests to not build the unfree tests by ↵Dennis Gosnell1-20/+22
default. (#45415)
2018-08-15virtualbox: Add tests for the VirtualBox Extension Pack.(cdep)illabout1-5/+34
2018-06-30nixos/tests: users.(extraUsers|extraGroup->users|group)Florian Klink1-1/+1
2018-03-13nixos/tests/virtualbox: Work around test failuresaszlig1-0/+3
I've started digging into the actual cause of the problem a week ago but didn't continue fixing this. The reason why the tests are failing is because torvalds/linux/commit/72f5e08dbba2d01aa90b592cf76c378ea233b00b has remapped the location of the TSS into the CPU entry area and we did update our default kernel to version 4.14 in NixOS/nixpkgs@88530e02b6fa. Back to VirtualBox: The guru meditation happens in selmRCGuestTssPostWriteCheck, which I think is only a followup error. I believe the right location couldn't be determined by VirtualBox and thus the write check function triggers that panic because it's reading from the wrong location. So the actual problem *only* surfaces whenever we use software virtualization, which we do for our tests because we don't have nested virtualization available. Our tests are also for testing the functionality of VirtualBox itself and not certain kernel versions or kernel features, so for the time being and until this is fixed, let's actually use kernel version 4.9 for the guests within the VM tests. Kernel 4.9 didn't have the mentioned change of the TSS location and thus the tests succeed. Signed-off-by: aszlig <aszlig@nix.build> Cc: @dtzWill
2017-12-23nixos/tests/virtualbox: remove mknod /dev/vda1 callFlorian Klink1-3/+0
With devtmpfs introduced in 0d27df280f7ed502bba65e2ea13469069f9b275a it is created automatically. See https://github.com/NixOS/nixpkgs/pull/32983#issuecomment-353703083
2017-10-14nixos: run parted with --script optionBjørn Forsman1-2/+2
-s, --script: never prompts for user intervention Sometimes the NixOS installer tests fail when they invoke parted, e.g. https://hydra.nixos.org/build/62513826/nixlog/1. But instead of exiting right there, the tests hang until the Nix builder times out (and kills the build). With this change the tests would instead fail immediately, which is preferred. While at it, use "parted --script" treewide, so nobody gets build timeout due to parted error (or misuse). (Only nixos/ use it, and only non-interactive.) A few instances already use the short option "-s", convert them to long option "--short".
2017-09-21nixos/tests/virtualbox: Fix netcat invocationaszlig1-4/+4
This is a backwards-incompatibility in netcat-openbsd introduced due to bumping the netcat version to 1.130 in a72ba661acf54d1beb2b4e306acba7d6f45621c4. Version 1.130 no longer exits on EOF but now needs to be passed the -N flag in order to exit on EOF. The upstream change reads[1] like this: Don't shutdown nc(1)'s network socket when stdin closes. Matches *Hobbit*'s original netcat and GNU netcat; revert to old behaviour with the new -N flag if needed. After much discussion with otto deraadt tedu and Martin Pelikan. ok deraadt@ Here is the diff of this change: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/netcat.c.diff?r1=1.110&r2=1.111&f=h [1]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/netcat.c?rev=1.111&content-type=text/x-cvsweb-markup Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-03-27nixos/tests/virtualbox: Fix @shell@ expansionaszlig1-1/+1
This has surfaced since f803270b7e00fa7124282809838d5652083b6aad. The commit bumped bash to version 4.4, which caused to change the order of --subst-var flags in substituteAll, which this test was relying on, because it added a @shell@ to boot.initrd.postMountCommands. Our substituter is currently working a bit like this: original.replace('@var1@', 'val1').replace('@var2@', 'val2')... Unfortunately, this means that if @var2@ occurs within @var1@ it is replaced by the new value, so the order of the substvars actually matter. I highly doubt that we want a behaviour like this and I'm wondering why it didn't occur to me as a problem while writing the initial implementation of the VirtualBox tests. Whether to get rid of this and disallowing substitution of substvars within substvars is another topic which I think needs discussion in a different place. As for now, I'm using stdenv.shell, because the closure size of this should fit within the initrd, so it's fine especially because it's just a test. Tested with the net-hostonlyif and systemd-detect-virt tests and they both succeed with this change. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Reported-by: @globin on IRC
2016-10-30netcat: make netcat-openbsd the default netcat (#19411)sternenseemann1-6/+6
The motivation for this change is the following: As gnu-netcat, e. g. does not support ipv6, it is not suitable as default netcat. This commit also fixes all obvious build issues caused by this change.
2016-10-26virtualbox-{systemd-detect-virt,net-hostonlyif} test: fix dbus socket dirJoachim Fasting1-2/+2
The test complains[1][2] that Failed to start message bus: Failed to bind socket "/run/dbus/system_bus_socket": No such file or directory In 639e5401ff51d4c0075b5ceffcbdbfec64c67db3, the dbus socket dir is set to `/run/dbus`; in the test vm `/var/run/dbus` is used, but the standard `/run -> /var/run` link is typically not created until stage 2 init, not in the minimal init used here. Thus, dbus fails to run within the test environment . Fix by changing `/var/run/dbus` to simply `/run/dbus`. [1]: https://hydra.nixos.org/build/42534725 [2]: https://hydra.nixos.org/build/42523834
2016-09-14nixos/tests/vbox: Add destroyVM for all subtestsaszlig1-0/+3
One reason why it took me so long for debugging the test failure with systemd-detect-virt was that simple-cli has succeeded while the former has not. This now makes sure we have consistency accross all the subtests and if problems like the one in the previos commit ever show up again, we will have just the headless test succeeding and it's more obvious where the actual problem resides. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-09-13nixos/tests/vbox: Disable audio for VBox guestsaszlig1-0/+1
We don't have (simulated) sound hardware within the qemu VM, neither do we have it available within VirtualBox that's running within the qemu VMs. With sound hardware the VirtualBox UI displays an error dialog, which in turn causes the VM process to hang on unregister. This in turn has caused the tests to fail because of the following error: Cannot unregister the machine '...' while it is locked Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-09-13nixos/tests/vbox: Make shutdown less noisyaszlig1-3/+6
Using waitUntilSucceeds for testing whether the shutdown signalling files have vanished is quite noisy because it prints two lines for every try. This is now fixed with a while loop on the guest VM which does the same check but with only one output for the command that's executed and another one when the conditions are met. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-09-01virtualbox: add headless build (without Qt dependency) (#18026)Данило Глинський (Danylo Hlynskyi)1-0/+11
2016-08-23Fix virtualbox test evaluationEelco Dolstra1-2/+2
2016-08-23treewide: Use makeBinPathTuomas Tynkkynen1-1/+1
2016-05-26nixos/tests/vbox: Fix invocation of dbusaszlig1-4/+4
VBoxService needs dbus in order to work properly, which failed to start up so far, because it was searching in /run/current-system/sw for its configuration files. We now no longer run with the --system flag but specify the configuration file directly instead. This fixes at least the "simple-gui" test and probably the others as well, which I haven't tested yet. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-05-26nixos/tests/vbox: Replace waitForWindow with xpropaszlig1-1/+3
We can't use waitForWindow here because it runs xwininfo as user root, who in turn is not authorized to connect to the X server running as alice. So instead, we use xprop from user alice which should fix waiting for the VirtualBox manager window. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-05-26nixos/tests/vbox: Start X server with user "alice"aszlig1-0/+1
The VirtualBox tests so far ran the X server as root instead of user "alice" and it did work, because we had access control turned off by default. Fortunately, it was changed in 1541fa351b4d664c51dddaeaa67ee0652892f405. As a side effect, it caused all the VirtualBox tests to fail because they now can't connect to the X server, which is a good thing because it's a bug of the VirtualBox tests. So to fix it, let's just start the X server as user alice. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-02-29nixos/tests/virtualbox: Split up subtestsaszlig1-108/+112
Now subtests are separate derivations, because the individual tests do not depend on state from previous test runs. This has the advantage that it's easier to run individiual tests and it's also easier to pinpoint individual tests that randomly fail. I ran all of these tests locally and they still succeed. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-09-25nixos/tests/virtualbox: Don't parallelize VM boot.aszlig1-2/+1
I'm not quite sure why the official Hydra gets a kernel panic in one of two VMs using the exact same kernels: https://hydra.nixos.org/build/26339384 Because the kernel panic happens before stage 1, let's wait for the first VM to boot up and after the bootup is done, start the second one in hope that it won't trigger the panic. Oddly enough, whenever I run the test on my own Hydra and on my local machines, I don't get anything like that. Signed-off-by: aszlig <aszlig@redmoonstudios.org>