From 021564ffd40d54a59dd461b7d0d5e00a3c86ed0e Mon Sep 17 00:00:00 2001 From: Soispha Peetz Date: Thu, 29 Oct 2026 23:32:22 +0100 Subject: treewide: Rework entry points and attribute names That just makes a lot of stuff easier and more streamlined. Also, all choices between stable or unstable nixpkgs should now be explicit. --- tests/by-name/dn/dns/test.nix | 43 ++++++++++++++----------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) (limited to 'tests/by-name/dn') diff --git a/tests/by-name/dn/dns/test.nix b/tests/by-name/dn/dns/test.nix index 01d8833..8bf0799 100644 --- a/tests/by-name/dn/dns/test.nix +++ b/tests/by-name/dn/dns/test.nix @@ -1,14 +1,11 @@ # Inspired by this file: /nixpkgs/nixos/tests/nsd.nix { - nixos-lib, - pkgsUnstable, - nixpkgs-unstable, - vhackPackages, - pkgs, - extraModules, - nixLib, + packageSets, + vhack, ... }: let + pkgs = packageSets.stable; + common = {...}: { networking.firewall.enable = false; networking.dhcpcd.enable = false; @@ -27,30 +24,18 @@ ]; }; in - nixos-lib.runTest { - hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs - + vhack.runTest { name = "dns"; - node = { - specialArgs = {inherit pkgsUnstable vhackPackages nixpkgs-unstable nixLib;}; - - # Use the nixpkgs as constructed by the `nixpkgs.*` options - pkgs = null; - }; - nodes = { server = { config, lib, ... }: { - imports = - extraModules - ++ [ - ../../../../modules - common - ]; + imports = [ + common + ]; vhack = { dns = { @@ -96,17 +81,17 @@ in clientV6 = mkClient "ipv6"; }; + services = [ + {clientV4 = "network.target";} + {clientV6 = "network.target";} + {server = "nsd.service";} + ]; + testScript = {nodes, ...}: /* python */ '' - start_all() - - clientV4.wait_for_unit("network.target") - clientV6.wait_for_unit("network.target") - server.wait_for_unit("nsd.service") - def assert_host(ipVersion, dnsRecordType, dnsQuery, expected): self = clientV4 if ipVersion == 4 else clientV6 out = self.succeed(f"host -{ipVersion} -t {dnsRecordType} {dnsQuery}").rstrip() -- cgit v1.3.1