Skip to content

Commit

Permalink
Reenable DNS tests, catch on dns.resolver.NoNameservers (fix #3793) (#…
Browse files Browse the repository at this point in the history
…3806)

* Enable DNS tests, catch on dns.resolver.NoNameservers for SERVFAILs
* Fix log level
* FLAKE fixes.
  • Loading branch information
teward authored Apr 9, 2020
1 parent 7d1f21c commit e3c1708
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 4 additions & 0 deletions blacklists.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ def item_check(ns):
soa = dns.resolver.query(ns, 'soa')
log('debug', '{0} has no A record; SOA is {1}'.format(
ns, ';'.join(s.to_text() for s in soa)))
except dns.resolver.NoNameservers:
if not item.get('pass', None):
log('warn', '{0} has no available servers to service DNS '
'request.'.format(ns))
return True

host_regex = regex.compile(r'^([a-z0-9][-a-z0-9]*\.){2,}$')
Expand Down
6 changes: 0 additions & 6 deletions test/test_blacklists.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def test_yaml_blacklist():
assert '3.4.5.6' not in blacklist.parse()
unlink('test_ip.yml')

# Temporarily disable to work aroud #3793
return None
yaml_validate_existing('blacklisted_cidrs.yml', YAMLParserCIDR)
yaml_validate_existing('watched_cidrs.yml', YAMLParserCIDR)

Expand Down Expand Up @@ -94,13 +92,9 @@ def test_yaml_asn():
assert '345' not in blacklist.parse()
unlink('test_asn.yml')

# Temporarily disable to work aroud #3793
return None
yaml_validate_existing('watched_asns.yml', YAMLParserASN)


def test_yaml_nses():
# Temporarily disable to work around #3793
return None
yaml_validate_existing('blacklisted_nses.yml', YAMLParserNS)
yaml_validate_existing('watched_nses.yml', YAMLParserNS)

0 comments on commit e3c1708

Please sign in to comment.