From 044b910128643fe06577105c4e99ad3b2aa87be7 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 15 May 2014 11:52:17 +0200 Subject: [PATCH] Force full connection after cookie when a script is involved. That is because in the new design of ocserv, the cookie is being provided prior to any script being run or evaluated. --- tests/Makefile.am | 2 +- tests/kill-parent.sh | 5 +++++ tests/test-iroute | 5 +++++ tests/test-pass-script | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 tests/kill-parent.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index a80c0d71..1302299f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ EXTRA_DIST = ca-key.pem ca.pem common.sh server-cert.pem server-key.pem test1.config \ test1.passwd test-user-cert.config user-cert.pem user-key.pem test3.config test-iroute.config \ user-config/test test-pass-script.config test-multi-cookie.config test-pam.config \ - test-stress.config user-cert-wrong.pem connect-script + test-stress.config user-cert-wrong.pem connect-script kill-parent.sh dist_check_SCRIPTS = test-pass test-pass-cert test-cert test-iroute test-pass-script \ test-multi-cookie test-pam test-stress full-test diff --git a/tests/kill-parent.sh b/tests/kill-parent.sh new file mode 100755 index 00000000..0a8d0151 --- /dev/null +++ b/tests/kill-parent.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +kill $PPID + +exit 0 diff --git a/tests/test-iroute b/tests/test-iroute index 8df70d9a..81df1b27 100755 --- a/tests/test-iroute +++ b/tests/test-iroute @@ -37,6 +37,11 @@ echo -n "Connecting to obtain cookie (with certificate)... " echo ok +echo -n "Re-connecting to force script run... " +openconnect -q localhost:$PORT --sslkey ${srcdir}/user-key.pem -c ${srcdir}/user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -s ./kill-parent.sh /dev/null 2>&1 + +echo ok + sleep 1 echo -n "Checking if routes have been applied... " diff --git a/tests/test-pass-script b/tests/test-pass-script index b1a1c8f1..3ad3dbc8 100755 --- a/tests/test-pass-script +++ b/tests/test-pass-script @@ -45,6 +45,8 @@ echo "Connecting to obtain cookie... " ( echo "!@#$%^&*()<>" | openconnect -q localhost:$PORT -u special --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 special --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -s ./kill-parent.sh >/dev/null 2>&1 kill $PID wait