From 7573c269a899af49e88007e46154d9a263fac843 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Tue, 4 Apr 2023 20:12:51 +0200 Subject: nixos/tests/apfs: clean up code - Use `runTest` instead of `handleTest`, which simplifies the code a little - Use `lib.maintainers` instead of `pkgs.lib.maintainers` - Remove unused function argument `pkgs` - Change test name in the kernel module from `test` to `apfs`, since that seems to be a common pattern for the name --- nixos/tests/all-tests.nix | 2 +- nixos/tests/apfs.nix | 8 ++++---- pkgs/os-specific/linux/apfs/default.nix | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index e597a26f31b..ba16cd6b883 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -108,7 +108,7 @@ in { alps = handleTest ./alps.nix {}; amazon-init-shell = handleTest ./amazon-init-shell.nix {}; apcupsd = handleTest ./apcupsd.nix {}; - apfs = handleTest ./apfs.nix {}; + apfs = runTest ./apfs.nix; apparmor = handleTest ./apparmor.nix {}; atd = handleTest ./atd.nix {}; atop = handleTest ./atop.nix {}; diff --git a/nixos/tests/apfs.nix b/nixos/tests/apfs.nix index 9fe689951c7..15ed5aa7f57 100644 --- a/nixos/tests/apfs.nix +++ b/nixos/tests/apfs.nix @@ -1,8 +1,8 @@ -import ./make-test-python.nix ({ pkgs, ... }: { +{ lib, ... }: { name = "apfs"; - meta.maintainers = with pkgs.lib.maintainers; [ Luflosi ]; + meta.maintainers = with lib.maintainers; [ Luflosi ]; - nodes.machine = { pkgs, ... }: { + nodes.machine = { virtualisation.emptyDiskImages = [ 1024 ]; boot.supportedFilesystems = [ "apfs" ]; @@ -62,4 +62,4 @@ import ./make-test-python.nix ({ pkgs, ... }: { "apfsck /dev/vdb", ) ''; -}) +} diff --git a/pkgs/os-specific/linux/apfs/default.nix b/pkgs/os-specific/linux/apfs/default.nix index 70c344903f5..590266fab34 100644 --- a/pkgs/os-specific/linux/apfs/default.nix +++ b/pkgs/os-specific/linux/apfs/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation { "INSTALL_MOD_PATH=$(out)" ]; - passthru.tests.test = nixosTests.apfs; + passthru.tests.apfs = nixosTests.apfs; meta = with lib; { description = "APFS module for linux"; -- cgit 1.4.1