forked from zmap/zdns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
integration_tests.py
executable file
·640 lines (560 loc) · 20.8 KB
/
integration_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
#!/usr/bin/env python3
import copy
import subprocess
import json
import unittest
import tempfile
def recursiveSort(obj):
def listSort(l):
assert(type(l) == type(list()))
new_list = []
for item in l:
item = recursiveSort(item)
new_list.append(item)
if len(new_list) > 0 and type(new_list[0]) == dict:
return sorted(new_list, key=lambda x: x["name"])
else:
return sorted(new_list)
def dictSort(d):
assert(type(d) == type(dict()))
for key in d:
d[key] = recursiveSort(d[key])
return d
if type(obj) == list:
return listSort(obj)
elif type(obj) == dict:
return dictSort(obj)
else:
return obj
class Tests(unittest.TestCase):
maxDiff = None
ZDNS_EXECUTABLE = "./zdns"
def run_zdns_check_failure(self, flags, name, expected_err, executable=ZDNS_EXECUTABLE):
flags = flags + " --threads=10"
c = f"echo '{name}' | {executable} {flags}; exit 0"
o = subprocess.check_output(c, shell=True, stderr=subprocess.STDOUT)
self.assertEqual(expected_err in o.decode(), True)
def run_zdns(self, flags, name, executable=ZDNS_EXECUTABLE):
flags = flags + " --threads=10"
c = f"echo '{name}' | {executable} {flags}"
o = subprocess.check_output(c, shell=True)
return c, json.loads(o.rstrip())
def run_zdns_multiline(self, flags, names, executable=ZDNS_EXECUTABLE):
d = tempfile.mkdtemp
f = "/".join([d,"temp"])
with open(f) as fd:
for name in names:
fd.writeline(name)
flags = flags + " --threads=10"
c = f"cat '{f}' | {executable} {flags}"
o = subprocess.check_output(c, shell=True)
os.rm(f)
return c, [json.loads(l.rstrip()) for l in o]
ROOT_A = set([
"1.2.3.4",
"2.3.4.5",
"3.4.5.6",
])
ROOT_A_ANSWERS = [{"type":"A", "class":"IN", "answer":x,
"name":"zdns-testing.com"} for x in ROOT_A]
ROOT_AAAA = set([
"fd5a:3bce:8713::1",
"fde6:9bb3:dbd6::2",
"fdb3:ac76:a577::3"
])
ROOT_AAAA_ANSWERS = [{"type":"AAAA", "class":"IN", "answer":x,
"name":"zdns-testing.com"} for x in ROOT_AAAA]
MX_SERVERS = [
{"answer":"mx1.zdns-testing.com.", "preference":1, "type":"MX", "class":"IN", 'name':'zdns-testing.com'},
{"answer":"mx2.zdns-testing.com.", "preference":5, "type":"MX", "class":"IN", 'name':'zdns-testing.com'},
{"answer":"mx1.censys.io.", "preference":10, "type":"MX", "class":"IN", 'name':'zdns-testing.com'},
]
NS_SERVERS = [
{"type": "NS", "class": "IN", "name": "zdns-testing.com",
"answer": "ns-cloud-c2.googledomains.com."},
{"type": "NS", "class": "IN", "name": "zdns-testing.com",
"answer": "ns-cloud-c3.googledomains.com."},
{"type": "NS", "class": "IN", "name": "zdns-testing.com",
"answer": "ns-cloud-c1.googledomains.com."},
{"type": "NS", "class": "IN", "name": "zdns-testing.com",
"answer": "ns-cloud-c4.googledomains.com."},
]
NXDOMAIN_ANSWER = {
"name": "zdns-testing-nxdomain.com",
"class": "IN",
"status": "NXDOMAIN"
}
MX_LOOKUP_ANSWER = {
"name": "zdns-testing.com",
"class": "IN",
"status": "NOERROR",
"data": {
"exchanges": [
{
"name": "mx1.zdns-testing.com",
"type": "MX",
"class": "IN",
"preference": 1,
"ipv4_addresses": [
"1.2.3.4",
"2.3.4.5"
],
"ipv6_addresses": [
"fdb3:ac76:a577::4",
"fdb3:ac76:a577::5"
],
},
{
"name": "mx2.zdns-testing.com",
"type": "MX",
"class": "IN",
"preference": 5,
"ipv4_addresses": [
"5.6.7.8"
],
},
{
"name": "mx1.censys.io",
"type": "MX",
"class": "IN",
"preference": 10,
}
]
}
}
MX_LOOKUP_ANSWER_IPV4 = copy.deepcopy(MX_LOOKUP_ANSWER)
del MX_LOOKUP_ANSWER_IPV4["data"]["exchanges"][0]["ipv6_addresses"]
MX_LOOKUP_ANSWER_IPV6 = copy.deepcopy(MX_LOOKUP_ANSWER)
del MX_LOOKUP_ANSWER_IPV6["data"]["exchanges"][0]["ipv4_addresses"]
del MX_LOOKUP_ANSWER_IPV6["data"]["exchanges"][1]["ipv4_addresses"]
A_LOOKUP_WWW_ZDNS_TESTING = {
"name": "www.zdns-testing.com",
"class": "IN",
"status": "NOERROR",
"data": {
"ipv4_addresses": [
"1.2.3.4",
"2.3.4.5",
"3.4.5.6"
],
"ipv6_addresses": [
"fde6:9bb3:dbd6::2",
"fd5a:3bce:8713::1",
"fdb3:ac76:a577::3"
]
}
}
A_LOOKUP_IPV4_WWW_ZDNS_TESTING = copy.deepcopy(A_LOOKUP_WWW_ZDNS_TESTING)
del A_LOOKUP_IPV4_WWW_ZDNS_TESTING["data"]["ipv6_addresses"]
A_LOOKUP_IPV6_WWW_ZDNS_TESTING = copy.deepcopy(A_LOOKUP_WWW_ZDNS_TESTING)
del A_LOOKUP_IPV6_WWW_ZDNS_TESTING["data"]["ipv4_addresses"]
PTR_LOOKUP_GOOGLE_PUB = [
{
"type":"PTR",
"class":"IN",
"name":"8.8.8.8.in-addr.arpa",
"answer":"dns.google."
}
]
CAA_RECORD = [
{
"type": "CAA",
"class": "IN",
"name": "zdns-testing.com",
"tag": "issue",
"value": "letsencrypt.org",
"flag": 0
}
]
TXT_RECORD = [
{
"type": "TXT",
"class": "IN",
"name": "test_txt.zdns-testing.com",
"answer": "Hello World!"
}
]
UDP_TRUNCATED_LARGE_TXT = {
"name": "large-text.zdns-testing.com",
"class": "IN",
"status": "TRUNCATED",
"timestamp": "2019-12-18T14:41:23-05:00",
"data": {
"answers": [],
"additionals": [],
"authorities": [],
"protocol": "udp",
"flags": {
"response": False,
"opcode": 0,
"authoritative": False,
"truncated": False,
"recursion_desired": False,
"recursion_available": False,
"authenticated": False,
"checking_disabled": False,
"error_code": 0
}
}
}
TCP_LARGE_TXT_ANSWERS = [
{
"type": "TXT",
"class": "IN",
"name": "large-text.zdns-testing.com",
"answer": "surveys, informed by our own experiences conducting a long-term research survey over the past year."
},
{
"type": "TXT",
"class": "IN",
"name": "large-text.zdns-testing.com",
"answer": "and explore the security implications of high speed Internet-scale network surveys, both offensive and defensive. "
},
{
"type": "TXT",
"class": "IN",
"name": "large-text.zdns-testing.com",
"answer": "in under 45 minutes from user space on a single machine, approaching the theoretical maximum speed of gigabit Ethernet."
},
{
"type": "TXT",
"class": "IN",
"name": "large-text.zdns-testing.com",
"answer": "We introduce ZMap, a modular, open-source network scanner specifically architected to perform Internet-wide scans and capable of surveying the entire IPv4 address space"
},
{
"type": "TXT",
"class": "IN",
"name": "large-text.zdns-testing.com",
"answer": "Internet-wide network scanning has numerous security applications, including exposing new vulnerabilities and tracking the adoption of defensive mechanisms, but probing the entire public address space with existing tools is both difficult and slow."
},
{
"type": "TXT",
"class": "IN",
"name": "large-text.zdns-testing.com",
"answer": "We also discuss best practices for good Internet citizenship when performing Internet-wide"
},
{
"type": "TXT",
"class": "IN",
"name": "large-text.zdns-testing.com",
"answer": "We present the scanner architecture, experimentally characterize its performance and accuracy, "
}
]
WWW_CNAME_ANSWERS = [
{
"type": "CNAME",
"class": "IN",
"name": "www.zdns-testing.com",
"answer": "zdns-testing.com."
}
]
DMARC_ANSWER = {
"data": {
"dmarc": "v=DMARC1; p=none; rua=mailto:[email protected]"
}
}
SPF_ANSWER = {
"data": {
"spf": "v=spf1 mx include:_spf.google.com -all"
}
}
SOA_ANSWERS = [
{
"type": "SOA",
"class": "IN",
"name": "zdns-testing.com",
"ns": "ns-cloud-c1.googledomains.com",
"mbox": "cloud-dns-hostmaster.google.com",
"serial": 2,
"refresh": 21600,
"retry": 3600,
"expire": 259200,
"min_ttl": 300
}
]
SRV_ANSWERS = [
{
"type": "SRV",
"class": "IN",
"name": "_sip._udp.sip.voice.google.com",
"port": 5060,
"priority": 10,
"target": "sip-anycast-1.voice.google.com.",
"weight": 1
},
{
"type": "SRV",
"class": "IN",
"name": "_sip._udp.sip.voice.google.com",
"port": 5060,
"priority": 20,
"target": "sip-anycast-2.voice.google.com.",
"weight": 1
}
]
TLSA_ANSWERS = [
{
"type": "TLSA",
"class": "IN",
"name": "_25._tcp.mail.ietf.org",
"cert_usage": 3,
"selector": 1,
"matching_type": 1,
"certificate": "0c72ac70b745ac19998811b131d662c9ac69dbdbe7cb23e5b514b56664c5d3d6"
}
]
def assertSuccess(self, res, cmd):
self.assertEqual(res["status"], "NOERROR", cmd)
def assertEqualAnswers(self, res, correct, cmd, key="answer"):
self.assertIn("answers", res["data"])
for answer in res["data"]["answers"]:
del answer["ttl"]
a = sorted(res["data"]["answers"], key=lambda x: x[key])
b = sorted(correct, key=lambda x: x[key])
helptext = "%s\nExpected:\n%s\n\nActual:\n%s" % (cmd,
json.dumps(b,indent=4), json.dumps(a,indent=4))
def _lowercase(obj):
""" Make dictionary lowercase """
if isinstance(obj, dict):
for k, v in obj.items():
if k == "name":
obj[k] = v.lower()
else:
_lowercase(v)
self.assertEqual(_lowercase(a), _lowercase(b), helptext)
def assertEqualNXDOMAIN(self, res, correct):
self.assertEqual(res["name"], correct["name"])
self.assertEqual(res["status"], correct["status"])
def assertEqualMXLookup(self, res, correct):
self.assertEqual(res["name"], correct["name"])
self.assertEqual(res["status"], correct["status"])
for exchange in res["data"]["exchanges"]:
del exchange["ttl"]
self.assertEqual(recursiveSort(res["data"]["exchanges"]), recursiveSort(correct["data"]["exchanges"]))
def assertEqualALookup(self, res, correct):
self.assertEqual(res["name"], correct["name"])
self.assertEqual(res["status"], correct["status"])
if "ipv4_addresses" in correct["data"]:
self.assertIn("ipv4_addresses", res["data"])
self.assertEqual(sorted(res["data"]["ipv4_addresses"]), sorted(correct["data"]["ipv4_addresses"]))
else:
self.assertNotIn("ipv4_addresses", res["data"])
if "ipv6_addresses" in correct["data"]:
self.assertIn("ipv6_addresses", res["data"])
self.assertEqual(sorted(res["data"]["ipv6_addresses"]), sorted(correct["data"]["ipv6_addresses"]))
else:
self.assertNotIn("ipv6_addresses", res["data"])
def test_a(self):
c = "A"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.ROOT_A_ANSWERS, cmd)
def test_cname(self):
c = "CNAME"
name = "www.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.WWW_CNAME_ANSWERS, cmd)
def test_caa(self):
c = "CAA"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.CAA_RECORD, cmd, key="name")
def test_txt(self):
c = "TXT"
name = "test_txt.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.TXT_RECORD, cmd)
def test_a_iterative(self):
c = "A --iterative"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.ROOT_A_ANSWERS, cmd)
def test_a_iterative_nxdomain(self):
c = "A --iterative"
name = "zdns-testing-nxdomain.com"
cmd, res = self.run_zdns(c, name)
self.assertEqualNXDOMAIN(res, self.NXDOMAIN_ANSWER)
def test_aaaa(self):
c = "AAAA"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.ROOT_AAAA_ANSWERS, cmd)
def test_aaaa_iterative(self):
c = "AAAA --iterative"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.ROOT_AAAA_ANSWERS, cmd)
def test_mx(self):
c = "MX"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.MX_SERVERS, cmd)
def test_mx_iterative(self):
c = "MX --iterative"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.MX_SERVERS, cmd)
def test_ns(self):
c = "NS"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.NS_SERVERS, cmd)
def test_ns_iterative(self):
c = "NS --iterative"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.NS_SERVERS, cmd)
def test_mx_lookup(self):
c = "mxlookup --ipv4-lookup --ipv6-lookup"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualMXLookup(res, self.MX_LOOKUP_ANSWER)
def test_mx_lookup_iterative(self):
c = "mxlookup --ipv4-lookup --ipv6-lookup --iterative"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualMXLookup(res, self.MX_LOOKUP_ANSWER)
def test_mx_lookup_ipv4(self):
c = "mxlookup --ipv4-lookup"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualMXLookup(res, self.MX_LOOKUP_ANSWER_IPV4)
def test_mx_lookup_ipv6(self):
c = "mxlookup --ipv6-lookup"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualMXLookup(res, self.MX_LOOKUP_ANSWER_IPV6)
def test_mx_lookup_default(self):
c = "mxlookup"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualMXLookup(res, self.MX_LOOKUP_ANSWER_IPV4)
def test_a_lookup(self):
c = "alookup --ipv4-lookup --ipv6-lookup"
name = "www.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualALookup(res, self.A_LOOKUP_WWW_ZDNS_TESTING)
def test_a_lookup_iterative(self):
c = "alookup --ipv4-lookup --ipv6-lookup --iterative"
name = "www.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualALookup(res, self.A_LOOKUP_WWW_ZDNS_TESTING)
def test_a_lookup_ipv4(self):
c = "alookup --ipv4-lookup"
name = "www.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualALookup(res, self.A_LOOKUP_IPV4_WWW_ZDNS_TESTING)
def test_a_lookup_ipv6(self):
c = "alookup --ipv6-lookup"
name = "www.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualALookup(res, self.A_LOOKUP_IPV6_WWW_ZDNS_TESTING)
def test_a_lookup_default(self):
c = "alookup"
name = "www.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualALookup(res, self.A_LOOKUP_IPV4_WWW_ZDNS_TESTING)
def test_ptr(self):
c = "PTR"
name = "8.8.8.8"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.PTR_LOOKUP_GOOGLE_PUB, cmd)
def test_ptr_iterative(self):
c = "PTR --iterative"
name = "8.8.8.8"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.PTR_LOOKUP_GOOGLE_PUB, cmd)
def test_spf(self):
c = "SPF"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqual(res["data"], self.SPF_ANSWER["data"])
def test_dmarc(self):
c = "DMARC"
name = "_dmarc.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqual(res["data"], self.DMARC_ANSWER["data"])
def test_soa(self):
c = "SOA"
name = "zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.SOA_ANSWERS, cmd, key="serial")
def test_srv(self):
c = "SRV"
name = "_sip._udp.sip.voice.google.com"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.SRV_ANSWERS, cmd, key="target")
def test_tlsa(self):
c = "TLSA"
name = "_25._tcp.mail.ietf.org"
cmd, res = self.run_zdns(c, name)
self.assertSuccess(res, cmd)
self.assertEqualAnswers(res, self.TLSA_ANSWERS, cmd, key="certificate")
def test_too_big_txt_udp(self):
c = "TXT --udp-only --name-servers=8.8.8.8:53"
name = "large-text.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertEqual(res["status"], "TRUNCATED")
self.assertEqual(res["data"]["protocol"], "udp")
def test_too_big_txt_tcp(self):
c = "TXT --tcp-only --name-servers=8.8.8.8:53" # Azure DNS does not provide results.
name = "large-text.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertEqualAnswers(res, self.TCP_LARGE_TXT_ANSWERS, cmd, key="answer")
def test_too_big_txt_all(self):
c = "TXT --name-servers=8.8.8.8:53"
name = "large-text.zdns-testing.com"
cmd, res = self.run_zdns(c, name)
self.assertEqual(res["data"]["protocol"], "tcp")
self.assertEqualAnswers(res, self.TCP_LARGE_TXT_ANSWERS, cmd, key="answer")
def test_override_name(self):
c = "A --override-name=zdns-testing.com"
name = "notrealname.com"
cmd, res = self.run_zdns(c, name)
self.assertEqualAnswers(res, self.ROOT_A_ANSWERS, cmd)
def test_server_mode_a_lookup_ipv4(self):
c = "A --override-name=zdns-testing.com --name-server-mode"
name = "8.8.8.8:53"
cmd, res = self.run_zdns(c, name)
self.assertEqual(res["data"]["resolver"], "8.8.8.8:53")
self.assertEqualAnswers(res, self.ROOT_A_ANSWERS, cmd)
def test_mixed_mode_a_lookup_ipv4(self):
c = "A --name-servers=0.0.0.0"
name = "zdns-testing.com,8.8.8.8:53"
cmd, res = self.run_zdns(c, name)
self.assertEqual(res["data"]["resolver"], "8.8.8.8:53")
self.assertEqualAnswers(res, self.ROOT_A_ANSWERS, cmd)
def test_local_addr_interface_warning(self):
c = "A --local-addr 192.168.1.5 --local-interface en0"
name = "zdns-testing.com"
self.run_zdns_check_failure(c, name, "Both --local-addr and --local-interface specified.")
if __name__ == "__main__":
unittest.main()