nixos/tests: only apply qemu parameters if the options are defined #101645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
This fixes an eval error that occurred on hydra with the small channel
and the
nixos.tests.boot.biosCdrom.x86_64-linux
attribute: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..
Things done
nix-instantiate nixos/release-small.nix -A "nixos.channel"
nix-instantiate nixos/release-small.nix -A "nixos.dummy.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.iso_minimal.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.manual.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.boot.biosCdrom.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.containers-imperative.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.containers-ip.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.firewall.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.installer.lvm.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.installer.separateBoot.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.installer.simple.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.ipv6.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.login.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.misc.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.nat.firewall-conntrack.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.nat.firewall.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.nat.standalone.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.nfs3.simple.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.openssh.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.php.fpm.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.php.pcre.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.predictable-interface-names.predictable.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.predictable-interface-names.predictableNetworkd.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.predictable-interface-names.unpredictable.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.predictable-interface-names.unpredictableNetworkd.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.proxy.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixos.tests.simple.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixpkgs.jdk.x86_64-linux"
nix-instantiate nixos/release-small.nix -A "nixpkgs.tarball"
This is the outcome of a discussion over at #101598 (comment)
cc @xaverdh