summary refs log tree commit diff
path: root/nixos/tests/virtualbox.nix
Commit message (Collapse)AuthorAge
* nixosTests: Redirect stdout to stderr when detachingRobert Hensing2021-11-05
| | | | Avoids blocking on stdout.
* nixos/test/virtualbox: Fix linting errorsaszlig2021-05-09
| | | | | | | | 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>
* treewide: simplify pkgs.stdenv.lib -> pkgs.libDominik Xaver Hörl2021-01-10
| | | | | The library does not depend on stdenv, that `stdenv` exposes `lib` is an artifact of the ancient origins of nixpkgs.
* utillinux: rename to util-linuxGraham Christensen2020-11-24
|
* Merge pull request #94858 from liff/virtualbox-python-testFlorian Klink2020-08-26
|\ | | | | nixosTests.virtualbox: Port to python
| * nixosTests.virtualbox: Port to pythonOlli Helenius2020-08-17
| |
| * nixosTests.virtualbox: Disable predictable interface names in guestOlli Helenius2020-08-17
| |
* | nixos: remove StandardOutput=syslog, StandardError=syslog linesFlorian Klink2020-08-13
|/ | | | | | | | | | | | | | | | | | | | 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.
* treewide: use runtimeShell in nixos/Jörg Thalheim2020-04-07
| | | | This is needed for cross-compilation.
* nixos/display-managers/auto: removeworldofpeace2020-01-29
| | | | | | | | 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.
* tests/virtualbox: Clean up unnecessary things.Ambroz Bizjak2019-09-05
| | | | | | 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)
* virtualbox: 5.2.28 -> 6.0.6Ambroz Bizjak2019-05-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* treewide: remove wkennington as maintainerJörg Thalheim2019-01-26
| | | | | | 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.
* tests: refactor to carry the package set as an argumentLéo Gaspard2018-11-11
| | | | | This way, the package set will be possible to pass without re-importing all the time
* virtualbox: Change the virtualbox tests to not build the unfree tests by ↵Dennis Gosnell2018-08-28
| | | | default. (#45415)
* virtualbox: Add tests for the VirtualBox Extension Pack.(cdep)illabout2018-08-15
|
* nixos/tests: users.(extraUsers|extraGroup->users|group)Florian Klink2018-06-30
|
* nixos/tests/virtualbox: Work around test failuresaszlig2018-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* nixos/tests/virtualbox: remove mknod /dev/vda1 callFlorian Klink2017-12-23
| | | | | | | With devtmpfs introduced in 0d27df280f7ed502bba65e2ea13469069f9b275a it is created automatically. See https://github.com/NixOS/nixpkgs/pull/32983#issuecomment-353703083
* nixos: run parted with --script optionBjørn Forsman2017-10-14
| | | | | | | | | | | | | | | | | -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".
* nixos/tests/virtualbox: Fix netcat invocationaszlig2017-09-21
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* nixos/tests/virtualbox: Fix @shell@ expansionaszlig2017-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* netcat: make netcat-openbsd the default netcat (#19411)sternenseemann2016-10-30
| | | | | | | 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.
* virtualbox-{systemd-detect-virt,net-hostonlyif} test: fix dbus socket dirJoachim Fasting2016-10-26
| | | | | | | | | | | | | | | 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
* nixos/tests/vbox: Add destroyVM for all subtestsaszlig2016-09-14
| | | | | | | | | | | | | 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>
* nixos/tests/vbox: Disable audio for VBox guestsaszlig2016-09-13
| | | | | | | | | | | | | | 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>
* nixos/tests/vbox: Make shutdown less noisyaszlig2016-09-13
| | | | | | | | | | 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>
* virtualbox: add headless build (without Qt dependency) (#18026)Данило Глинський (Danylo Hlynskyi)2016-09-01
|
* Fix virtualbox test evaluationEelco Dolstra2016-08-23
|
* treewide: Use makeBinPathTuomas Tynkkynen2016-08-23
|
* nixos/tests/vbox: Fix invocation of dbusaszlig2016-05-26
| | | | | | | | | | | | | | 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>
* nixos/tests/vbox: Replace waitForWindow with xpropaszlig2016-05-26
| | | | | | | | | | | 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>
* nixos/tests/vbox: Start X server with user "alice"aszlig2016-05-26
| | | | | | | | | | | | | | | | 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>
* nixos/tests/virtualbox: Split up subtestsaszlig2016-02-29
| | | | | | | | | | | | 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>
* nixos/tests/virtualbox: Don't parallelize VM boot.aszlig2015-09-25
| | | | | | | | | | | | | | | | 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>
* nixos/tests/virtualbox: Destroy detectvirt VM.aszlig2015-09-24
| | | | | | | I forgot to do this in da0e642. It shouldn't be a big problem but it's more clean to destroy the VM once we're done testing. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/tests/virtualbox: Give VMs more memory.aszlig2015-09-24
| | | | | | | | | | | | | We previously had 1024 MB of memory to fit a VirtualBox VM with 512 MB plus the memory needed of the VirtualBox host VM. That obviously won't work for two VirtualBox VMs, which are used for testing networking between two VirtualBox guests. Now, we have 2048 MB on the qemu guest (the VirtualBox host) and 768 MB for each VirtualBox guest. That should be enough to fit in two VirtualBox guests (I hope). Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* tests/virtualbox: Add a subtest for host USB.aszlig2015-09-21
| | | | | | | | | | | Unfortunately, we can't test whether USB is really working, but we can make sure that VirtualBox has access to the USB devices. This is essentially testing #9736, which I haven't yet been able to reproduce though, but it makes sense to test it so it won't happen in future releases. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* tests/virtualbox: Add systemd-detect-virt subtest.aszlig2015-09-17
| | | | | | | | | | | Addresses #9876 in the way that we want to make sure that VirtualBox 5.x is going to be properly detected. Right now the result is "kvm", so the subtest fails as expected with: error: systemd-detect-virt returned "kvm" instead of "oracle" at (eval 14) line 414, <__ANONIO__> line 92. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* tests/virtualbox: Put name in log descriptions.aszlig2015-09-17
| | | | | | | Makes it easier to debug and find out for which machine a certain log socket has been started or stopped. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* tests/virtualbox: Use antiquotes for log sockets.aszlig2015-09-17
| | | | | | | | | | | | | | | | | | | | | We're simply using antiquotation, since it's been a while since these got introduced (in Nix 1.7). So we can use them because it makes the code much more readable. As usual, I made sure that I didn't accidentally change something in functionality: $ nix-instantiate nixos/tests/virtualbox.nix ... /nix/store/cldxyrxqvwpqm02cd3lvknnmj4qmblyn-vm-test-run-virtualbox.drv $ git stash pop ... $ nix-instantiate nixos/tests/virtualbox.nix ... /nix/store/cldxyrxqvwpqm02cd3lvknnmj4qmblyn-vm-test-run-virtualbox.drv $ Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* tests/virtualbox: Fix long line in guestAdditions.aszlig2015-09-17
| | | | | | | | | | | | | | | | | | | | This is essentially not only "wrapping" the line but refactoring into a shorter name which is used in two places. And yes, I know I'm very pedantic if it comes to whitespaces and line lengths, but I made sure this doesn't change any functionality: $ nix-instantiate nixos/tests/virtualbox.nix ... /nix/store/cldxyrxqvwpqm02cd3lvknnmj4qmblyn-vm-test-run-virtualbox.drv $ git stash pop ... $ nix-instantiate nixos/tests/virtualbox.nix ... /nix/store/cldxyrxqvwpqm02cd3lvknnmj4qmblyn-vm-test-run-virtualbox.drv $ Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* tests/virtualbox: Allow to call it with debug attr.aszlig2015-09-17
| | | | | | | | | Instead of manually setting debug to true or false, this should make it possible to now run the test like this: nix-build nixos/tests/virtualbox.nix --arg debug true Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* tests/virtualbox: Give test machines more memory.aszlig2015-09-16
| | | | | | | | Sometimes there are random kernel panics do to the lack of memory in the qemu guests, but as we're setting the VirtualBox memory size relatively low, 1024 MB should be enough for the qemu guests. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* tests/virtualbox: Start systemwide DBus in guests.aszlig2015-09-16
| | | | | | | | | | | We want to check whether DBus functionality is working, so let's make sure it is running in our mini-initrd. DBus unfortunately requires to have users properly set up and another configuration file other than in ${dbus.daemon}/etc/dbus-1/system.conf, so we do provide that as well. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/vbox: Move all options to virtualisation.*.aszlig2015-08-13
| | | | | | | | | | | | Commit 687caeb renamed services.virtualboxHost to programs.virtualbox, but according to the discussion on the commit, it's probably a better to put it into virtualisation.virtualbox instead. The discussion can be found here: https://github.com/NixOS/nixpkgs/commit/687caeb#commitcomment-12664978 Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* vbox-guest: Remove all references to sbin/.aszlig2015-08-04
| | | | | | | | | | | | | | Using $storepath/sbin is deprecated according to commit 98cedb3, so let's avoid putting anything in .../sbin for the guest additions. This is a continuation of the initial commit done by @ctheune at 1fb1360, which unfortunately broke VM tests and only changed the path of the mount.vboxsf helper. With this commit, the VM test is fixed and I've also verified on my machine that it is indeed working again. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* all tests: added meta.maintainers sectionJoachim Schiele2015-07-12
|
* nixos/tests/vbox: Make GUI startup more robust.aszlig2015-04-04
| | | | | | | | | | | Sometimes, keys aren't properly recognized the first time, so in order to make sure they get through, always resend the key again on retry. In this case the worst that could happen is that the VM is started over and over again, but never in parallel, so that's fine because we're checking for successful startup 10 seconds after the keypress. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/initrd: Generic library copyingWilliam A. Kennington III2015-03-28
|