You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2021/01/04 15:59:37 UTC
[qpid-dispatch] branch master updated: DISPATCH-1901: Allow any
proton:io reason failing connection to bad host name
This is an automated email from the ASF dual-hosted git repository.
chug pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new 27ae419 DISPATCH-1901: Allow any proton:io reason failing connection to bad host name
27ae419 is described below
commit 27ae419b514ca962a37fa1cfedc7a67ae67447b3
Author: Chuck Rolke <ch...@apache.org>
AuthorDate: Mon Jan 4 10:47:28 2021 -0500
DISPATCH-1901: Allow any proton:io reason failing connection to bad host name
The system_tests_bad_configuration test sets up a connector to a
host that is never reachable. The test expects the connection to fail.
On Linux proton normally returns 'Name or service not known'. On macOS
there is some other specific reason.
Another class of errors shows up when DNS is unavailable. On Linux the
reason is 'Temporary failure in name resolution'.
This patch stops looking for specific text from the proton:io error
messages. The test declares success when a qpid-dispatch log message
indicates a connection failure to the host in question.
This patch also removes nsswitch.conf binding from BWRAP as that
workaround is not necessary any more.
This closes #966
---
tests/CMakeLists.txt | 5 +----
tests/system_tests_bad_configuration.py | 11 ++++-------
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 42661e2..db8da65 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -67,10 +67,7 @@ target_link_libraries(clogger ${Proton_LIBRARIES})
# running tests in parallel (the ctest -j option) without port clashes
set(USE_BWRAP OFF CACHE BOOL "Wrap test executions with bwrap (https://github.com/containers/bubblewrap)")
if(USE_BWRAP)
- # Inaccessible DNS servers produce "proton:io Temporary failure in name resolution".
- # For system_tests_bad_configuration we need to get "proton:io Name or service not known",
- # so blank /etc/nsswitch.conf to achieve that.
- set(BWRAP_ARGS bwrap --bind / / --bind /dev/zero /etc/nsswitch.conf --unshare-net --dev /dev --die-with-parent --)
+ set(BWRAP_ARGS bwrap --bind / / --unshare-net --dev /dev --die-with-parent --)
else()
set(BWRAP_ARGS "")
endif()
diff --git a/tests/system_tests_bad_configuration.py b/tests/system_tests_bad_configuration.py
index c651d86..c679790 100644
--- a/tests/system_tests_bad_configuration.py
+++ b/tests/system_tests_bad_configuration.py
@@ -51,12 +51,13 @@ class RouterTestBadConfiguration(TestCase):
"""
super(RouterTestBadConfiguration, cls).setUpClass()
cls.name = "test-router"
+ cls.unresolvable_host_name = 'unresolvable.host.name'
cls.config = Qdrouterd.Config([
('router', {'mode': 'standalone', 'id': 'QDR.A'}),
# Define a connector that uses an unresolvable hostname
('connector',
{'name': 'UnresolvableConn',
- 'host': 'unresolvable.host.name',
+ 'host': cls.unresolvable_host_name,
'port': 'amqp'}),
('listener',
{'port': cls.tester.get_port()}),
@@ -111,12 +112,8 @@ class RouterTestBadConfiguration(TestCase):
"""
with open('../setUpClass/test-router.log', 'r') as router_log:
log_lines = router_log.read().split("\n")
- expected_errors = [
- "proton:io Name or service not known", # Linux
- "proton:io unknown node or service", # macOS
- ]
- errors_caught = [line for line in log_lines
- if any([expected_error in line for expected_error in expected_errors])]
+ expected_log_snip = "Connection to %s" % self.unresolvable_host_name
+ errors_caught = [line for line in log_lines if expected_log_snip in line and "failed" in line]
self.error_caught = any(errors_caught)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org