diff --git a/tests/common.sh b/tests/common.sh index 7ec92516..5507e397 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -32,6 +32,8 @@ if ! test -x /usr/sbin/openconnect;then exit 77 fi +OPENCONNECT=/usr/sbin/openconnect + fail() { PID=$1 shift; diff --git a/tests/full-test b/tests/full-test index 05c76d00..ecb50bda 100755 --- a/tests/full-test +++ b/tests/full-test @@ -55,21 +55,21 @@ if test ! -z "$QUIT_ON_INIT";then fi printf "testuser\n" >pass-full$TMP -openconnect $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-full$TMP +$OPENCONNECT $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-full$TMP if test $? = 0;then echo "Authentication with wrong password succeeded!" stop fi printf "test\n" >pass-full$TMP -openconnect $IP:$PORT_OCSERV -u testuser --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-full$TMP +$OPENCONNECT $IP:$PORT_OCSERV -u testuser --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-full$TMP if test $? = 0;then echo "Authentication with wrong username succeeded!" stop fi printf "test\n" >pass-full$TMP -openconnect $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass-full$TMP & +$OPENCONNECT $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass-full$TMP & PID=$! rm -f pass-full$TMP diff --git a/tests/pam-test b/tests/pam-test index be3b7e90..c0f0dcc1 100755 --- a/tests/pam-test +++ b/tests/pam-test @@ -54,21 +54,21 @@ if test ! -z "$QUIT_ON_INIT";then fi printf "testuser\n" >pass-pam.tmp -openconnect $IP:$PORT_OCSERV -u testuser --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-pam.tmp +$OPENCONNECT $IP:$PORT_OCSERV -u testuser --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-pam.tmp if test $? = 0;then echo "Authentication with wrong password succeeded!" stop fi printf "testuser123\n" >pass-pam.tmp -openconnect $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-pam.tmp +$OPENCONNECT $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-pam.tmp if test $? = 0;then echo "Authentication with wrong username succeeded!" stop fi printf "testuser123\n" >pass-pam.tmp -openconnect $IP:$PORT_OCSERV -u testuser --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass-pam.tmp & +$OPENCONNECT $IP:$PORT_OCSERV -u testuser --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass-pam.tmp & PID=$! rm -f pass-pam.tmp diff --git a/tests/radius-test b/tests/radius-test index 3d976e94..ff404ab2 100755 --- a/tests/radius-test +++ b/tests/radius-test @@ -57,14 +57,14 @@ if test ! -z "$QUIT_ON_INIT";then fi printf "testuser\n" >pass-radius$TMP -openconnect $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-radius$TMP +$OPENCONNECT $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-radius$TMP if test $? = 0;then echo "Authentication with wrong password succeeded!" stop fi printf "test\n" >pass-radius$TMP -openconnect $IP:$PORT_OCSERV -u testuser --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-radius$TMP +$OPENCONNECT $IP:$PORT_OCSERV -u testuser --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly < pass-radius$TMP if test $? = 0;then echo "Authentication with wrong username succeeded!" stop @@ -72,7 +72,7 @@ fi echo "Trying with correct password" printf "test\n" >pass-radius$TMP -openconnect $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass-radius$TMP & +$OPENCONNECT $IP:$PORT_OCSERV -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass-radius$TMP & PID=$! rm -f pass-radius$TMP diff --git a/tests/test-ban b/tests/test-ban index 4041efcd..0c9453ee 100755 --- a/tests/test-ban +++ b/tests/test-ban @@ -30,15 +30,15 @@ launch_server -d 1 -f -c ${srcdir}/test-ban.config & PID=$! wait_server $PID echo "Connecting with wrong password 5 times... " -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 echo "" echo "Connecting with correct password... " -eval `echo "test" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` +eval `echo "test" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` if [ -n "$COOKIE" ];then fail $PID "Obtained cookie although should have been banned" @@ -49,7 +49,7 @@ sleep 25 echo "" echo "Connecting with correct password after ban time... " -eval `echo "test" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` +eval `echo "test" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` if [ -z "$COOKIE" ];then fail $PID "Could not obtain cookie even though ban should be lifted" @@ -58,16 +58,16 @@ fi echo "" echo "Checking ban reset time... " -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 sleep 11 -echo "notest" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "notest" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 echo "" echo "Connecting with correct password after ban reset time... " -eval `echo "test" | openconnect --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` +eval `echo "test" | $OPENCONNECT --passwd-on-stdin -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` if [ -z "$COOKIE" ];then fail $PID "Could not obtain cookie even though ban should be lifted" diff --git a/tests/test-cert b/tests/test-cert index 153df0f2..afe9fd99 100755 --- a/tests/test-cert +++ b/tests/test-cert @@ -43,13 +43,13 @@ PID=$! wait_server $PID echo -n "Connecting to obtain cookie (without certificate)... " -( openconnect -q localhost:$PORT --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) && +( $OPENCONNECT -q localhost:$PORT --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) && fail $PID "Connected without certificate!" echo ok echo -n "Connecting to obtain cookie (with certificate)... " -( openconnect -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) || +( $OPENCONNECT -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok @@ -68,13 +68,13 @@ kill -HUP $PID sleep 5 echo -n "Connecting to obtain cookie (with revoked certificate)... " -( openconnect -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) && +( $OPENCONNECT -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) && fail $PID "Connected with revoked certificate!" echo ok #echo "Normal connection... " -#( echo "test" | openconnect -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true ) || +#( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true ) || # fail $PID "Could not connect to server" rm -f crl.pem crl.tmpl diff --git a/tests/test-cookie-timeout b/tests/test-cookie-timeout index e5d16f73..2a445bc2 100755 --- a/tests/test-cookie-timeout +++ b/tests/test-cookie-timeout @@ -31,7 +31,7 @@ launch_server -d 1 -f -c ${srcdir}/test-cookie-timeout.config & PID=$! wait_server $PID echo "Connecting to obtain cookie... " -eval `echo "test" | openconnect -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` +eval `echo "test" | $OPENCONNECT -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` if [ -z "$COOKIE" ];then fail $PID "Could not obtain cookie" @@ -41,7 +41,7 @@ fi sleep 10 echo "" echo "Connecting with cookie... " -echo "test" | openconnect -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ & +echo "test" | $OPENCONNECT -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ & sleep 4 @@ -57,7 +57,7 @@ wait $CPID sleep 10 echo "" echo "Connecting again with cookie... " -echo "test" | openconnect -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ & +echo "test" | $OPENCONNECT -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ & sleep 4 @@ -73,7 +73,7 @@ wait $CPID sleep 10 echo "" echo "Connecting after forced kill with cookie... " -echo "test" | openconnect -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ & +echo "test" | $OPENCONNECT -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ & sleep 4 @@ -90,7 +90,7 @@ wait $CPID sleep 40 echo "" echo "Connecting with cookie after expiration... " -echo "test" | openconnect -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ & +echo "test" | $OPENCONNECT -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ & sleep 4 @@ -105,7 +105,7 @@ fi # test cookie verification after cookie verification failure. That is to verify whether # the channel between main and sec-mod is in consistent state. echo "Connecting (again) to obtain cookie... " -echo "test" | openconnect -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 +echo "test" | $OPENCONNECT -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 if test $? != 0;then fail $PID "Could not obtain cookie" diff --git a/tests/test-cookie-timeout-2 b/tests/test-cookie-timeout-2 index 376c43da..c8aebe49 100755 --- a/tests/test-cookie-timeout-2 +++ b/tests/test-cookie-timeout-2 @@ -31,7 +31,7 @@ launch_server -d 1 -f -c ${srcdir}/test-cookie-timeout-2.config & PID=$! wait_server $PID echo "Connecting to obtain cookie... " -eval `echo "test" | openconnect -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` +eval `echo "test" | $OPENCONNECT -q localhost:$PORT -u test --authenticate --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3` if [ -z "$COOKIE" ];then fail $PID "Could not obtain cookie" @@ -41,7 +41,7 @@ fi sleep 10 echo "" echo "Connecting with cookie... " -echo "test" | openconnect -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid.$$ & +echo "test" | $OPENCONNECT -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid.$$ & sleep 4 @@ -56,7 +56,7 @@ rm -f "${srcdir}/pid2.$$" sleep 30 echo "" echo "Connecting again with cookie (overriding first session)... " -echo "test" | openconnect -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid2.$$ & +echo "test" | $OPENCONNECT -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid2.$$ & sleep 6 diff --git a/tests/test-explicit-ip b/tests/test-explicit-ip index 3a2a3b6a..9f70c42c 100755 --- a/tests/test-explicit-ip +++ b/tests/test-explicit-ip @@ -30,13 +30,13 @@ connect() opts=$1 pass=$2 COOKIE='' -eval `echo "$pass" | openconnect -q localhost:$PORT $opts --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --authenticate` +eval `echo "$pass" | $OPENCONNECT -q localhost:$PORT $opts --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --authenticate` if [ -z "$COOKIE" ];then return 1 fi rm -f $TMPFILE -echo "$pass" | openconnect -q localhost:$PORT $opts -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pidx >$TMPFILE 2>&1 & +echo "$pass" | $OPENCONNECT -q localhost:$PORT $opts -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pidx >$TMPFILE 2>&1 & CPID=$! sleep 3 diff --git a/tests/test-group-cert b/tests/test-group-cert index 270bebe4..4c16b94e 100644 --- a/tests/test-group-cert +++ b/tests/test-group-cert @@ -30,31 +30,31 @@ launch_server -d 1 -f -c test-group-cert.config & PID=$! wait_server $PID echo -n "Connecting to obtain cookie (without certificate)... " -( echo "test" | openconnect --authgroup group1 -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && +( echo "test" | $OPENCONNECT --authgroup group1 -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && fail $PID "Connected without certificate!" echo ok echo -n "Connecting to obtain cookie - group1 (with certificate)... " -( echo "test" | openconnect --authgroup group1 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT --authgroup group1 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie - group2 (with certificate)... " -( echo "test" | openconnect --authgroup group2 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT --authgroup group2 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie - group3 (hidden) (with certificate)... " -( echo "test" | openconnect --authgroup group3 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT --authgroup group3 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie - group4 (with certificate)... " -( echo "test" | openconnect --authgroup group4 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT --authgroup group4 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok diff --git a/tests/test-group-pass b/tests/test-group-pass index 756ac5ef..e95dd7ba 100755 --- a/tests/test-group-pass +++ b/tests/test-group-pass @@ -30,19 +30,19 @@ launch_server -d 1 -f -c test-group-pass.config & PID=$! wait_server $PID echo "Connecting to obtain cookie... " -( echo "test" | openconnect -q localhost:$PORT -u test --authgroup group1 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --authgroup group1 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not receive cookie from server" echo "Connecting to obtain cookie... " -( echo "test" | openconnect -q localhost:$PORT -u test --authgroup group2 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --authgroup group2 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not receive cookie from server" echo "Connecting to obtain cookie... " -( echo "test" | openconnect -q localhost:$PORT -u test --authgroup group2 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --authgroup group2 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not receive cookie from server" echo "Connecting to obtain cookie with wrong groupname... " -( echo "test" | openconnect -q localhost:$PORT -u test --authgroup group4 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && +( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --authgroup group4 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && fail $PID "Received cookie when we shouldn't" kill $PID diff --git a/tests/test-iroute b/tests/test-iroute index 19594c6b..e5f7488b 100755 --- a/tests/test-iroute +++ b/tests/test-iroute @@ -32,13 +32,13 @@ launch_server -d 1 -f -c ${srcdir}/test-iroute.config & PID=$! wait_server $PID echo -n "Connecting to obtain cookie (with certificate)... " -( openconnect -q localhost:$PORT --sslkey ${srcdir}/user-key.pem -c ${srcdir}/user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) || +( $OPENCONNECT -q localhost:$PORT --sslkey ${srcdir}/user-key.pem -c ${srcdir}/user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 & +$OPENCONNECT -q localhost:$PORT --sslkey ${srcdir}/user-key.pem -c ${srcdir}/user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -s ./bin/true /dev/null 2>&1 ) || +#( echo "test" | $OPENCONNECT -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || # fail $PID "Could not connect to server" -echo "test" | openconnect -q localhost:$PORT -b -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid2.$$ & +echo "test" | $OPENCONNECT -q localhost:$PORT -b -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid2.$$ & C2PID=$! sleep 4 diff --git a/tests/test-pass b/tests/test-pass index 3ddd3a5a..b0318879 100755 --- a/tests/test-pass +++ b/tests/test-pass @@ -30,29 +30,29 @@ launch_server -d 1 -f -c test1.config & PID=$! wait_server $PID echo "Connecting to obtain cookie... " -( echo "test" | openconnect -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not receive cookie from server" echo "Connecting to obtain cookie with wrong password... " -( echo "tost" | openconnect -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && +( echo "tost" | $OPENCONNECT -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && fail $PID "Received cookie when we shouldn't" echo "Connecting to obtain cookie with wrong username... " -( echo "tost" | openconnect -q localhost:$PORT -u tost --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && +( echo "tost" | $OPENCONNECT -q localhost:$PORT -u tost --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && fail $PID "Received cookie when we shouldn't" #test special characters echo "Connecting to obtain cookie... " -( echo "!@#$%^&*()<>" | openconnect -q localhost:$PORT -u "sp@c/al" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "!@#$%^&*()<>" | $OPENCONNECT -q localhost:$PORT -u "sp@c/al" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not receive cookie from server" echo "Connecting to obtain cookie with empty password... " -( echo "" | openconnect -q localhost:$PORT -u "empty" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "" | $OPENCONNECT -q localhost:$PORT -u "empty" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not receive cookie from server" #echo "Normal connection... " -#( echo "test" | openconnect -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true ) || +#( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true ) || # fail $PID "Could not connect to server" kill $PID diff --git a/tests/test-pass-cert b/tests/test-pass-cert index 02c45ec7..37418fef 100755 --- a/tests/test-pass-cert +++ b/tests/test-pass-cert @@ -30,26 +30,26 @@ launch_server -d 1 -f -c test-user-cert.config & PID=$! wait_server $PID echo -n "Connecting to obtain cookie (without certificate)... " -( echo "test" | openconnect -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && +( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && fail $PID "Connected without certificate!" echo ok echo -n "Connecting to obtain cookie (with certificate)... " -( echo "test" | openconnect -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie (with incorrect certificate)... " -( echo "test" | openconnect -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert-wrong.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && +( echo "test" | $OPENCONNECT -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert-wrong.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && fail $PID "Should not have connected with wrong certificate!" echo ok #echo "Normal connection... " -#( echo "test" | openconnect -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true ) || +#( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true ) || # fail $PID "Could not connect to server" kill $PID diff --git a/tests/test-pass-group-cert b/tests/test-pass-group-cert index 603b4a92..1e74f8de 100755 --- a/tests/test-pass-group-cert +++ b/tests/test-pass-group-cert @@ -30,37 +30,37 @@ launch_server -d 1 -f -c test-user-group-cert.config & PID=$! wait_server $PID echo -n "Connecting to obtain cookie (without certificate)... " -( echo "test" | openconnect --authgroup group1 -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && +( echo "test" | $OPENCONNECT --authgroup group1 -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && fail $PID "Connected without certificate!" echo ok echo -n "Connecting to obtain cookie - group1 (with certificate)... " -( echo "test" | openconnect --authgroup group1 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT --authgroup group1 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie - DEFAULT (with certificate)... " -( echo "test" | openconnect --authgroup DEFAULT -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT --authgroup DEFAULT -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie - group2 (with certificate)... " -( echo "test" | openconnect --authgroup group2 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT --authgroup group2 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie - group3 (hidden) (with certificate)... " -( echo "test" | openconnect --authgroup group3 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "test" | $OPENCONNECT --authgroup group3 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie - group4 (with certificate)... " -( echo "test" | openconnect --authgroup group4 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && +( echo "test" | $OPENCONNECT --authgroup group4 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && fail $PID "Got cookie when it shouldn't!" echo ok diff --git a/tests/test-pass-group-cert-no-pass b/tests/test-pass-group-cert-no-pass index 085ec4ac..d4b71dda 100755 --- a/tests/test-pass-group-cert-no-pass +++ b/tests/test-pass-group-cert-no-pass @@ -30,25 +30,25 @@ launch_server -d 1 -f -c test-user-group-cert-no-pass.config & PID=$! wait_server $PID echo -n "Connecting to obtain cookie (without certificate)... " -openconnect --authgroup group1 -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 && +$OPENCONNECT --authgroup group1 -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 && fail $PID "Connected without certificate!" echo ok echo -n "Connecting to obtain cookie - group1 (with certificate)... " -openconnect --authgroup group1 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 || +$OPENCONNECT --authgroup group1 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie - group2 (with certificate)... " -openconnect --authgroup group2 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 || +$OPENCONNECT --authgroup group2 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 || fail $PID "Could not connect with certificate!" echo ok echo -n "Connecting to obtain cookie - group3 (hidden) (with certificate)... " -openconnect --authgroup group3 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 || +$OPENCONNECT --authgroup group3 -q localhost:$PORT --sslkey ./user-group-key.pem -c ./user-group-cert.pem -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 || fail $PID "Could not connect with certificate!" echo ok diff --git a/tests/test-pass-opt-cert b/tests/test-pass-opt-cert index 35c12088..627baef0 100755 --- a/tests/test-pass-opt-cert +++ b/tests/test-pass-opt-cert @@ -30,13 +30,13 @@ connect() opts=$1 pass=$2 COOKIE='' -eval `echo "$pass" | openconnect -q localhost:$PORT $opts --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --authenticate` +eval `echo "$pass" | $OPENCONNECT -q localhost:$PORT $opts --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --authenticate` if [ -z "$COOKIE" ];then return 1 fi rm -f $TMPFILE -echo "$pass" | openconnect -q localhost:$PORT $opts -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pidx >$TMPFILE 2>&1 & +echo "$pass" | $OPENCONNECT -q localhost:$PORT $opts -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pidx >$TMPFILE 2>&1 & CPID=$! sleep 3 @@ -85,7 +85,7 @@ fi echo ok #echo "Normal connection... " -#( echo "test" | openconnect -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true ) || +#( echo "test" | $OPENCONNECT -q localhost:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true ) || # fail $PID "Could not connect to server" kill $PID diff --git a/tests/test-pass-script b/tests/test-pass-script index c046364d..b64f18b0 100755 --- a/tests/test-pass-script +++ b/tests/test-pass-script @@ -34,7 +34,7 @@ launch_server -d 1 -f -c test-pass-script.config & PID=$! wait_server $PID echo "Connecting to obtain cookie with wrong username... " -( echo "tost" | openconnect -q localhost:$PORT -u tost --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && +( echo "tost" | $OPENCONNECT -q localhost:$PORT -u tost --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) && fail $PID "Received cookie when we shouldn't" rm -f ${builddir}/connect.ok @@ -42,11 +42,11 @@ rm -f ${builddir}/disconnect.ok #test special characters echo "Connecting to obtain cookie... " -( echo "!@#$%^&*()<>" | openconnect -q localhost:$PORT -u sp@c/al --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || +( echo "!@#$%^&*()<>" | $OPENCONNECT -q localhost:$PORT -u sp@c/al --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || fail $PID "Could not receive cookie from server" echo "Re-connecting to force script run... " -echo "!@#$%^&*()<>" | openconnect -q localhost:$PORT -u sp@c/al --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -s ./bin/true >/dev/null 2>&1 & +echo "!@#$%^&*()<>" | $OPENCONNECT -q localhost:$PORT -u sp@c/al --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -s ./bin/true >/dev/null 2>&1 & kpid=$! sleep 2 diff --git a/tests/test-sighup b/tests/test-sighup index 7d5f25d0..d464ccdd 100755 --- a/tests/test-sighup +++ b/tests/test-sighup @@ -33,7 +33,7 @@ PID=$! wait_server $PID echo -n "Connecting to obtain cookie (with certificate)... " -( openconnect -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) || +( $OPENCONNECT -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok @@ -43,7 +43,7 @@ kill -HUP $PID sleep 5 echo -n "Connecting to obtain cookie (with certificate)... " -( openconnect -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) || +( $OPENCONNECT -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok @@ -55,7 +55,7 @@ kill -HUP $PID sleep 5 echo -n "Connecting to obtain cookie (with certificate)... " -( openconnect -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) || +( $OPENCONNECT -q localhost:$PORT --sslkey ./user-key.pem -c ./user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly /dev/null 2>&1 ) || fail $PID "Could not connect with certificate!" echo ok diff --git a/tests/test-stress b/tests/test-stress index 1ed2859a..02a0c7ea 100755 --- a/tests/test-stress +++ b/tests/test-stress @@ -32,7 +32,7 @@ run_client() { PASS=$1; shift; - ( echo $PASS | openconnect -q $HOST -u $USER --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -s /bin/true >/dev/null 2>&1 ) || + ( echo $PASS | $OPENCONNECT -q $HOST -u $USER --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -s /bin/true >/dev/null 2>&1 ) || echo "$USER: Could not connect to server" } diff --git a/tests/unix-test b/tests/unix-test index 7b821f50..ad3f5d01 100755 --- a/tests/unix-test +++ b/tests/unix-test @@ -54,7 +54,7 @@ if test ! -z "$QUIT_ON_INIT";then fi printf "test\ntest\n" >pass$TMP -openconnect $IP:6551 -u test --passwd-on-stdin --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass$TMP & +$OPENCONNECT $IP:6551 -u test --passwd-on-stdin --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass$TMP & PID=$! rm -f pass$TMP