diff options
author | Robert Hensing <robert@roberthensing.nl> | 2022-06-22 01:12:01 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-09-24 17:38:09 +0100 |
commit | 24d1d74e4e61e53326b7ed059528693afd17cc50 (patch) | |
tree | b7ae26db2a9901dcdb8c12950948bfd3b2778d4c /nixos/lib/testing | |
parent | 38fb09e4278ca3e836da2c175dbff815c06b0632 (diff) | |
download | nixpkgs-24d1d74e4e61e53326b7ed059528693afd17cc50.tar nixpkgs-24d1d74e4e61e53326b7ed059528693afd17cc50.tar.gz nixpkgs-24d1d74e4e61e53326b7ed059528693afd17cc50.tar.bz2 nixpkgs-24d1d74e4e61e53326b7ed059528693afd17cc50.tar.lz nixpkgs-24d1d74e4e61e53326b7ed059528693afd17cc50.tar.xz nixpkgs-24d1d74e4e61e53326b7ed059528693afd17cc50.tar.zst nixpkgs-24d1d74e4e61e53326b7ed059528693afd17cc50.zip |
nixos/testing: Extract nixos-test-base.nix NixOS module
Diffstat (limited to 'nixos/lib/testing')
-rw-r--r-- | nixos/lib/testing/nixos-test-base.nix | 23 | ||||
-rw-r--r-- | nixos/lib/testing/nodes.nix | 13 |
2 files changed, 24 insertions, 12 deletions
diff --git a/nixos/lib/testing/nixos-test-base.nix b/nixos/lib/testing/nixos-test-base.nix new file mode 100644 index 00000000000..59e6e384336 --- /dev/null +++ b/nixos/lib/testing/nixos-test-base.nix @@ -0,0 +1,23 @@ +# A module containing the base imports and overrides that +# are always applied in NixOS VM tests, unconditionally, +# even in `inheritParentConfig = false` specialisations. +{ lib, ... }: +let + inherit (lib) mkForce; +in +{ + imports = [ + ../../modules/virtualisation/qemu-vm.nix + ../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs + { key = "no-manual"; documentation.nixos.enable = false; } + { + key = "no-revision"; + # Make the revision metadata constant, in order to avoid needless retesting. + # The human version (e.g. 21.05-pre) is left as is, because it is useful + # for external modules that test with e.g. testers.nixosTest and rely on that + # version number. + config.system.nixos.revision = mkForce "constant-nixos-revision"; + } + + ]; +} diff --git a/nixos/lib/testing/nodes.nix b/nixos/lib/testing/nodes.nix index 98580d5dc4f..a83c2a52d3a 100644 --- a/nixos/lib/testing/nodes.nix +++ b/nixos/lib/testing/nodes.nix @@ -12,19 +12,8 @@ let modules = [ config.defaults ]; baseModules = (import ../../modules/module-list.nix) ++ [ - ../../modules/virtualisation/qemu-vm.nix - ../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs - { key = "no-manual"; documentation.nixos.enable = false; } - { - key = "no-revision"; - # Make the revision metadata constant, in order to avoid needless retesting. - # The human version (e.g. 21.05-pre) is left as is, because it is useful - # for external modules that test with e.g. testers.nixosTest and rely on that - # version number. - config.system.nixos.revision = mkForce "constant-nixos-revision"; - } + ./nixos-test-base.nix { key = "nodes"; _module.args.nodes = nodes; } - ({ config, ... }: { virtualisation.qemu.package = testModuleArgs.config.qemu.package; |