summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEmily <vcs@emily.moe>2024-09-11 00:32:33 +0100
committerGitHub <noreply@github.com>2024-09-11 00:32:33 +0100
commit8220423c0220d4edcf62dec059ec41e84c7851ef (patch)
treea3c9dadf40cb2f9d677f1dd6e7c8150510757cbd /tests
parent4c96bd694bab9bd872bb2e1b738133342e77966d (diff)
parent95f063ea069e1752ddede8c9823a1b75ddd7858a (diff)
Merge pull request #1068 from emilazy/push-lkuxlvpkttsn
tests/{networking-hostname,users-groups}: update for `lib.escapeShellArg` change
Diffstat (limited to 'tests')
-rw-r--r--tests/networking-hostname.nix6
-rw-r--r--tests/users-groups.nix6
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/networking-hostname.nix b/tests/networking-hostname.nix
index 3793958..9e8c6fd 100644
--- a/tests/networking-hostname.nix
+++ b/tests/networking-hostname.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, ... }:
+{ lib, config, pkgs, ... }:
{
networking.hostName = "EVE";
@@ -7,8 +7,8 @@
test = ''
echo checking hostname in /activate >&2
grep "scutil --set ComputerName 'EVE’s MacBook Pro'" ${config.out}/activate
- grep "scutil --set LocalHostName 'EVE'" ${config.out}/activate
- grep "scutil --set HostName 'EVE'" ${config.out}/activate
+ grep "scutil --set LocalHostName ${lib.escapeShellArg "EVE"}" ${config.out}/activate
+ grep "scutil --set HostName ${lib.escapeShellArg "EVE"}" ${config.out}/activate
echo checking defaults write in ${config.out}/activate-user >&2
'';
}
diff --git a/tests/users-groups.nix b/tests/users-groups.nix
index cefb1ad..feaaf2b 100644
--- a/tests/users-groups.nix
+++ b/tests/users-groups.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, ... }:
+{ lib, config, pkgs, ... }:
{
users.knownGroups = [ "foo" "created.group" "deleted.group" ];
@@ -46,9 +46,9 @@
grep "dscl . -create '/Users/foo' IsHidden 0" ${config.out}/activate
grep "dscl . -create '/Users/foo' RealName 'Foo user'" ${config.out}/activate
grep "dscl . -create '/Users/foo' NFSHomeDirectory '/Users/foo'" ${config.out}/activate
- grep "dscl . -create '/Users/foo' UserShell '/run/current-system/sw/bin/bash'" ${config.out}/activate
+ grep "dscl . -create '/Users/foo' UserShell ${lib.escapeShellArg "/run/current-system/sw/bin/bash"}" ${config.out}/activate
grep "dscl . -create '/Users/created.user' UniqueID 42001" ${config.out}/activate
- grep "dscl . -create '/Users/created.user' UserShell '/sbin/nologin'" ${config.out}/activate
+ grep "dscl . -create '/Users/created.user' UserShell ${lib.escapeShellArg "/sbin/nologin"}" ${config.out}/activate
grep "createhomedir -cu 'foo'" ${config.out}/activate
grep -qv "dscl . -delete '/Groups/created.user'" ${config.out}/activate