From: Daniel Lenski Date: Tue, 8 Dec 2020 06:12:05 +0000 (-0800) Subject: use `ip netns` instead of ocserv `listen-netns` config option for test configs X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c184f845afc20b5c1af4a0bde809ca167263438a;p=users%2Fdwmw2%2Fvpnc-scripts.git use `ip netns` instead of ocserv `listen-netns` config option for test configs `listen-netns` is new in ocserv 1.1.1, while iproute2's `ip netns` will work more universally on Linux, allowing testing on older Linux distributions (see https://gitlab.com/openconnect/vpnc-scripts/-/commit/c95a3ad0e77963fea73c185ff0308e1edabe522c#note_457425702) Signed-off-by: Daniel Lenski --- diff --git a/tests/data/vpn-noroute.config b/tests/data/vpn-noroute.config index e753a40..7bf8d79 100644 --- a/tests/data/vpn-noroute.config +++ b/tests/data/vpn-noroute.config @@ -7,7 +7,9 @@ auth = "plain[@SRCDIR@/data/ocserv.passwd]" isolate-workers = @ISOLATE_WORKERS@ -listen-netns = @LISTEN_NS@ +# Only supported in ocserv v1.1.1+; use iproute2's ip netns to run +# in network namespaces with earlier versions. +#listen-netns = @LISTEN_NS@ max-ban-score = 0 diff --git a/tests/data/vpn-routes.config b/tests/data/vpn-routes.config index 5778b35..e876ea2 100644 --- a/tests/data/vpn-routes.config +++ b/tests/data/vpn-routes.config @@ -7,7 +7,9 @@ auth = "plain[@SRCDIR@/data/ocserv.passwd]" isolate-workers = @ISOLATE_WORKERS@ -listen-netns = @LISTEN_NS@ +# Only supported in ocserv v1.1.1+; use iproute2's ip netns to run +# in network namespaces with earlier versions. +#listen-netns = @LISTEN_NS@ max-ban-score = 0 diff --git a/tests/vpn-noroute b/tests/vpn-noroute index ed93b9f..8e89e23 100755 --- a/tests/vpn-noroute +++ b/tests/vpn-noroute @@ -102,8 +102,8 @@ fi echo " * Running server on ${ADDRESS}:${PORT}" -# runs on NSNAME2 due to configuration -${OCSERV} -p ${PIDFILE} -c ${CONFIG} ${DEBUG} -f & +# run on NSNAME2 +${CMDNS2} ${OCSERV} -p ${PIDFILE} -c ${CONFIG} ${DEBUG} -f & sleep 4 diff --git a/tests/vpn-routes b/tests/vpn-routes index 59593de..4bf4570 100755 --- a/tests/vpn-routes +++ b/tests/vpn-routes @@ -99,8 +99,8 @@ fi echo " * Running server on ${ADDRESS}:${PORT}" -# runs on NSNAME2 due to configuration -${OCSERV} -p ${PIDFILE} -c ${CONFIG} ${DEBUG} -f & +# run on NSNAME2 +${CMDNS2} ${OCSERV} -p ${PIDFILE} -c ${CONFIG} ${DEBUG} -f & sleep 4