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