mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-06 05:13:37 +00:00
nixos-test-driver: Make overridable
This commit is contained in:
@@ -64,6 +64,7 @@ let
|
||||
eval = nixos-lib.evalTest {
|
||||
# Avoid evaluating a NixOS config prototype.
|
||||
config.node.type = types.deferredModule;
|
||||
config.hostPkgs = pkgs;
|
||||
options._module.args = mkOption { internal = true; };
|
||||
};
|
||||
in
|
||||
|
||||
@@ -211,6 +211,9 @@
|
||||
"test-opt-nodeDefaults": [
|
||||
"index.html#test-opt-nodeDefaults"
|
||||
],
|
||||
"test-opt-pythonTestDriverPackage": [
|
||||
"index.html#test-opt-pythonTestDriverPackage"
|
||||
],
|
||||
"test-opt-rawTestDerivationArg": [
|
||||
"index.html#test-opt-rawTestDerivationArg"
|
||||
],
|
||||
|
||||
@@ -9,15 +9,10 @@ let
|
||||
|
||||
# Reifies and correctly wraps the python test driver for
|
||||
# the respective qemu version and with or without ocr support
|
||||
testDriver = hostPkgs.python3Packages.callPackage ../test-driver {
|
||||
testDriver = config.pythonTestDriverPackage.override {
|
||||
inherit (config) enableOCR extraPythonPackages;
|
||||
qemu_pkg = config.qemu.package;
|
||||
imagemagick_light = hostPkgs.imagemagick_light.override { inherit (hostPkgs) libtiff; };
|
||||
tesseract4 = hostPkgs.tesseract4.override { enableLanguages = [ "eng" ]; };
|
||||
|
||||
enableNspawn = config.containers != { };
|
||||
# We want `pkgs.systemd`, *not* `python3Packages.system`.
|
||||
systemd = hostPkgs.systemd;
|
||||
};
|
||||
|
||||
vlans = map (
|
||||
@@ -135,6 +130,12 @@ let
|
||||
in
|
||||
{
|
||||
options = {
|
||||
pythonTestDriverPackage = mkOption {
|
||||
description = "Package containing the python NixOS test driver implemetnation";
|
||||
type = types.package;
|
||||
default = hostPkgs.nixos-test-driver;
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
driver = mkOption {
|
||||
description = "Package containing a script that runs the test.";
|
||||
|
||||
@@ -146,6 +146,14 @@ with pkgs;
|
||||
|
||||
inherit (nix-update) nix-update-script;
|
||||
|
||||
nixos-test-driver = pkgs.python3Packages.callPackage ../../nixos/lib/test-driver {
|
||||
qemu_pkg = pkgs.qemu;
|
||||
imagemagick_light = pkgs.imagemagick_light.override { inherit (pkgs) libtiff; };
|
||||
tesseract4 = pkgs.tesseract4.override { enableLanguages = [ "eng" ]; };
|
||||
# We want `pkgs.systemd`, *not* `python3Packages.system`.
|
||||
systemd = pkgs.systemd;
|
||||
};
|
||||
|
||||
### Push NixOS tests inside the fixed point
|
||||
|
||||
# See also allTestsForSystem in nixos/release.nix
|
||||
|
||||
Reference in New Issue
Block a user