Unit test failure if no nameserver specified in /etc/resolv.conf
Bug #2064916 reported by
Thomas Goirand
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Designate |
In Progress
|
Low
|
Michael Johnson |
Bug Description
Hi,
As per: https:/
Cheers,
Thomas Goirand
Changed in designate: | |
importance: | Undecided → Low |
assignee: | nobody → Michael Johnson (johnsom) |
To post a comment you must log in.
I can see that dnspython has a class BaseResolver that has an init that attempts to read the resolv.conf.
https:/ /github. com/rthalley/ dnspython/ blob/main/ dns/resolver. py#L944
This the stack trace from the Debian bug: ======= ======= ======= ======= ======= ======= ======= ======= ======= tests.unit. mdns.test_ handler. MdnsHandleTest. test_notify tests.unit. mdns.test_ handler. MdnsHandleTest. test_notify ------- ------- ------- ------- ------- ------- ------- ------- ------- testresult. real._StringExc eption: Traceback (most recent call last): python3. 12/unittest/ mock.py" , line 1390, in patched
^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^ >>/designate/ tests/unit/ mdns/test_ handler. py", line 79, in test_notify assertEqual( dns.rcode. NOERROR, tuple(response) [0].rcode( ))
^^ ^^^^^^^ ^^^^^^ >>/designate/ mdns/handler. py", line 142, in _handle_notify Resolver( )
^^^^^^ ^^^^^^^ ^^^^^^^ ^^^ python3/ dist-packages/ dns/resolver. py", line 944, in __init__ read_resolv_ conf(filename) python3/ dist-packages/ dns/resolver. py", line 1038, in read_resolv_conf guration( "no nameservers") NoResolverConfi guration: no nameservers
=======
FAIL: designate.
designate.
-------
testtools.
File "/usr/lib/
return func(*newargs, **newkeywargs)
File "/<<PKGBUILDDIR
self.
File "/<<PKGBUILDDIR
resolver = dns.resolver.
File "/usr/lib/
self.
File "/usr/lib/
raise NoResolverConfi
dns.resolver.