You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2020/08/06 14:10:45 UTC

[qpid-dispatch] 01/02: DISPATCH-1739 Add -DUSE_BWRAP option, defaulting to OFF

This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 90ffb042ef0d117a494b52d7d64285096593342e
Author: Jiri Danek <jd...@redhat.com>
AuthorDate: Sun Aug 2 21:39:48 2020 +0200

    DISPATCH-1739 Add -DUSE_BWRAP option, defaulting to OFF
    
    Bubblewrap (https://github.com/containers/bubblewrap) is
    an unprivileged sandbox. It allows running tests in parallel,
    without any port clashes with already running servers.
---
 tests/CMakeLists.txt | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 08df007..e00ed84 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -64,7 +64,18 @@ target_link_libraries(test-receiver ${Proton_LIBRARIES})
 add_executable(clogger clogger.c)
 target_link_libraries(clogger ${Proton_LIBRARIES})
 
-set(TEST_WRAP ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/run.py)
+# Bubblewrap is an unprivileged sandboxing tool for Linux. Setting --unshare-net allows
+# 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 --)
+else()
+  set(BWRAP_ARGS "")
+endif()
+set(TEST_WRAP ${BWRAP_ARGS} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/run.py)
 
 add_test(unit_tests_size_10000 ${TEST_WRAP} unit_tests_size 10000)
 add_test(unit_tests_size_512   ${TEST_WRAP} unit_tests_size 512)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org