From 81063ee414ecf461f697b54678dad3163fe37e38 Mon Sep 17 00:00:00 2001 From: Antoine Eiche Date: Sun, 1 Nov 2020 18:48:40 +0100 Subject: nixos.tests.systemd-journal: add basic systemd-journal-gatewayd test 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). --- nixos/tests/all-tests.nix | 1 + nixos/tests/systemd-journal.nix | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 nixos/tests/systemd-journal.nix (limited to 'nixos') diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 9ffeba27a7f..02ac737dbe1 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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 {}; 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\"'" + ) + ''; +}) -- cgit 1.4.1