shutdown system test fails when machine is offline
Running the system tests when your machine is offline fails. In this case it was MacOS.
% more shutdown.log
============================= test session starts ==============================
platform darwin -- Python 3.10.13, pytest-7.4.3, pluggy-1.3.0
rootdir: /Users/marka/git/bind9/bin/tests/system
configfile: pytest.ini
plugins: hypothesis-6.92.1
collected 2 items
tests_shutdown.py::test_named_shutdown[rndc]
-------------------------------- live log setup --------------------------------
2024-03-13 16:19:35 INFO:shutdown switching to tmpdir: /Users/marka/git/bind9/bin/tests/system/shutdown_tmp_n89rn3w9
2024-03-13 16:19:35 INFO:shutdown test started: shutdown/tests_shutdown.py
2024-03-13 16:19:35 INFO:shutdown using port range: <27538, 27557>
FAILED [ 50%]
tests_shutdown.py::test_named_shutdown[sigterm] FAILED [100%]
------------------------------ live log teardown -------------------------------
2024-03-13 16:19:41 INFO:shutdown test artifacts in: shutdown_shutdown
=================================== FAILURES ===================================
__________________________ test_named_shutdown[rndc] ___________________________
/Users/marka/git/bind9/bin/tests/system/shutdown/tests_shutdown.py:195: in test_named_shutdown
resolver = dns.resolver.Resolver()
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/dns/resolver.py:944: in __init__
self.read_resolv_conf(filename)
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/dns/resolver.py:1038: in read_resolv_conf
raise NoResolverConfiguration("no nameservers")
E dns.resolver.NoResolverConfiguration: no nameservers
------------------------------ Captured log setup ------------------------------
2024-03-13 16:19:35 INFO:shutdown switching to tmpdir: /Users/marka/git/bind9/bin/tests/system/shutdown_tmp_n89rn3w9
2024-03-13 16:19:35 INFO:shutdown test started: shutdown/tests_shutdown.py
2024-03-13 16:19:35 INFO:shutdown using port range: <27538, 27557>
_________________________ test_named_shutdown[sigterm] _________________________
/Users/marka/git/bind9/bin/tests/system/shutdown/tests_shutdown.py:195: in test_named_shutdown
resolver = dns.resolver.Resolver()
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/dns/resolver.py:944: in __init__
self.read_resolv_conf(filename)
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/dns/resolver.py:1038: in read_resolv_conf
raise NoResolverConfiguration("no nameservers")
E dns.resolver.NoResolverConfiguration: no nameservers
---------------------------- Captured log teardown -----------------------------
2024-03-13 16:19:41 INFO:shutdown test artifacts in: shutdown_shutdown
--- generated xml file: /Users/marka/git/bind9/bin/tests/system/shutdown.xml ---
=========================== short test summary info ============================
FAILED tests_shutdown.py::test_named_shutdown[rndc] - dns.resolver.NoResolver...
FAILED tests_shutdown.py::test_named_shutdown[sigterm] - dns.resolver.NoResol...
============================== 2 failed in 6.86s ===============================
FAIL shutdown (exit status: 1)
%