summary refs log tree commit diff
path: root/nixos/modules/testing
Commit message (Collapse)AuthorAge
* nixos/tests: also set TimeoutStart in systemd.user.extraConfigNaïm Favier2022-01-21
|
* nixos/lib/qemu-flags: rename to qemu-commonrnhmjoj2021-09-18
| | | | | | The current name is misleading: it doesn't contain cli arguments, but several constants and utility functions related to qemu. This commit also removes the use of `with import ...` for clarity.
* treewide: use perl.withPackages when possiblernhmjoj2021-03-31
| | | | | | | | | | | | | | | | | | | | | | Since 03eaa48 added perl.withPackages, there is a canonical way to create a perl interpreter from a list of libraries, for use in script shebangs or generic build inputs. This method is declarative (what we are doing is clear), produces short shebangs[1] and needs not to wrap existing scripts. Unfortunately there are a few exceptions that I've found: 1. Scripts that are calling perl with the -T switch. This makes perl ignore PERL5LIB, which is what perl.withPackages is using to inform the interpreter of the library paths. 2. Perl packages that depends on libraries in their own path. This is not possible because perl.withPackages works at build time. The workaround is to add `-I $out/${perl.libPrefix}` to the shebang. In all other cases I propose to switch to perl.withPackages. [1]: https://lwn.net/Articles/779997/
* nixos/service-runner: fix evaluationMichael Raskin2021-02-05
| | | | | | | Follow-up to: nixos/systemd: allow preStart with other ExecStartPre cmdlines #109976 As the additional ExecStartPre and ExecStartPost are now lists, update their processing by service-runner.nix
* nixos/tests: only apply qemu parameters if the options are definedAndreas Rammhold2020-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes an eval error that occurred on hydra with the small channel and the `nixos.tests.boot.biosCdrom.x86_64-linux` attribute: > $ nix-instantiate nixos/release-small.nix -A nixos.tests.boot.biosCdrom.x86_64-linux > warning: unknown setting 'experimental-features' > error: The option `virtualisation.qemu' does not exist. Definition values: > - In `/home/andi/dev/nixos/nixpkgs/nixos/modules/testing/test-instrumentation.nix': > { > consoles = [ ]; > package = { > _type = "override"; > content = <derivation /nix/store/q72h2cdcb9zjgiay5gdgzwddjkbjr7xq-qemu-host-cpu-only-for-vm-tests-5.1.0.drv>; > ... > (use '--show-trace' to show detailed location information) In bc2188b we changed test test-instrumentation to also set the QEMU package that is being used. That change unfortunately caused us to always assing values to the virtualisation.qemu.package option even when the option is not defined. The original code was explicitly testing for the consoles case but the then newly extended version did not adjust the check as the intention was probably not clear. With this commit we are always ensuring the entire virtualisation.qemu section exists and can thus drop the individual tests for each of the sections since the QEMU module always defines both the package and the consoles option when it's root is defined..
* nixos/nixos-build-vms: use `pkgs.qemu` for virtualisationMaximilian Bosch2020-10-23
| | | | | | | | | | | | | | When I test a change e.g. in the module system manually, I usually use `nixos-build-vms(8)` which also gives me a QEMU window where I can play around in the freshly built VM. It seems as this has changed recently when the default package for non-interactive VM tests using the same framework was switched to `pkgs.qemu_test` to reduce the closure size. While this is a reasonable decision for our CI tests, I think that you really want a QEMU window of the VM by default when using `nixos-build-vms(8)`. [1] bc2188b083dfbbe749a221023e2960b60d4c8951
* nixos: fix qemu_test being used in normal VMsrnhmjoj2020-10-21
| | | | This is an attempt to fixup PR #49403.
* nixos/tests: make sure we use the qemu_test package to provide the Guest AgentAndreas Rammhold2020-10-19
| | | | | This reduces the closure size for the minimal test by a lot since we no longer have to build the regular QEMU for even the simplest test.
* nixos/testing: remove remaining coverage-data logicFlorian Klink2020-09-05
| | | | | This isn't used anymore as per https://github.com/NixOS/nixpkgs/pull/72354#discussion_r451031449.
* nixos/test-instrumentation: properly import `options` for `qemu`-checkMaximilian Bosch2020-08-18
| | | | | | | | | | | | | | If `qemu-vm.nix` is imported, the option `virtualisation.qemu.consoles` should be set to make sure that the machine's output isn't rendered on the graphical window of QEMU. This is needed when interactively running a NixOS test or in conjunction with `nixos-build-vms(8)`. The patch 257855753073987160c293fdedc9d95a33cbc0e8 tries to only do this if the option actually exists, however this condition used to be always false since `options` wasn't imported in the module and pointed to `lib.options` due to the `with lib;`-clause.
* nixos/test-instrumentation.nix: Fix evaluation errorRobert Hensing2020-08-16
| | | | | | Discovered via https://github.com/NixOS/nixpkgs/pull/82743 which improved option checking, causing an evaluation error that was hard to understand without running the evaluation manually.
* nixos/service-runner.nix: Allow quotes in commands + testRobert Hensing2020-02-28
|
* nixos/testing: remove leftover of virtualisation.qemu.programrnhmjoj2019-08-29
|
* nixos/test: remove the stateVersion statement from the test-instrumentationAndreas Rammhold2019-06-03
| | | | | | | | | | | | | | | | | | | | | | | We set stateVersion to `mkDefault 18.03` in `nixos/modules/testing/test-instrumentation.nix` and in `modules/installer/cd-dvd/installation-cd-base.nix`. Accessing the stateVersion in the module system from within the tests results in the following error: > The unique option `system.stateVersion' is defined multiple times, in > `nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-base.nix' and > `nixpkgs/nixos/modules/testing/test-instrumentation.nix'. There are other tests that use it as well. Namely the radicale test also verifies behaviour between state versions is as expected. It switches a package default value. Others switched on the state directory default. It seems like having the timesyncd switch as part of every rendered activationScript might cause this weird error. Removing this line seems like a reasonable thing to do since we actually set the default to the very same value in the module system. This line should have been no-op besides the issue that we've two statements setting it in this very specific case.
* types.optionSet: deprecate and remove last usagesdanbst2019-01-31
|
* Revert "Add ssh backdoor to VM tests infrastructure."Samuel Dionne-Riel2019-01-19
| | | | | | | This reverts commit d6e3db44cf09d04f0a3cd5b7ccb4a5dc3b7bfaa9. See #53935 for explanations. In short, it may be causing issues with tests on the build infrastructure.
* lib.makePerlPath -> perlPackages.makePerlPathvolth2018-12-15
|
* Add ssh backdoor to VM tests infrastructure.Tuomas Tynkkynen2018-09-28
| | | | | Thanks to @dezgeg for prototype implementation, I've cleaned it up and added documentation.
* nixos/tests: Set DefaultTimeoutStartSec very high (#44916)Brian Olsen2018-08-29
| | | | | | | | | | DefaultTimeoutStartSec is normally set to 90 seconds and works fine. But when running NixOS tests on a very slow machine (like a VM without nested virtualisation support) this default is to low and causes systemd units to fail spuriously. One symptom of this issue are tests at times failing with "timed out waiting for the VM to connect". Since the VM connect timeout is 300 seconds I also set DefaultTimeoutStartSec to this which is ridiculously high.
* Revert "nixos: rename system.{stateVersion,defaultChannel} -> system.nixos.\1"Tuomas Tynkkynen2018-07-28
| | | | | | | | | | | This reverts commit 095fe5b43def40279a243e663c662b02caac5318. Pointless renames considered harmful. All they do is force people to spend extra work updating their configs for no benefit, and hindering the ability to switch between unstable and stable versions of NixOS. Like, what was the value of having the "nixos." there? I mean, by definition anything in a NixOS module has something to do with NixOS...
* [bot] nixos/*: remove unused arguments in lambdasvolth2018-07-20
|
* [bot]: remove unreferenced codevolth2018-07-20
|
* nixos/modules: users.(extraUsers|extraGroup->users|group)Florian Klink2018-06-30
|
* nixos/tests: set default stateVersion in test VMsUli Baum2018-05-14
| | | | | ... to avoid lots of warnings during eval introduced by 1f0b6922d3c
* nixos/testing: Fix output of systemd messagesaszlig2018-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Regression introduced by d4468bedb52bf03ff125d721634f83604bddd589. No systemd messages are shown anymore during VM test runs, which is not very helpful if you want to find out about failures. There is a bit of a conflict between testing and the change that introduced the regression. While the mentioned commit makes sure that the primary console is tty0 for virtualisation.graphics = false, our VM tests need to have the serial console as primary console. So in order to support both, I added a new virtualisation.qemu.consoles option, which allows to specify those options using the module system. The default of this option is to use the changes that were introduced and in test-instrumentation.nix we use only the serial console the same way as before. For test-instrumentation.nix I didn't add a baudrate to the serial console because I can't find a reason on top of my head why it should need it. There also wasn't a reason stated when that was introduced in 7499e4a5b917227696b7292ae1bd728d6b1978b0. Signed-off-by: aszlig <aszlig@nix.build> Cc: @flokli, @dezgeg, @edolstra
* nixos/qemu: Deduplicate QEMU serialDevice into qemu-flags.nixTuomas Tynkkynen2018-01-30
|
* tests: logToJournal has been renamedPeter Hoeg2017-12-06
|
* nixos/qemu-vm: Use different serial port on ARM/AArch64Tuomas Tynkkynen2017-11-26
|
* Revert "nixos/test-instrumentation: softcode DISPLAY"Joerg Thalheim2017-11-08
| | | | | | | | This reverts commit 4531ec59551fa3f3c9dfb442dff2ec669c467922. This broke waitForX: https://github.com/NixOS/nixpkgs/commit/b11ac5d29dcccdb7474a23ac1d8a6c40553adcd5#commitcomment-25486347 cc @Lassulus
* nixos/test-instrumentation: softcode DISPLAYlassulus2017-11-07
|
* buildLinux: allow overriding stdenv on each callVladimír Čunát2017-08-20
|
* kdm: drop serviceGraham Christensen2017-02-11
|
* virtualisation.qemu.program: RemoveEelco Dolstra2016-12-20
| | | | | | | | This option is defined in qemu-vm.nix, but that module is not always imported. http://hydra.nixos.org/build/44817443 (cherry picked from commit 03c55005dfd6fbcd5cf8e00128a3bb6336b3bc0f)
* nixos/test-instrumentation: Fix eval of boot testsaszlig2016-12-15
| | | | | | | | | | | | | | | | The boot tests import test-instrumentation.nix directly to create a VM image that only contains things such as the backdoor and serial console the same way as used by other NixOS VM tests. With one difference though: It doesn't need nor want to have 9p filesystems mounted, because we actually want to test an image rather than re-using most stuff from the host's store. Change tested against the boot.uefiUsb and ipv6 tests, just that it becomes clear we don't break either the tests with 9p nor the boot tests (which were already broken but now succeed). Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/tests: Use a patched QEMU for testingaszlig2016-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | The reason to patch QEMU is that with latest Nix, tests like "printing" or "misc" fail because they expect the store paths to be owned by uid 0 and gid 0. Starting with NixOS/nix@5e51ffb1c265e16486fcdd888ce4a04db9e5552b, Nix builds inside of a new user namespace. Unfortunately this also means that bind-mounted store paths that are part of the derivation's inputs are no longer owned by uid 0 and gid 0 but by uid 65534 and gid 65534. This in turn causes things like sudo or cups to fail with errors about insecure file permissions. So in order to avoid that, let's make sure the VM always gets files owned by uid 0 and gid 0 and does a no-op when doing a chmod on a store path. In addition, this adds a virtualisation.qemu.program option so that we can make sure that we only use the patched version if we're *really* running NixOS VM tests (that is, whenever we have imported test-instrumentation.nix). Tested against the "misc" and "printing" tests. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* KDE test: Bump kdm start timeoutEelco Dolstra2016-05-27
| | | | | Hopefully this will fix random failures like http://hydra.nixos.org/build/36249079.
* Add an option to write the X session log to the journalEelco Dolstra2016-05-24
| | | | | | ... rather than ~/.xsession-errors. It might make sense to make this the default, in order to eliminate ad hoc, uncentralised, poorly discoverable log files.
* test-instrumentation.nix: Only clear $PAGER in the backdoor shellEelco Dolstra2016-02-23
|
* NixOS tests: Increase hung_task_timeout_secsEelco Dolstra2016-01-04
| | | | | | | | | | | | This hopefully fixes intermittent test failures like http://hydra.nixos.org/build/29962437 router# [ 240.128835] INFO: task mke2fs:99 blocked for more than 120 seconds. router# [ 240.130135] Not tainted 3.18.25 #1-NixOS router# [ 240.131110] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. assuming that these are caused by high load on the host.
* nixos/tests: Revert setting min_free_kbytesaszlig2015-12-14
| | | | | | | | | | | This reverts commit 02b568414d509b5d06dbd95bcc0868d487ed359e. With a5bc11f and 6353f58 in place, we really don't need this anymore. After running about 500 VM tests on my Hydra, it still didn't improve very much. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/test-instrumentation: Set vm.min_free_kbytesaszlig2015-12-13
| | | | | | | | | | | | | | | | | | | | We hit page allocation failures a lot at random for VM tests, in case of my own Hydra when it comes to the installer tests. The reason for this is that once the memory of the VM gets heavily fragmented the kernel is unable to allocate new pages. Setting vm.min_free_kbytes to 16MB forces the kernel to keep a minimum of 16 MB free. I've done some testing accross repeated runs of the installer tests with and without vm.min_free_kbytes set. So accross 30 test runs for each settings, all of the tests with the option being set passed while 14 tests without that sysctl option triggered page allocation failures. Sure, running 30 tests is not a guarantee that 16MB is enough, but we'll see how it turns out in the long run across all VM tests. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* test-instrumentation.nix: Prevent calling a pagerEelco Dolstra2015-01-15
|
* nixos: Fix priorities of initialHashedPassword.aszlig2014-11-04
| | | | | | | | | | | | | | | | | | Regression introduced in f496c3cbe4a6a2db88892d14609618e449744ed6. Previously when we used security.initialRootPassword, the default priority for this option was 1001, because it was a default value set by the option itself. With the mentioned commit, it is no longer an option default but a mkDefault, which is priority 1000. I'm setting this to 150 now, as test-instrumentation.nix is using this for overriding other options and because I think it still makes it possible to simple-override it, because if no priority is given, we get priority 100. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* Obsolete security.initialPasswordEelco Dolstra2014-11-03
| | | | You can now set users.extraUsers.root.initialHashedPassword instead.
* Fix evaluationEelco Dolstra2014-08-06
|
* test-instrumentation.nix: Set an empty root passwordEelco Dolstra2014-08-06
| | | | This makes it easier to log in during interactive sessions.
* test-instrumentation.nix: Improve loggingEelco Dolstra2014-08-06
| | | | | In particular, don't clobber the serial console with duplicate output from systemd and the journal, and increase the log level.
* Get all lib functions from lib, not pkgs.lib, in modulesShea Levy2014-07-02
|
* Fix the installer testEelco Dolstra2014-04-20
| | | | http://hydra.nixos.org/build/10419676
* Rewrite ‘with pkgs.lib’ -> ‘with lib’Eelco Dolstra2014-04-14
| | | | | | | | Using pkgs.lib on the spine of module evaluation is problematic because the pkgs argument depends on the result of module evaluation. To prevent an infinite recursion, pkgs and some of the modules are evaluated twice, which is inefficient. Using ‘with lib’ prevents this problem.