1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

users: add test for group membership

This commit is contained in:
Daiderd Jordan 2018-01-14 13:31:15 +01:00
parent b1645201f1
commit ca420b2f9e
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -4,6 +4,7 @@
users.knownGroups = [ "foo" "created.group" "deleted.group" ];
users.groups.foo.gid = 42000;
users.groups.foo.description = "Foo group";
users.groups.foo.members = [ "admin" "foo" ];
users.groups."created.group".gid = 42001;
users.groups."unknown.group".gid = 42002;
@ -30,6 +31,10 @@
grep "dscl . -delete '/Groups/deleted.group'" ${config.out}/activate
grep -qv "dscl . -create '/Groups/deleted.group'" ${config.out}/activate
echo "checking group membership in /activate" >&2
grep "dscl . -create '/Groups/foo' GroupMembership 'admin' 'foo'" ${config.out}/activate
grep "dscl . -create '/Groups/created.group' GroupMembership" ${config.out}/activate
echo "checking unknown group in /activate" >&2
grep -qv "dscl . -create '/Groups/unknown.group'" ${config.out}/activate
grep -qv "dscl . -delete '/Groups/unknown.group'" ${config.out}/activate