summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2019-03-22 20:49:53 +0100
committerDaiderd Jordan <daiderd@gmail.com>2019-03-22 20:49:53 +0100
commitaf7cd05699fea0d782e9f23a98d73bd2e696061b (patch)
treefa2535b020388d8d3f26ce23eda4ce5c272253c4
parentb68f77b404af4b2200fd3229a4fd16ef09d0edf9 (diff)
launchd: add basic test for daemons/agents
-rw-r--r--release.nix1
-rw-r--r--tests/launchd-daemons.nix17
2 files changed, 18 insertions, 0 deletions
diff --git a/release.nix b/release.nix
index 8445f2f..ae282cd 100644
--- a/release.nix
+++ b/release.nix
@@ -92,6 +92,7 @@ let
tests.activation-scripts = makeTest ./tests/activation-scripts.nix;
tests.checks-nix-gc = makeTest ./tests/checks-nix-gc.nix;
tests.environment-path = makeTest ./tests/environment-path.nix;
+ tests.launchd-daemons = makeTest ./tests/launchd-daemons.nix;
tests.launchd-setenv = makeTest ./tests/launchd-setenv.nix;
tests.networking-hostname = makeTest ./tests/networking-hostname.nix;
tests.networking-networkservices = makeTest ./tests/networking-networkservices.nix;
diff --git a/tests/launchd-daemons.nix b/tests/launchd-daemons.nix
new file mode 100644
index 0000000..59e35aa
--- /dev/null
+++ b/tests/launchd-daemons.nix
@@ -0,0 +1,17 @@
+{ config, pkgs, ... }:
+
+{
+ launchd.daemons.foo.command = "foo";
+ launchd.agents.bar.command = "bar";
+ launchd.user.agents.baz.command = "baz";
+
+ test = ''
+ echo "checking launchd load in /activate" >&2
+ grep "launchctl load .* '/Library/LaunchDaemons/org.nixos.foo.plist" ${config.out}/activate
+ grep "launchctl load .* '/Library/LaunchAgents/org.nixos.bar.plist" ${config.out}/activate
+ echo "checking launchd load in /activate-user" >&2
+ grep "launchctl load .* ~/Library/LaunchAgents/org.nixos.baz.plist" ${config.out}/activate-user
+ echo "checking LaunchAgents creation /activate-user" >&2
+ grep "mkdir -p ~/Library/LaunchAgents" ${config.out}/activate-user
+ '';
+}