diff options
author | Antoine Eiche <lewo@abesis.fr> | 2020-11-01 18:48:40 +0100 |
---|---|---|
committer | Antoine Eiche <lewo@abesis.fr> | 2020-11-02 09:07:52 +0100 |
commit | 81063ee414ecf461f697b54678dad3163fe37e38 (patch) | |
tree | a9df44f27627723a6fd8be8719315a2835f4d6fd /nixos/tests/systemd-journal.nix | |
parent | 859a44ebc0b4f54c8053884c9bf1d8496ada0bf8 (diff) |
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).
Diffstat (limited to 'nixos/tests/systemd-journal.nix')
-rw-r--r-- | nixos/tests/systemd-journal.nix | 20 |
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 0000000000000..c50c151ae10d8 --- /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\"'" + ) + ''; +}) |