Skip to content

Commit 487a046

Browse files
committed
Fix #520: Allow tests w/ OpenMPI to run as root
1 parent ff5329d commit 487a046

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,10 @@ function(add_caf_test name num_caf_img test_target)
631631
message( STATUS "Open-MPI back end detected, passing --oversubscribe for oversubscribed test, ${name}, with ${num_caf_img} ranks/images." )
632632
endif()
633633
endif()
634+
if( openmpi)
635+
set (test_parameters ${test_parameters} --allow-run-as-root)
636+
message( STATUS "Open-MPI back end detected, passing --allow-run-as-root to allow tests to pass when run with sudo or as root." )
637+
endif()
634638
set(test_parameters -np ${num_caf_img} ${test_parameters})
635639
if(DEFINED ARGN)
636640
add_test(NAME ${name} COMMAND "bash" "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/cafrun" ${test_parameters} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test_target}" ${ARGN})

0 commit comments

Comments
 (0)