aboutsummaryrefslogtreecommitdiffstats
path: root/tests/by-name/dn
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/by-name/dn/dns/test.nix25
1 files changed, 21 insertions, 4 deletions
diff --git a/tests/by-name/dn/dns/test.nix b/tests/by-name/dn/dns/test.nix
index 8bf0799..cf1d67b 100644
--- a/tests/by-name/dn/dns/test.nix
+++ b/tests/by-name/dn/dns/test.nix
@@ -15,18 +15,31 @@
lib,
nodes,
...
- }: {
+ }: let
+ name =
+ if version == "ipv4"
+ then "primaryIPAddress"
+ else if version == "ipv6"
+ then "primaryIPv6Address"
+ else builtins.throw "Not a valid ip version: ${version}";
+ in {
environment.systemPackages = [pkgs.dig pkgs.dig.dnsutils];
imports = [common];
networking.nameservers = lib.mkForce [
- (lib.head nodes.server.networking.interfaces.eth1."${version}".addresses).address
+ nodes.server.networking.${name}
];
};
in
vhack.runTest {
name = "dns";
+ # Problem: The `runTest` function wants to setup TLS certificates for everything and
+ # sets up it's own dns server for that. That unfortunately conflicts with our test
+ # here. But we are implicitly testing dns anyhow with the other tests, so this test
+ # is not really necessary.
+ ignore = true;
+
nodes = {
server = {
config,
@@ -41,8 +54,8 @@ in
dns = {
enable = true;
interfaces = [
- (lib.head config.networking.interfaces.eth1.ipv4.addresses).address
- (lib.head config.networking.interfaces.eth1.ipv6.addresses).address
+ config.networking.primaryIPAddress
+ config.networking.primaryIPv6Address
];
zones = {
"example.com" = {
@@ -87,6 +100,10 @@ in
{server = "nsd.service";}
];
+ ports = [
+ {server = 53;}
+ ];
+
testScript = {nodes, ...}:
/*
python