Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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.
|
|
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>
|
|
This isn't used anymore as per
https://github.com/NixOS/nixpkgs/pull/72354#discussion_r451031449.
|
|
treewide: completely remove types.loaOf
|
|
Remove the substitution for the <name?> placeholder used by loaOf,
now that the type has been deprecated.
|
|
This reverts commit 4fc708567f6d9cf28f9ba426702069aa5a0b89c2, reversing
changes made to 0e54f3a6d8393c31cfae43316904375dcfc77a46.
Fixes #96699.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
|
|
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>
|
|
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>
|
|
This has been deprecated in 20.03, and all tests have been migrated to
the python framework, effectively making this dead code.
|
|
|
|
|
|
runInLinuxVM, test-driver: use -cpu max instead of -cpu host
|
|
Appearantly this is used in tests
|
|
|
|
- Less code
- more thread-safe according to @flokli
|
|
This way we not accidentally use introduce/use global variables.
Also it explictly mark the code for the mypy type checker.
|
|
nixos/lib/eval-config.nix: Add extraModules parameter for opt-in purity
|
|
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
|
|
The docs say this behaves as succeed(), but it does not return stdout as
succeed() does. This fixes that behaviour
|
|
Fix Raspberry Pi 4B SD-Card Install Image
|
|
nixos/manual: improve error message for invalid values in `relatedPackages'
|
|
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
|
|
|
|
Pass unrecognized format types as the output file extension to
qemu-img. The motivation is support for "vdi" output.
|
|
- Give a more accurate description of how fileSystems.<name/>.neededForBoot
works
- Give a more detailed description of how fileSystems.<name/>.encrypted.keyFile
works
|
|
make-disk-image: add hybrid and dynamic sized images
|
|
|
|
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.
|
|
make-iso9660-image: produce stable GPT disk GUID
|
|
This makes the type of these functions more apparent from the name.
|
|
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`.
|
|
|
|
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
|
|
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
|
|
* print a traceback: assertion message can be empty
* change print back to eprint
|
|
nixos/lib/make-ext4-fs: use mkfs.ext4 instead of cptofs
|
|
This fixes image creation on armv7l when image is bigger than 2G.
Also fix some reproducibility issues and other cptofs issues.
|
|
grub: add support for passwords
|
|
|
|
test-driver.py: delete VM state directory after test run
|
|
This method is similar to wait_for_text but is based on matching
serial console lines instead of the VGA output.
|
|
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.
|
|
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.
|
|
images: remove original files when using zstd for compression
|
|
|
|
|
|
|
|
Use zstd for ISO and SD images
|
|
fix inconsistent caching of VM xchg dirs
|