Skip to content

Commit

Permalink
nixos.tests.systemd-journal: add basic systemd-journal-gatewayd test
Browse files Browse the repository at this point in the history
This test allows to ensure the systemd-journal-gatewayd service is
responding correcly when the NixOS option `enableHttpGateway` is set.

The test has not been added into the main systemd test because a
graphical stack is not required (and rebuilding the graphical stack on
systemd change is huge).
  • Loading branch information
nlewo committed Nov 2, 2020
1 parent 859a44e commit 81063ee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Expand Up @@ -340,6 +340,7 @@ in
systemd-binfmt = handleTestOn ["x86_64-linux"] ./systemd-binfmt.nix {};
systemd-boot = handleTest ./systemd-boot.nix {};
systemd-confinement = handleTest ./systemd-confinement.nix {};
systemd-journal = handleTest ./systemd-journal.nix {};
systemd-timesyncd = handleTest ./systemd-timesyncd.nix {};
systemd-networkd-vrf = handleTest ./systemd-networkd-vrf.nix {};
systemd-networkd = handleTest ./systemd-networkd.nix {};
Expand Down
20 changes: 20 additions & 0 deletions 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\"'"
)
'';
})

0 comments on commit 81063ee

Please sign in to comment.