summary refs log tree commit diff
path: root/nixos/tests/systemd-journal.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests/systemd-journal.nix')
-rw-r--r--nixos/tests/systemd-journal.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixos/tests/systemd-journal.nix b/nixos/tests/systemd-journal.nix
new file mode 100644
index 00000000000..c50c151ae10
--- /dev/null
+++ b/nixos/tests/systemd-journal.nix
@@ -0,0 +1,20 @@
+import ./make-test-python.nix ({ pkgs, ... }:
+
+{
+  name = "systemd-journal";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ lewo ];
+  };
+
+  machine = { pkgs, lib, ... }: {
+    services.journald.enableHttpGateway = true;
+  };
+
+  testScript = ''
+    machine.wait_for_unit("multi-user.target")
+
+    machine.succeed(
+        "${pkgs.curl}/bin/curl -s localhost:19531/machine | ${pkgs.jq}/bin/jq -e '.hostname == \"machine\"'"
+    )
+  '';
+})