Testsuite: Check dnssec_{request,require}_domains for dnslookup
authorHeiko Schlittermann (HS12) <hs@schlittermann.de>
Wed, 13 May 2015 06:59:31 +0000 (08:59 +0200)
committerHeiko Schlittermann (HS12) <hs@schlittermann.de>
Wed, 13 May 2015 06:59:31 +0000 (08:59 +0200)
src/src/host.c
test/confs/4800 [new file with mode: 0644]
test/confs/4801 [new file with mode: 0644]
test/dnszones-src/db.test.ex
test/scripts/4800-dnssec-dnslookup/4800 [new file with mode: 0644]
test/scripts/4800-dnssec-dnslookup/4801 [new file with mode: 0644]
test/scripts/4800-dnssec-dnslookup/REQUIRES [new file with mode: 0644]
test/stderr/4801 [new file with mode: 0644]
test/stdout/4800 [new file with mode: 0644]
test/stdout/4801 [new file with mode: 0644]

index 206751757d4775359094e0f5442ab834d35169d4..0a7a212b445b5b6cebd88f68c8141815d34e2d71 100644 (file)
@@ -2047,10 +2047,9 @@ for (i = 1; i <= times;
     }
   #endif   /* HAVE_IPV6 */
 
     }
   #endif   /* HAVE_IPV6 */
 
-  if (  slow_lookup_log
-     && (time_msec = get_time_in_ms() - time_msec) > slow_lookup_log
-        )
-       log_long_lookup(US"name", host->name, time_msec);
+  if (slow_lookup_log
+      && (time_msec = get_time_in_ms() - time_msec) > slow_lookup_log)
+    log_long_lookup(US"name", host->name, time_msec);
 
   if (hostdata == NULL)
     {
 
   if (hostdata == NULL)
     {
diff --git a/test/confs/4800 b/test/confs/4800
new file mode 100644 (file)
index 0000000..a257eff
--- /dev/null
@@ -0,0 +1,10 @@
+
+begin routers
+  dnslookup:
+     driver = dnslookup
+     dnssec_request_domains = *
+     transport = smtp
+
+begin transports
+  smtp:
+     driver = smtp
diff --git a/test/confs/4801 b/test/confs/4801
new file mode 100644 (file)
index 0000000..86ec206
--- /dev/null
@@ -0,0 +1,10 @@
+
+begin routers
+  dnslookup:
+     driver = dnslookup
+     dnssec_require_domains = *
+     transport = smtp
+
+begin transports
+  smtp:
+     driver = smtp
index 05deca5d3e75a814c5ab853b9cce9be157843a42..da084529f7159a2c5cbfe90177c62176cc2faf83 100644 (file)
@@ -396,6 +396,16 @@ _client._smtp.csa2  SRV  1 1 0  csa2.test.ex.
 csa1         A   V4NET.9.8.7
 csa2         A   V4NET.9.8.8
 
 csa1         A   V4NET.9.8.7
 csa2         A   V4NET.9.8.8
 
+; ------- Testing DNSSEC ----------
+
+mx-unsec-a-unsec        MX 5 a-unsec
+mx-unsec-a-sec          MX 5 a-sec
+DNSSEC mx-sec-a-unsec   MX 5 a-unsec
+DNSSEC mx-sec-a-sec     MX 5 a-sec
+
+a-unsec       A V4NET.0.0.100
+DNSSEC a-sec  A V4NET.0.0.100
+
 ; ------- Testing DANE ------------
 
 ; full suite dns chain, sha512
 ; ------- Testing DANE ------------
 
 ; full suite dns chain, sha512
diff --git a/test/scripts/4800-dnssec-dnslookup/4800 b/test/scripts/4800-dnssec-dnslookup/4800
new file mode 100644 (file)
index 0000000..d695a5d
--- /dev/null
@@ -0,0 +1,9 @@
+# dnssec_request_domains
+exim -bt user@mx-unsec-a-unsec.test.ex
+****
+exim -bt user@mx-unsec-a-sec.test.ex
+****
+exim -bt user@mx-sec-a-unsec.test.ex
+****
+exim -bt user@mx-sec-a-sec.test.ex
+****
diff --git a/test/scripts/4800-dnssec-dnslookup/4801 b/test/scripts/4800-dnssec-dnslookup/4801
new file mode 100644 (file)
index 0000000..30ba44e
--- /dev/null
@@ -0,0 +1,12 @@
+# dnssec_require_domains
+1
+exim -bt user@mx-unsec-a-unsec.test.ex
+****
+1
+exim -bt user@mx-unsec-a-sec.test.ex
+****
+2
+exim -bt user@mx-sec-a-unsec.test.ex
+****
+exim -bt user@mx-sec-a-sec.test.ex
+****
diff --git a/test/scripts/4800-dnssec-dnslookup/REQUIRES b/test/scripts/4800-dnssec-dnslookup/REQUIRES
new file mode 100644 (file)
index 0000000..0092709
--- /dev/null
@@ -0,0 +1,2 @@
+support DNSSEC
+router dnslookup
diff --git a/test/stderr/4801 b/test/stderr/4801
new file mode 100644 (file)
index 0000000..4a9d589
--- /dev/null
@@ -0,0 +1,6 @@
+LOG: host_lookup_failed MAIN
+  dnssec fail on MX for mx-unsec-a-unsec.test.ex
+LOG: host_lookup_failed MAIN
+  dnssec fail on MX for mx-unsec-a-sec.test.ex
+LOG: host_lookup_failed MAIN
+  dnssec fail on A for a-unsec.test.ex
diff --git a/test/stdout/4800 b/test/stdout/4800
new file mode 100644 (file)
index 0000000..67fea43
--- /dev/null
@@ -0,0 +1,12 @@
+user@mx-unsec-a-unsec.test.ex
+  router = dnslookup, transport = smtp
+  host a-unsec.test.ex [V4NET.0.0.100] MX=5 ad=no
+user@mx-unsec-a-sec.test.ex
+  router = dnslookup, transport = smtp
+  host a-sec.test.ex [V4NET.0.0.100] MX=5 ad=no
+user@mx-sec-a-unsec.test.ex
+  router = dnslookup, transport = smtp
+  host a-unsec.test.ex [V4NET.0.0.100] MX=5 ad=no
+user@mx-sec-a-sec.test.ex
+  router = dnslookup, transport = smtp
+  host a-sec.test.ex [V4NET.0.0.100] MX=5 ad=yes
diff --git a/test/stdout/4801 b/test/stdout/4801
new file mode 100644 (file)
index 0000000..3b06a2f
--- /dev/null
@@ -0,0 +1,6 @@
+user@mx-unsec-a-unsec.test.ex cannot be resolved at this time: host lookup did not complete
+user@mx-unsec-a-sec.test.ex cannot be resolved at this time: host lookup did not complete
+user@mx-sec-a-unsec.test.ex is undeliverable: all relevant MX records point to non-existent hosts
+user@mx-sec-a-sec.test.ex
+  router = dnslookup, transport = smtp
+  host a-sec.test.ex [V4NET.0.0.100] MX=5 ad=yes