1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

add test for security.accessibilityPrograms

This commit is contained in:
Daiderd Jordan 2017-05-16 00:11:05 +02:00
parent cf3c3cb082
commit 9b1a061ea8
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 15 additions and 5 deletions

View file

@ -89,18 +89,15 @@ let
examples.simple = genExample ./modules/examples/simple.nix;
tests.environment-path = makeTest ./tests/environment-path.nix;
tests.launchd-setenv = makeTest ./tests/launchd-setenv.nix;
tests.security-accessibility-programs = makeTest ./tests/security-accessibility-programs.nix;
tests.services-activate-system = makeTest ./tests/services-activate-system.nix;
tests.system-defaults-write = makeTest ./tests/system-defaults-write.nix;
tests.system-packages = makeTest ./tests/system-packages.nix;
tests.system-path-bash = makeTest ./tests/system-path-bash.nix;
tests.system-path-fish = makeTest ./tests/system-path-fish.nix;
tests.system-path-zsh = makeTest ./tests/system-path-zsh.nix;
tests.launchd-setenv = makeTest ./tests/launchd-setenv.nix;
}
// (mapTestOn (packagePlatforms packageSet));

View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
security.accessibilityPrograms = [ "${pkgs.hello}/bin/hello" ];
test = ''
echo checking sqlite command in /activate >&2
grep "/usr/bin/sqlite3 /Library/Application\\\\ Support/com.apple.TCC/TCC.db" ${config.out}/activate
echo checking sqlite queries /activate >&2
grep "INSERT or REPLACE INTO access VALUES ('kTCCServiceAccessibility','${pkgs.hello}/bin/hello',1,1,1,NULL,NULL)" ${config.out}/activate
grep "DELETE FROM access WHERE client LIKE '/nix/store/%' AND client NOT IN ('${pkgs.hello}/bin/hello')" ${config.out}/activate
'';
}