about summary refs log tree commit diff
path: root/nixos/tests/systemd-journal.nix
blob: d2063a3b9a44e41e2be4a6baef2aaed310cc98c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import ./make-test-python.nix ({ pkgs, ... }:

{
  name = "systemd-journal";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ lewo ];
  };

  nodes.machine = { pkgs, lib, ... }: {
    services.journald.enableHttpGateway = true;
  };

  testScript = ''
    machine.wait_for_unit("multi-user.target")

    machine.succeed("journalctl --grep=systemd")

    machine.succeed(
        "${pkgs.curl}/bin/curl -s localhost:19531/machine | ${pkgs.jq}/bin/jq -e '.hostname == \"machine\"'"
    )
  '';
})