summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2015-05-23 18:07:58 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2015-05-23 19:50:13 +0100
commitdd2a32ad5058ad7831621b99a1eadc264d4982c9 (patch)
tree33595a8c88500cd7df2c62c3025ca3dff045b3fb /src
parent0539a19dc27efcfc77713a87aba6b61fef947249 (diff)
Testsuite: move test.again.dns and test.fail.dns handling to fakens
Diffstat (limited to 'src')
-rw-r--r--src/src/dns.c26
-rw-r--r--src/src/host.c10
2 files changed, 0 insertions, 36 deletions
diff --git a/src/src/dns.c b/src/src/dns.c
index 4ca349cd1..d55ff83b1 100644
--- a/src/src/dns.c
+++ b/src/src/dns.c
@@ -53,32 +53,6 @@ Ustrncpy(name, domain, len);
name[len] = 0;
endname = name + len;
-/* This code, for forcing TRY_AGAIN and NO_RECOVERY, is here so that it works
-for the old test suite that uses a real nameserver. When the old test suite is
-eventually abandoned, this code could be moved into the fakens utility. */
-
-if (len >= 14 && Ustrcmp(endname - 14, "test.again.dns") == 0)
- {
- int delay = Uatoi(name); /* digits at the start of the name */
- DEBUG(D_dns) debug_printf("Return from DNS lookup of %s (%s) faked for testing\n",
- name, dns_text_type(type));
- if (delay > 0)
- {
- DEBUG(D_dns) debug_printf("delaying %d seconds\n", delay);
- sleep(delay);
- }
- h_errno = TRY_AGAIN;
- return -1;
- }
-
-if (len >= 13 && Ustrcmp(endname - 13, "test.fail.dns") == 0)
- {
- DEBUG(D_dns) debug_printf("Return from DNS lookup of %s (%s) faked for testing\n",
- name, dns_text_type(type));
- h_errno = NO_RECOVERY;
- return -1;
- }
-
/* Look for the fakens utility, and if it exists, call it. */
(void)string_format(utilname, sizeof(utilname), "%s/bin/fakens",
diff --git a/src/src/host.c b/src/src/host.c
index 643900b21..00a23310f 100644
--- a/src/src/host.c
+++ b/src/src/host.c
@@ -1928,16 +1928,6 @@ BOOL temp_error = FALSE;
int af;
#endif
-/* If we are in the test harness, a name ending in .test.again.dns always
-forces a temporary error response, unless the name is in
-dns_again_means_nonexist. */
-
-if (running_in_test_harness)
- {
- const uschar *endname = host->name + Ustrlen(host->name);
- if (Ustrcmp(endname - 14, "test.again.dns") == 0) goto RETURN_AGAIN;
- }
-
/* Make sure DNS options are set as required. This appears to be necessary in
some circumstances when the get..byname() function actually calls the DNS. */