about summary refs log tree commit diff
path: root/nixos/lib
AgeCommit message (Collapse)AuthorFilesLines
2020-09-14nixos/testing: Add support for specialArgsJanne Heß2-4/+8
Since using flakes disallows the usage of <unstable> (which I use in some tests), this adds an alternative. By setting specialArgs, all VMs can get the `unstable` flake input as an arg. This is not possible with extraConfigurations, as that would lead to infinite recursions.
2020-09-11test-driver.py: defaulting keepVmState in Machine initFélix Baylac-Jacqué1-1/+1
ecb73fd5557d6d438aa7c155e5b1aad89373c6ae introduced a new keepVmState CLI flag for test-driver.py. This CLI flags gets forwarded to the Machine class through create_machine. It created a regression for the boot tests where __main__ end up not being evaluated. See https://github.com/NixOS/nixpkgs/pull/97346#issuecomment-690951837 for bug report. Defaulting keepVmState to false when __main__ ends up not being evaluated.
2020-09-07test-driver.py: fix VM state directory deletionFélix Baylac-Jacqué1-9/+12
The previous version of the code would only kick in if the state directory path pointed at a *file*, which never occurs. Making that codepath actually work reveals an ordering bug, which this patch fixes as well. It also replaces the confusing, imperative case log message "delete VM state directory" with "deleting VM state directory". Finally, we hint the user about how to prevent this deletion. IE. by passing the --keep-vm-state flag. Bug report: https://github.com/NixOS/nixpkgs/pull/91046#issuecomment-685568750 Credit goes to Edef for the rebase on top of a recent nixpkgs commit and for writing most of this commit message. Co-authored-by: edef <edef@edef.eu>
2020-09-05nixos/testing: remove remaining coverage-data logicFlorian Klink1-8/+1
This isn't used anymore as per https://github.com/NixOS/nixpkgs/pull/72354#discussion_r451031449.
2020-09-02Merge pull request #96042 from rnhmjoj/loaOfWORLDofPEACE1-1/+1
treewide: completely remove types.loaOf
2020-09-02nixos/lib/make-options-doc: remove loaOf subsrnhmjoj1-1/+1
Remove the substitution for the <name?> placeholder used by loaOf, now that the type has been deprecated.
2020-08-30Revert "Merge pull request #96254 from Mic92/logging"Anders Kaseorg2-145/+222
This reverts commit 4fc708567f6d9cf28f9ba426702069aa5a0b89c2, reversing changes made to 0e54f3a6d8393c31cfae43316904375dcfc77a46. Fixes #96699. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2020-08-30Revert "Merge pull request #96152 from JJJollyjim/colour-test-machines-staging"Anders Kaseorg1-13/+2
This reverts commit 1bff6fe17cbf3e81fbd4122af41d77ea378f45d7, reversing changes made to 2995fa48cb4878756b9d64b27535737278d96f07. There’s presumably nothing wrong with this PR, except that it conflicts with reverting #96254 which broke several tests (#96699). Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2020-08-29nixos/test-driver: Use guest time when using sleepaszlig1-1/+2
With the Perl driver, machine.sleep(N) was doing a sleep on the guest machine instead of the host machine. The new Python test driver however uses time.sleep(), which instead sleeps on the host. While this shouldn't make a difference most of the time, it *does* however make a huge difference if the test machine is loaded and you're sleeping for a minimum duration of eg. an animation. I stumbled on this while porting most of all my tests to the new Python test driver and particularily my video game tests failed on a fairly loaded machine, whereas they don't with the Perl test driver. Switching the sleep() method to sleep on the guest instead of the host fixes this. Signed-off-by: aszlig <aszlig@nix.build>
2020-08-27nixos/lib/test*: remove perl test driverFlorian Klink4-1258/+0
This has been deprecated in 20.03, and all tests have been migrated to the python framework, effectively making this dead code.
2020-08-27nixos/test: colour machine namesJamie McClymont1-2/+13
2020-08-26Merge pull request #96254 from Mic92/loggingJörg Thalheim2-222/+145
2020-08-26Merge pull request #95956 from matthewbauer/qemu-cpu-maxMatthew Bauer1-2/+2
runInLinuxVM, test-driver: use -cpu max instead of -cpu host
2020-08-25nixos/test-driver: re-introduce log()Jörg Thalheim1-0/+3
Appearantly this is used in tests
2020-08-25nixos/testdriver: sort importsJörg Thalheim1-7/+8
2020-08-25nixos/test-driver: switch to pythons' logging libJörg Thalheim2-215/+128
- Less code - more thread-safe according to @flokli
2020-08-25nixos/test-driver: introduce main methodJörg Thalheim1-2/+8
This way we not accidentally use introduce/use global variables. Also it explictly mark the code for the mypy type checker.
2020-08-24Merge pull request #51850 from roberth/nixos-pureSilvan Mosberger1-2/+2
nixos/lib/eval-config.nix: Add extraModules parameter for opt-in purity
2020-08-21runInLinuxVM, test-driver: use -cpu max instead of -cpu hostMatthew Bauer1-2/+2
This appears to avoid requiring KVM when it’s not available. This is what I originally though -cpu host did. Unfortunately not much documentation available from the QEMU side on this, but this appears to square with help: $ qemu-system-x86 -cpu help ... x86 host KVM processor with all supported host features x86 max Enables all features supported by the accelerator in the current host ... Whether we actually want to support this not clear, since this only happens when your CPU doesn’t have full KVM support. Some Nix builders are lying about kvm support though. Things aren’t too slow without it though. Fixes https://github.com/NixOS/nixpkgs/issues/85394 Alternative to https://github.com/NixOS/nixpkgs/pull/83920
2020-08-21nixos/testing: Fix fail() functionJanne Heß1-2/+5
The docs say this behaves as succeed(), but it does not return stdout as succeed() does. This fixes that behaviour
2020-08-08Merge pull request #93824 from blitz/fix-rpi4-installerJacek Galowicz1-1/+4
Fix Raspberry Pi 4B SD-Card Install Image
2020-08-03Merge pull request #94611 from Ma27/rel-pkgs-error-msgMaximilian Bosch1-3/+3
nixos/manual: improve error message for invalid values in `relatedPackages'
2020-08-03nixos/manual: improve error message for invalid values in `relatedPackages'Maximilian Bosch1-3/+3
As reported in NixOS discourse[1], tracking down invalid values in `relatedPackages'[2] (i.e. list-items that don't exist in `pkgs`) is fairly hard as the message "Invalid package attribute path `foobar'" is quite unhelpful and the trace doesn't point to the source of the problem either. This patch improves the error message by mentioning that the issue is an invalid `relatedPackages`-declaration in $optionName. [1] https://discourse.nixos.org/t/invalid-package-attribute-path-nextcloud19/8403/9 [2] https://nixos.org/nixpkgs/manual/#sec-functions-library-options
2020-08-04nixos/lib/*: editorconfig fixeszowoq1-4/+4
2020-07-31nixos/lib/make-disk-image.nix: abritary format inputEmery Hemingway1-1/+1
Pass unrecognized format types as the output file extension to qemu-img. The motivation is support for "vdi" output.
2020-07-29nixos/boot: some documentation improvementsKeshav Kini1-3/+5
- Give a more accurate description of how fileSystems.<name/>.neededForBoot works - Give a more detailed description of how fileSystems.<name/>.encrypted.keyFile works
2020-07-28Merge pull request #89331 from Lassulus/make-disk-imageLassulus1-23/+56
make-disk-image: add hybrid and dynamic sized images
2020-07-27make-disk-image: add hybrid and dynamic sized imageslassulus1-23/+56
2020-07-26nixos/lib/make-ext4-fs: fix after mkfs.ext4 refactoringJulian Stecklina1-1/+4
In 9ac1ab10c963a86457c2c9b1edf31542ff3737cd this library function was refactored to use mkfs.ext4 instead of cptofs. There are two problems: If populateImageCommands would create no files (which is fine), a cp invocation would fail due to missing source arguments. Another problem is that mkfs.ext4 relies on fakeroot to have sane uid/gids in the generated filesystem image. This currently doesn't work for cross compiling.
2020-07-21Merge pull request #74174 from raboof/fix-74047-stable-gpt-disk-guidTimo Kaufmann2-11/+7
make-iso9660-image: produce stable GPT disk GUID
2020-07-20lib: toHex -> toHexString & toBase -> toBaseDigitsBas van Dijk1-1/+1
This makes the type of these functions more apparent from the name.
2020-07-20nixos/tests/networking.nix: test the services.dhcpd4.machines optionBas van Dijk1-2/+3
This modifies the `router` to not give out a range of IP addresses but only give out a fixed address based on the MAC address using the `services.dhcpd4.machines` option. To get access to the MAC address the `qemuNicMac` function is defined and exported from `qemu-flags.nix`.
2020-07-20nixos/tests: support up to 255 nodes in NixOS testsBas van Dijk1-1/+5
2020-07-20make-iso9660-image: produce stable GPT disk GUIDArnout Engelen2-11/+7
By generating a version-5 GUID based on $out (which contains the derivation hash) and preventing isohybrid from overwriting the GPT table (which already is populated correctly by xorriso). Tested by: * booting from USB disk on a UEFI system * booting from USB disk on a non-UEFI system * booting from CD on a UEFI system * booting from CD on a non-UEFI system * booting from CD on an OSX system Also tested that "nix-build ./nixos/release-combined.nix -A nixos.iso_minimal.x86_64-linux -I nixpkgs=~/nixpkgs-r13y --check" now succeeds. Fixes #74047
2020-07-10nixos make-disk-image: fix permissions of /buildlassulus1-0/+1
This was broken in 460c0d6 (PR #90431); now the nixos-unstable channel should get unblocked. vcunat modified this commit to use env-var instead of hardcoding /build
2020-07-06nixos/test-driver: print a traceback when testScript fails (#92369)Justinas Stankevičius1-1/+3
* print a traceback: assertion message can be empty * change print back to eprint
2020-07-01Merge pull request #82718 from misuzu/armv7l-ext4-fs-fixSamuel Dionne-Riel1-20/+19
nixos/lib/make-ext4-fs: use mkfs.ext4 instead of cptofs
2020-07-01nixos/lib/make-ext4-fs: use mkfs.ext4 instead of cptofsmisuzu1-20/+19
This fixes image creation on armv7l when image is bigger than 2G. Also fix some reproducibility issues and other cptofs issues.
2020-07-01Merge pull request #65231 from buckley310/grub-passwordMichele Guerini Rocco1-0/+23
grub: add support for passwords
2020-06-30testing-python: fix typoAlexandre Esteves1-1/+1
2020-06-28Merge pull request #91046 from NinjaTrappeur/nin-delete-vm-stateFlorian Klink1-2/+18
test-driver.py: delete VM state directory after test run
2020-06-24nixos/lib/test-driver: add wait_for_console_textrnhmjoj1-0/+23
This method is similar to wait_for_text but is based on matching serial console lines instead of the VGA output.
2020-06-21test-driver.py: delete VM state directory after test runFélix Baylac-Jacqué1-2/+18
Keeping the VM state test across several run sometimes lead to subtle and hard to spot errors in practice. We delete the VM state which contains (among other things) the qcow volume. We also introduce a -K (--keep-vm-state) flag making VM state to persist after the test run. This flag makes test-driver.py to match its previous behaviour.
2020-06-21nixos/make-ext4-fs: increase fudge factor from 1.03 to 1.10Florian Klink1-1/+1
Turns out, on smaller images (~800MiB uncompressed sdcard image size), the current fudge factor is way too small to even get the system to the phase where it can resize itself. I first tried with 1.05, but it wasn't enough.
2020-06-14Merge pull request #90261 from prusnak/installer-zstd-rmPeter Hoeg1-1/+1
images: remove original files when using zstd for compression
2020-06-14images: remove original files when using zstd for compressionPavol Rusnak1-1/+1
2020-06-13nixos/lib/make-disk-image.nix: VDI supportEmery Hemingway1-1/+2
2020-06-09nixos/make-iso9660: fix zstd inputFinn Behrens1-1/+1
2020-06-07Merge pull request #85947 from prusnak/images-zstdMarek Mahut2-4/+9
Use zstd for ISO and SD images
2020-06-01Merge pull request #82258 from erikarvstedt/fix-xchg-cachingFlorian Klink1-6/+0
fix inconsistent caching of VM xchg dirs