Commit 8a350335 authored by Mike Miller's avatar Mike Miller Committed by David Woodhouse

tests: avoid using eval with variable assignments

For shell portability, avoid using eval with variable assignments to set
openconnect's environment. Shell implementations vary on whether
variable assignments in front of eval are marked as environment
variables or just treated as ordinary shell assignments.

Every call to $OPENCONNECT already has LD_PRELOAD=libsocket_wrapper.so
in front of it, so the "eval LD_PRELOAD=libsocket_wrapper.so" was
redundant anyway.
Signed-off-by: default avatarMike Miller <mtmiller@debian.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 9697bea0
......@@ -37,7 +37,7 @@ for TOKEN in ${pkcs11_tokens}; do
echo -n "Connecting to obtain cookie (token ${TOKEN} key ${KEY})... "
CERTURI="pkcs11:token=${TOKEN};${KEY};pin-value=1234"
( echo "test" | HOME=${srcdir} SOFTHSM2_CONF=softhsm2.conf LD_PRELOAD=libsocket_wrapper.so \
$OPENCONNECT -q $ADDRESS:443 -u test -c \"${CERTURI}\" --key-password 1234 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly --passwd-on-stdin ) ||
$OPENCONNECT -q $ADDRESS:443 -u test -c "${CERTURI}" --key-password 1234 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly --passwd-on-stdin ) ||
fail $PID "Could not connect with token ${TOKEN} key ${KEY##*/}!"
done
done
......
......@@ -31,7 +31,7 @@ mkdir -p $SOCKDIR
export SOCKET_WRAPPER_DIR=$SOCKDIR
export SOCKET_WRAPPER_DEFAULT_IFACE=2
ADDRESS=127.0.0.$SOCKET_WRAPPER_DEFAULT_IFACE
OPENCONNECT="eval LD_PRELOAD=libsocket_wrapper.so ${top_builddir}/openconnect"
OPENCONNECT="${top_builddir}/openconnect"
certdir="${srcdir}/certs"
confdir="${srcdir}/configs"
......
......@@ -15,7 +15,7 @@
<ul>
<li><b>OpenConnect HEAD</b>
<ul>
<li><i>No changelog entries yet</i></li>
<li>Fix portability of shell scripts in test suite.</li>
</ul><br/>
</li>
<li><b><a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-7.08.tar.gz">OpenConnect v7.08</a></b>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment