diff --git a/common/tests/unit/kernel.cpp b/common/tests/unit/kernel.cpp index 0ab0a99a3..82f192ccd 100644 --- a/common/tests/unit/kernel.cpp +++ b/common/tests/unit/kernel.cpp @@ -10,6 +10,7 @@ #include #include +#include using namespace villas::kernel; @@ -47,7 +48,7 @@ Test(kernel, sizes) { Test(kernel, hugepages) { int ret; - if (getuid() != 0) { + if (!villas::utils::isPrivileged()) { cr_skip("Super-user permissions required."); } diff --git a/tests/integration/node-loopback-socket.sh b/tests/integration/node-loopback-socket.sh index 1da3e1fbc..5e96cde5e 100755 --- a/tests/integration/node-loopback-socket.sh +++ b/tests/integration/node-loopback-socket.sh @@ -8,7 +8,7 @@ set -e -if [[ "${EUID}" -ne 0 -o -n "${CI}" ]]; then +if [ "${EUID}" -ne 0 ] || [ -n "${CI}" ]; then echo "Test requires root permissions" exit 99 fi diff --git a/tests/integration/pipe-loopback-socket.sh b/tests/integration/pipe-loopback-socket.sh index 5e81facca..8dee69d35 100755 --- a/tests/integration/pipe-loopback-socket.sh +++ b/tests/integration/pipe-loopback-socket.sh @@ -8,7 +8,7 @@ set -e -if [[ "${EUID}" -ne 0 -o -n "${CI}" ]]; then +if [ "${EUID}" -ne 0 ] || [ -n "${CI}" ]; then echo "Test requires root permissions" exit 99 fi