summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-10-11 20:45:25 +0200
committerFlorian Klink <flokli@flokli.de>2020-10-11 20:46:21 +0200
commita61ca0373b63225e3aa00556c8fc1fb36abcbe3e (patch)
tree88818932e2c0a516200377bf79cc983af043f4d1 /nixos
parent8294af02845210169290240e6fd356f6b7ea3f11 (diff)
nixosTests.avahi: add avahi-with-resolved
This allows testing avahi works with resolved being enabled, as a regression test for https://github.com/NixOS/nixpkgs/pull/99530.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/avahi.nix13
2 files changed, 13 insertions, 1 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 0dc14e527d12..5512a63e346a 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -26,6 +26,7 @@ in
agda = handleTest ./agda.nix {};
atd = handleTest ./atd.nix {};
avahi = handleTest ./avahi.nix {};
+ avahi-with-resolved = handleTest ./avahi.nix { networkd = true; };
babeld = handleTest ./babeld.nix {};
bazarr = handleTest ./bazarr.nix {};
bcachefs = handleTestOn ["x86_64-linux"] ./bcachefs.nix {}; # linux-4.18.2018.10.12 is unsupported on aarch64
diff --git a/nixos/tests/avahi.nix b/nixos/tests/avahi.nix
index fe027c14d5a8..66cff3009f7d 100644
--- a/nixos/tests/avahi.nix
+++ b/nixos/tests/avahi.nix
@@ -1,5 +1,11 @@
+{ system ? builtins.currentSystem
+, config ? {}
+, pkgs ? import ../.. { inherit system config; }
+# bool: whether to use networkd in the tests
+, networkd ? false }:
+
# Test whether `avahi-daemon' and `libnss-mdns' work as expected.
-import ./make-test-python.nix ({ pkgs, ... } : {
+import ./make-test-python.nix ({ ... } : {
name = "avahi";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ eelco ];
@@ -17,6 +23,11 @@ import ./make-test-python.nix ({ pkgs, ... } : {
publish.workstation = true;
extraServiceFiles.ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
};
+ } // pkgs.lib.optionalAttrs (networkd) {
+ networking = {
+ useNetworkd = true;
+ useDHCP = false;
+ };
};
in {
one = cfg;