Skip to content

Commit

Permalink
Merge pull request #1068 from emilazy/push-lkuxlvpkttsn
Browse files Browse the repository at this point in the history
tests/{networking-hostname,users-groups}: update for `lib.escapeShellArg` change
  • Loading branch information
emilazy committed Sep 10, 2024
2 parents 4c96bd6 + 95f063e commit 8220423
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/networking-hostname.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ lib, config, pkgs, ... }:

{
networking.hostName = "EVE";
Expand All @@ -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
'';
}
6 changes: 3 additions & 3 deletions tests/users-groups.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ lib, config, pkgs, ... }:

{
users.knownGroups = [ "foo" "created.group" "deleted.group" ];
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8220423

Please sign in to comment.