Skip to content

Commit

Permalink
Fix #520: Allow tests w/ OpenMPI to run as root
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeekman committed Aug 10, 2018
1 parent ff5329d commit 487a046
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,10 @@ function(add_caf_test name num_caf_img test_target)
message( STATUS "Open-MPI back end detected, passing --oversubscribe for oversubscribed test, ${name}, with ${num_caf_img} ranks/images." )
endif()
endif()
if( openmpi)
set (test_parameters ${test_parameters} --allow-run-as-root)
message( STATUS "Open-MPI back end detected, passing --allow-run-as-root to allow tests to pass when run with sudo or as root." )
endif()
set(test_parameters -np ${num_caf_img} ${test_parameters})
if(DEFINED ARGN)
add_test(NAME ${name} COMMAND "bash" "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/cafrun" ${test_parameters} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test_target}" ${ARGN})
Expand Down

0 comments on commit 487a046

Please sign in to comment.