nixosTests.avahi: migrate to runTest

Part Of #386873
This commit is contained in:
Martin Weinelt 2025-03-13 23:57:19 +01:00
parent b1d55f037e
commit 68995c0969
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
2 changed files with 15 additions and 12 deletions

View file

@ -187,8 +187,14 @@ in {
authelia = runTest ./authelia.nix; authelia = runTest ./authelia.nix;
auto-cpufreq = runTest ./auto-cpufreq.nix; auto-cpufreq = runTest ./auto-cpufreq.nix;
autobrr = runTest ./autobrr.nix; autobrr = runTest ./autobrr.nix;
avahi = handleTest ./avahi.nix {}; avahi = runTest {
avahi-with-resolved = handleTest ./avahi.nix { networkd = true; }; imports = [ ./avahi.nix ];
_module.args.networkd = false;
};
avahi-with-resolved = runTest {
imports = [ ./avahi.nix ];
_module.args.networkd = true;
};
ayatana-indicators = runTest ./ayatana-indicators.nix; ayatana-indicators = runTest ./ayatana-indicators.nix;
babeld = runTest ./babeld.nix; babeld = runTest ./babeld.nix;
bazarr = handleTest ./bazarr.nix {}; bazarr = handleTest ./bazarr.nix {};

View file

@ -1,17 +1,14 @@
{ {
system ? builtins.currentSystem, pkgs,
config ? { },
pkgs ? import ../.. { inherit system config; },
# bool: whether to use networkd in the tests # bool: whether to use networkd in the tests
networkd ? false, networkd ? false,
}@args: ...
}:
# Test whether `avahi-daemon' and `libnss-mdns' work as expected. # Test whether `avahi-daemon' and `libnss-mdns' work as expected.
import ./make-test-python.nix { {
name = "avahi"; name = "avahi";
meta = with pkgs.lib.maintainers; { meta.maintainers = [ ];
maintainers = [ ];
};
nodes = nodes =
let let
@ -29,7 +26,7 @@ import ./make-test-python.nix {
extraServiceFiles.ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service"; extraServiceFiles.ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
}; };
} }
// pkgs.lib.optionalAttrs (networkd) { // pkgs.lib.optionalAttrs networkd {
networking = { networking = {
useNetworkd = true; useNetworkd = true;
useDHCP = false; useDHCP = false;
@ -84,4 +81,4 @@ import ./make-test-python.nix {
one.log(one.execute("systemd-analyze security avahi-daemon.service | grep -v ")[1]) one.log(one.execute("systemd-analyze security avahi-daemon.service | grep -v ")[1])
''; '';
} args }