about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-04-07 22:52:46 +0200
committerGitHub <noreply@github.com>2024-04-07 22:52:46 +0200
commitd217732cef37202ddf41e092311be8811442ee70 (patch)
treeb1a843b701b05c2604d93945568dc03c6780e47c /nixos/tests
parent668834f72c7a082bdb823d1367a9abea15ebfcad (diff)
parentd30b2fe2d29aeda62e116543f244d73373152a84 (diff)
Merge pull request #302195 from anthonyroussel/fix-oddjobd
nixos/oddjobd: enable dbus service to fix service startup
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/oddjobd.nix23
2 files changed, 24 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index c5af2ce1fccbc..20c7edbd26786 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -652,6 +652,7 @@ in {
   nzbget = handleTest ./nzbget.nix {};
   nzbhydra2 = handleTest ./nzbhydra2.nix {};
   ocis = handleTest ./ocis.nix {};
+  oddjobd = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./oddjobd.nix {};
   oh-my-zsh = handleTest ./oh-my-zsh.nix {};
   ollama = handleTest ./ollama.nix {};
   ombi = handleTest ./ombi.nix {};
diff --git a/nixos/tests/oddjobd.nix b/nixos/tests/oddjobd.nix
new file mode 100644
index 0000000000000..cc2d4079eebc9
--- /dev/null
+++ b/nixos/tests/oddjobd.nix
@@ -0,0 +1,23 @@
+import ./make-test-python.nix ({ pkgs, lib, ... }: {
+  name = "oddjobd";
+  meta.maintainers = [ lib.maintainers.anthonyroussel ];
+
+  nodes.machine = { ... } : {
+    environment.systemPackages = [
+      pkgs.oddjob
+    ];
+
+    programs.oddjobd.enable = true;
+  };
+
+  testScript = ''
+    start_all()
+
+    machine.wait_for_unit("oddjobd.service")
+    machine.wait_for_file("/run/oddjobd.pid")
+
+    with subtest("send oddjob listall request"):
+      result = machine.succeed("oddjob_request -s com.redhat.oddjob -o /com/redhat/oddjob -i com.redhat.oddjob listall")
+      assert ('(service="com.redhat.oddjob",object="/com/redhat/oddjob",interface="com.redhat.oddjob",method="listall")' in result)
+  '';
+})