summaryrefslogtreecommitdiff
path: root/tests/starttls.sh
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2017-02-22 21:45:32 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-02-23 08:53:09 +0100
commitdfa581aacff2765560938dc50f7f39e52155ba21 (patch)
treeaa4cd8735b462ba7ebd78bac784a902039b8e2ea /tests/starttls.sh
parent68df345eba8022701d833adf1f72798173a4d628 (diff)
downloadgnutls-dfa581aacff2765560938dc50f7f39e52155ba21.tar.gz
tests: split starttls.sh into multiple scripts
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'tests/starttls.sh')
-rwxr-xr-xtests/starttls.sh120
1 files changed, 2 insertions, 118 deletions
diff --git a/tests/starttls.sh b/tests/starttls.sh
index c0e5a6750e..929ab1d5cc 100755
--- a/tests/starttls.sh
+++ b/tests/starttls.sh
@@ -25,45 +25,11 @@ SERV="${SERV:-../src/gnutls-serv${EXEEXT}}"
CLI="${CLI:-../src/gnutls-cli${EXEEXT}}"
unset RETCODE
-if ! test -x "${SERV}"; then
- exit 77
-fi
-
-if ! test -x "${CLI}"; then
- exit 77
-fi
-
-if test "${WINDIR}" != ""; then
- exit 77
-fi
-
-if ! test -z "${VALGRIND}"; then
- VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=15"
-fi
-
-if test ! -x /usr/bin/socat;then
- exit 77
-fi
-
-for file in `which chat` /sbin/chat /usr/sbin/chat /usr/local/sbin/chat
-do
- if test -x "$file"
- then
- CHAT="$file"
- break
- fi
-done
-
-if test -z "$CHAT"
-then
- echo "chat not found"
- exit 77
-fi
+. "${srcdir}/scripts/common.sh"
+. "${srcdir}/scripts/starttls-common.sh"
SERV="${SERV} -q"
-. "${srcdir}/scripts/common.sh"
-
echo "Checking STARTTLS"
eval "${GETPORT}"
@@ -78,86 +44,4 @@ ${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:+ANON-ECDH --insec
kill ${PID}
wait
-echo "Checking STARTTLS over SMTP"
-
-eval "${GETPORT}"
-socat TCP-LISTEN:${PORT} EXEC:"$CHAT -e -S -v -f ${srcdir}/starttls-smtp.txt",pty &
-PID=$!
-wait_server ${PID}
-
-${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:+ANON-ECDH --insecure --starttls-proto smtp --verbose </dev/null >/dev/null
-if test $? != 1;then
- fail ${PID} "connect should have failed with error code 1"
-fi
-
-kill ${PID}
-wait
-
-echo "Checking STARTTLS over FTP"
-
-eval "${GETPORT}"
-socat TCP-LISTEN:${PORT} EXEC:"$CHAT -e -S -v -f ${srcdir}/starttls-ftp.txt",pty &
-PID=$!
-wait_server ${PID}
-
-${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:+ANON-ECDH --insecure --starttls-proto ftp --verbose </dev/null >/dev/null
-if test $? != 1;then
- fail ${PID} "connect should have failed with error code 1"
-fi
-
-kill ${PID}
-wait
-
-eval "${GETPORT}"
-socat TCP-LISTEN:${PORT} EXEC:"$CHAT -e -S -v -f ${srcdir}/starttls-lmtp.txt",pty &
-PID=$!
-wait_server ${PID}
-
-${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:+ANON-ECDH --insecure --starttls-proto lmtp --verbose </dev/null >/dev/null
-if test $? != 1;then
- fail ${PID} "connect should have failed with error code 1"
-fi
-
-kill ${PID}
-wait
-
-eval "${GETPORT}"
-socat TCP-LISTEN:${PORT} EXEC:"$CHAT -e -S -v -f ${srcdir}/starttls-pop3.txt",pty &
-PID=$!
-wait_server ${PID}
-
-${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:+ANON-ECDH --insecure --starttls-proto pop3 --verbose </dev/null >/dev/null
-if test $? != 1;then
- fail ${PID} "connect should have failed with error code 1"
-fi
-
-kill ${PID}
-wait
-
-eval "${GETPORT}"
-socat TCP-LISTEN:${PORT} EXEC:"$CHAT -e -S -v -f ${srcdir}/starttls-nntp.txt",pty &
-PID=$!
-wait_server ${PID}
-
-${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:+ANON-ECDH --insecure --starttls-proto nntp --verbose </dev/null >/dev/null
-if test $? != 1;then
- fail ${PID} "connect should have failed with error code 1"
-fi
-
-kill ${PID}
-wait
-
-eval "${GETPORT}"
-socat TCP-LISTEN:${PORT} EXEC:"$CHAT -e -S -v -f ${srcdir}/starttls-sieve.txt",pty &
-PID=$!
-wait_server ${PID}
-
-${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:+ANON-ECDH --insecure --starttls-proto sieve --verbose </dev/null >/dev/null
-if test $? != 1;then
- fail ${PID} "connect should have failed with error code 1"
-fi
-
-kill ${PID}
-wait
-
exit 0