summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authoraanderse <aaron@fosslib.net>2018-10-27 13:01:30 -0400
committerRenaud <c0bw3b@users.noreply.github.com>2018-10-27 19:01:30 +0200
commit1381019e49b8403aaf10c9b3ecb80e138d7e304d (patch)
treecf225ccd96dcde8e689a89e5ce58328ef29d7427 /nixos/tests
parentd6a15b09c788a1acf4b39ef6aecdb8b2757e3f1b (diff)
downloadnixlib-1381019e49b8403aaf10c9b3ecb80e138d7e304d.tar
nixlib-1381019e49b8403aaf10c9b3ecb80e138d7e304d.tar.gz
nixlib-1381019e49b8403aaf10c9b3ecb80e138d7e304d.tar.bz2
nixlib-1381019e49b8403aaf10c9b3ecb80e138d7e304d.tar.lz
nixlib-1381019e49b8403aaf10c9b3ecb80e138d7e304d.tar.xz
nixlib-1381019e49b8403aaf10c9b3ecb80e138d7e304d.tar.zst
nixlib-1381019e49b8403aaf10c9b3ecb80e138d7e304d.zip
nixos/rsyslogd & nixos/syslog-ng: fix broken module (#47306)
* journald: forward message to syslog by default if a syslog implementation is installed

* added a test to ensure rsyslog is receiving messages when expected

* added rsyslogd tests to release.nix
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/rsyslogd.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixos/tests/rsyslogd.nix b/nixos/tests/rsyslogd.nix
new file mode 100644
index 000000000000..4836419f0c2f
--- /dev/null
+++ b/nixos/tests/rsyslogd.nix
@@ -0,0 +1,37 @@
+{ system ? builtins.currentSystem }:
+
+with import ../lib/testing.nix { inherit system; };
+{
+  test1 = makeTest {
+    name = "rsyslogd-test1";
+    meta.maintainers = [ lib.maintainers.aanderse ];
+
+    machine =
+      { config, pkgs, ... }:
+      { services.rsyslogd.enable = true;
+        services.journald.forwardToSyslog = false;
+      };
+
+    # ensure rsyslogd isn't receiving messages from journald if explicitly disabled
+    testScript = ''
+      $machine->waitForUnit("default.target");
+      $machine->fail("test -f /var/log/messages");
+    '';
+  };
+
+  test2 = makeTest {
+    name = "rsyslogd-test2";
+    meta.maintainers = [ lib.maintainers.aanderse ];
+
+    machine =
+      { config, pkgs, ... }:
+      { services.rsyslogd.enable = true;
+      };
+
+    # ensure rsyslogd is receiving messages from journald
+    testScript = ''
+      $machine->waitForUnit("default.target");
+      $machine->succeed("test -f /var/log/messages");
+    '';
+  };
+}