mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-13 12:38:32 +00:00
nixos/testing-python: Copy test script derivations to nodes
Make sure the all derivations referenced by the test script are available on the nodes. Accessing these derivations works just fine without this change when using 9p to mount the host's store, but when an image is built (virtualisation.buildRootImage), the dependencies need to be copied to the image. We don't want to copy the script itself, though, since that would trigger unnecessary image rebuilds.
This commit is contained in:
parent
aa22fa9c0b
commit
329a4461a7
@ -209,11 +209,30 @@ rec {
|
||||
let
|
||||
nodes = qemu_pkg:
|
||||
let
|
||||
testScript' =
|
||||
# Call the test script with the computed nodes.
|
||||
if lib.isFunction testScript
|
||||
then testScript { nodes = nodes qemu_pkg; }
|
||||
else testScript;
|
||||
|
||||
build-vms = import ./build-vms.nix {
|
||||
inherit system lib pkgs minimal specialArgs;
|
||||
extraConfigurations = extraConfigurations ++ [(
|
||||
{
|
||||
virtualisation.qemu.package = qemu_pkg;
|
||||
|
||||
# Make sure all derivations referenced by the test
|
||||
# script are available on the nodes. When the store is
|
||||
# accessed through 9p, this isn't important, since
|
||||
# everything in the store is available to the guest,
|
||||
# but when building a root image it is, as all paths
|
||||
# that should be available to the guest has to be
|
||||
# copied to the image.
|
||||
virtualisation.additionalPaths =
|
||||
lib.optional
|
||||
(builtins.hasContext testScript')
|
||||
(pkgs.writeStringReferencesToFile testScript');
|
||||
|
||||
# Ensure we do not use aliases. Ideally this is only set
|
||||
# when the test framework is used by Nixpkgs NixOS tests.
|
||||
nixpkgs.config.allowAliases = false;
|
||||
|
Loading…
Reference in New Issue
Block a user