parent
e9d48e920a
commit
4fa9fe0ca2
@ -0,0 +1,42 @@
|
|||||||
|
From 8d3dc40a5f59be1c91236823b4b4f75adb2e8e7c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
|
||||||
|
Date: Sun, 6 Dec 2020 19:55:03 +0100
|
||||||
|
Subject: [PATCH] tests: drain-server-fail: make sure it runs only when root
|
||||||
|
|
||||||
|
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
|
||||||
|
---
|
||||||
|
tests/common.sh | 3 +++
|
||||||
|
tests/drain-server-fail | 3 ++-
|
||||||
|
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tests/common.sh b/tests/common.sh
|
||||||
|
index cd9bc885..d574d2d0 100644
|
||||||
|
--- a/tests/common.sh
|
||||||
|
+++ b/tests/common.sh
|
||||||
|
@@ -45,6 +45,9 @@ else
|
||||||
|
echo "Skipping test requiring ldpreload"
|
||||||
|
exit 77
|
||||||
|
fi
|
||||||
|
+fi
|
||||||
|
+
|
||||||
|
+if test "${NEED_SOCKET_WRAPPER}" = 1 || test "${NO_NEED_ROOT}" = 1;then
|
||||||
|
SOCKDIR="${srcdir}/tmp/sockwrap.$$.tmp"
|
||||||
|
mkdir -p $SOCKDIR
|
||||||
|
export SOCKET_WRAPPER_DIR=$SOCKDIR
|
||||||
|
diff --git a/tests/drain-server-fail b/tests/drain-server-fail
|
||||||
|
index 40a2ed01..d61106e6 100755
|
||||||
|
--- a/tests/drain-server-fail
|
||||||
|
+++ b/tests/drain-server-fail
|
||||||
|
@@ -20,7 +20,8 @@
|
||||||
|
SERV="${SERV:-../src/ocserv}"
|
||||||
|
OCCTL="${OCCTL:-../src/occtl/occtl}"
|
||||||
|
srcdir=${srcdir:-.}
|
||||||
|
-NO_NEED_ROOT=1
|
||||||
|
+#we cannot use NO_NEED_ROOT here as occtl commands can only be issued by root
|
||||||
|
+NEED_SOCKET_WRAPPER=1
|
||||||
|
PIDFILE=ocserv-pid.$$.tmp
|
||||||
|
OCCTL_SOCKET=./occtl-drain-$$.socket
|
||||||
|
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
Loading…
Reference in new issue