From 9d53926782b6c857ebdf9682137068f9cbcdb5d5 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 3 Aug 2023 09:47:58 +0100 Subject: [PATCH] tests: fix uses of `!` `set -e` does not trigger on negations, so none of these were actually being tested (and one appears to have been incorrectly negated all along). --- tests/checks-nix-gc.nix | 2 +- tests/nixpkgs-overlays.nix | 2 +- tests/services-nix-daemon.nix | 2 +- tests/services-nix-gc.nix | 6 +++--- tests/sockets-nix-daemon.nix | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/checks-nix-gc.nix b/tests/checks-nix-gc.nix index 75700cc..e3dccd7 100644 --- a/tests/checks-nix-gc.nix +++ b/tests/checks-nix-gc.nix @@ -14,6 +14,6 @@ in echo checking nix-gc service in /Library/LaunchDaemons >&2 grep "org.nixos.nix-gc" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist - ! grep "UserName" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist + (! grep "UserName" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist) ''; } diff --git a/tests/nixpkgs-overlays.nix b/tests/nixpkgs-overlays.nix index aa03bf1..59540ac 100644 --- a/tests/nixpkgs-overlays.nix +++ b/tests/nixpkgs-overlays.nix @@ -10,7 +10,7 @@ test = '' echo checking /bin/hello >&2 - ! ${pkgs.hello}/bin/hello + (! ${pkgs.hello}/bin/hello) ''; } diff --git a/tests/services-nix-daemon.nix b/tests/services-nix-daemon.nix index 5405d01..3a217cb 100644 --- a/tests/services-nix-daemon.nix +++ b/tests/services-nix-daemon.nix @@ -19,7 +19,7 @@ in grep "&&" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist grep "exec ${nix}/bin/nix-daemon" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist grep "KeepAlive" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist - ! grep "Sockets" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist + (! grep "Sockets" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist) echo checking NIX_SSL_CERT_FILE in nix-daemon service >&2 grep "NIX_SSL_CERT_FILE" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist diff --git a/tests/services-nix-gc.nix b/tests/services-nix-gc.nix index e28c3df..4ef26b5 100644 --- a/tests/services-nix-gc.nix +++ b/tests/services-nix-gc.nix @@ -15,11 +15,11 @@ in grep "org.nixos.nix-gc" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist grep "exec ${nix}/bin/nix-collect-garbage --delete-older-than 30d" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist grep "UserName" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist - ! grep "nixuser" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist + grep "nixuser" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist - ! grep "KeepAlive" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist + (! grep "KeepAlive" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist) echo checking nix-gc validation >&2 - ! grep "nix.gc.user = " ${config.out}/activate-user + (! grep "nix.gc.user = " ${config.out}/activate-user) ''; } diff --git a/tests/sockets-nix-daemon.nix b/tests/sockets-nix-daemon.nix index 0eb09a7..606b7b6 100644 --- a/tests/sockets-nix-daemon.nix +++ b/tests/sockets-nix-daemon.nix @@ -16,7 +16,7 @@ in grep "/bin/wait4path" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist grep "&&" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist grep "exec ${nix}/bin/nix-daemon" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist - ! grep "KeepAlive" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist + (! grep "KeepAlive" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist) grep "Sockets" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist grep "/nix/var/nix/daemon-socket/socket" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist '';