skip patch that needs root

epel9
Nikos Mavrogiannopoulos 4 years ago
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

@ -44,6 +44,7 @@ Source8: ocserv-genkey
Source9: ocserv-script
Source10: gpgkey-56EE7FA9E8173B19FE86268D763712747F343FA7.gpg
Source11: ocserv.init
Patch0: ocserv-1.1.2-tests.patch
# Taken from upstream:
# http://git.infradead.org/ocserv.git/commitdiff/7d70006a2dbddf783213f1856374bacc74217e09
@ -195,7 +196,7 @@ autoreconf -fvi
--without-libwrap
%endif
make #%{?_smp_mflags}
make %{?_smp_mflags}
%pre
getent group ocserv &>/dev/null || groupadd -r ocserv
@ -284,7 +285,7 @@ install -D -m 0755 %{SOURCE11} %{buildroot}/%{_initrddir}/%{name}
%endif
%changelog
* Sat Dec 6 2020 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.1.2-1
* Sun Dec 6 2020 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - 1.1.2-1
- Update to upstream 1.1.2 release
* Mon Nov 23 2020 Nikos Mavrogiannopoulos <nmav@redhat.com> - 1.1.1-5

Loading…
Cancel
Save