]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
tests: avoid using eval with variable assignments
authorMike Miller <mtmiller@debian.org>
Wed, 14 Dec 2016 18:02:13 +0000 (10:02 -0800)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 14 Dec 2016 20:12:59 +0000 (20:12 +0000)
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: Mike Miller <mtmiller@debian.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
tests/auth-pkcs11
tests/common.sh
www/changelog.xml

index adc40f5ad7379a4e17464cba035b58c44de0eabc..5e9bab73a383f61bd273e34f89d27c11e9c57075 100755 (executable)
@@ -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
index d89cf83545b61892c4ce8e772912aa12d16bc00e..6d5736a88b7646014e141cc1dfe461a365e70c04 100644 (file)
@@ -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"
index 93920b69715c5386c5f31f923afad43435ba169f..f5df1fdcbe3c8bc4c983240e14524cf30e76d4a7 100644 (file)
@@ -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>