From 5d798a06571b77d1d5af82b920751aa6951a6c21 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sat, 27 Jan 2024 09:01:17 -0500 Subject: [PATCH] nixos/tests/zfs: decouple makeZfsTest params from unstable vs. stable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enableUnstable was trying to do too much, it’s more obvious to remove the indirection to set zfsPackage and push the semantics up to the caller. --- nixos/tests/zfs.nix | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/nixos/tests/zfs.nix b/nixos/tests/zfs.nix index dd3c68fd095c..0b411b0b9d8a 100644 --- a/nixos/tests/zfs.nix +++ b/nixos/tests/zfs.nix @@ -8,12 +8,9 @@ with import ../lib/testing-python.nix { inherit system pkgs; }; let makeZfsTest = name: - { kernelPackages ? if enableUnstable - then pkgs.zfsUnstable.latestCompatibleLinuxPackages - else pkgs.linuxPackages - , enableUnstable ? false + { kernelPackages , enableSystemdStage1 ? false - , zfsPackage ? if enableUnstable then pkgs.zfsUnstable else pkgs.zfs + , zfsPackage , extraTest ? "" }: makeTest { @@ -197,16 +194,22 @@ in { # maintainer: @raitobezarius series_2_1 = makeZfsTest "2.1-series" { zfsPackage = pkgs.zfs_2_1; + kernelPackages = pkgs.linuxPackages; }; - stable = makeZfsTest "stable" { }; - - unstable = makeZfsTest "unstable" { - enableUnstable = true; + stable = makeZfsTest "stable" { + zfsPackage = pkgs.zfsStable; + kernelPackages = pkgs.linuxPackages; }; - unstableWithSystemdStage1 = makeZfsTest "unstable" { - enableUnstable = true; + unstable = makeZfsTest "unstable" rec { + zfsPackage = pkgs.zfsUnstable; + kernelPackages = zfsPackage.latestCompatibleLinuxPackages; + }; + + unstableWithSystemdStage1 = makeZfsTest "unstable" rec { + zfsPackage = pkgs.zfsUnstable; + kernelPackages = zfsPackage.latestCompatibleLinuxPackages; enableSystemdStage1 = true; };