Blame tests/starttls-xmpp.sh

Packit Service 4684c1
#!/bin/sh
Packit Service 4684c1
Packit Service 4684c1
# Copyright (C) 2010-2016 Free Software Foundation, Inc.
Packit Service 4684c1
#
Packit Service 4684c1
# Author: Nikos Mavrogiannopoulos
Packit Service 4684c1
#
Packit Service 4684c1
# This file is part of GnuTLS.
Packit Service 4684c1
#
Packit Service 4684c1
# GnuTLS is free software; you can redistribute it and/or modify it
Packit Service 4684c1
# under the terms of the GNU General Public License as published by the
Packit Service 4684c1
# Free Software Foundation; either version 3 of the License, or (at
Packit Service 4684c1
# your option) any later version.
Packit Service 4684c1
#
Packit Service 4684c1
# GnuTLS is distributed in the hope that it will be useful, but
Packit Service 4684c1
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 4684c1
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 4684c1
# General Public License for more details.
Packit Service 4684c1
#
Packit Service 4684c1
# You should have received a copy of the GNU General Public License
Packit Service 4684c1
# along with GnuTLS; if not, write to the Free Software Foundation,
Packit Service 4684c1
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit Service 4684c1
Packit Service 4684c1
srcdir="${srcdir:-.}"
Packit Service 4684c1
SERV="${SERV:-../src/gnutls-serv${EXEEXT}}"
Packit Service 4684c1
CLI="${CLI:-../src/gnutls-cli${EXEEXT}}"
Packit Service 4684c1
unset RETCODE
Packit Service 4684c1
Packit Service 4684c1
. "${srcdir}/scripts/common.sh"
Packit Service 4684c1
. "${srcdir}/scripts/starttls-common.sh"
Packit Service 4684c1
Packit Service 4684c1
echo "Checking STARTTLS over XMPP"
Packit Service 4684c1
Packit Service 4684c1
eval "${GETPORT}"
Packit Service 4684c1
socat TCP-LISTEN:${PORT} EXEC:"$CHAT -e -S -v -f ${srcdir}/starttls-xmpp.txt",pty &
Packit Service 4684c1
PID=$!
Packit Service 4684c1
wait_server ${PID}
Packit Service 4684c1
Packit Service 4684c1
${VALGRIND} "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:+ANON-ECDH --insecure --starttls-proto xmpp --verbose </dev/null >/dev/null
Packit Service 4684c1
if test $? != 1;then
Packit Service 4684c1
	fail ${PID} "connect should have failed with error code 1"
Packit Service 4684c1
fi
Packit Service 4684c1
Packit Service 4684c1
kill ${PID}
Packit Service 4684c1
wait
Packit Service 4684c1
Packit Service 4684c1
exit 0