diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-02-06 12:02:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-06 12:02:47 +0100 |
commit | 389c60da5e01761f4a11ef539ffa26e4c1b17875 (patch) | |
tree | c6033924a0de9be1ab140596e305898c651bf57e /security/nss/tests/interop | |
parent | 7c9b585349c985df0cf6ace83da5dadba8b5c677 (diff) | |
parent | f017b749ea9f1586d2308504553d40bf4cc5439d (diff) | |
download | UXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.tar UXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.tar.gz UXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.tar.lz UXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.tar.xz UXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.zip |
Merge pull request #13 from MoonchildProductions/ported-upstream
Ported upstream
Diffstat (limited to 'security/nss/tests/interop')
-rw-r--r-- | security/nss/tests/interop/interop.sh | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/security/nss/tests/interop/interop.sh b/security/nss/tests/interop/interop.sh new file mode 100644 index 000000000..59f0cb481 --- /dev/null +++ b/security/nss/tests/interop/interop.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +######################################################################## +# +# tests/interop/interop.sh +# +# Script to drive our cross-stack interop tests +# +######################################################################## + +interop_init() +{ + SCRIPTNAME="interop.sh" + if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ] ; then + cd ../common + . ./init.sh + fi + + mkdir -p "${HOSTDIR}/interop" + cd "${HOSTDIR}/interop" + INTEROP=${INTEROP:=tls_interop} + if [ ! -d "$INTEROP" ]; then + git clone -q https://github.com/mozilla/tls-interop "$INTEROP" + fi + INTEROP=$(cd "$INTEROP";pwd -P) + + # We use the BoringSSL keyfiles + BORING=${BORING:=boringssl} + if [ ! -d "$BORING" ]; then + git clone -q https://boringssl.googlesource.com/boringssl "$BORING" + git -C "$BORING" checkout -q ea80f9d5df4c302de391e999395e1c87f9c786b3 + fi + BORING=$(cd "$BORING";pwd -P) + + SCRIPTNAME="interop.sh" + html_head "interop test" +} + +interop_cleanup() +{ + html "</TABLE><BR>" + cd ${QADIR} + . common/cleanup.sh +} + +# Function so we can easily add other stacks +interop_run() +{ + test_name=$1 + client=$2 + server=$3 + + (cd "$INTEROP"; + cargo run -- --client "$client" --server "$server" --rootdir "$BORING"/ssl/test/runner/ --test-cases cases.json) 2>interop-${test_name}.errors | tee interop-${test_name}.log + html_msg "${PIPESTATUS[0]}" 0 "Interop" "Run successfully" + grep -i 'FAILED\|Assertion failure' interop-${test_name}.errors + html_msg $? 1 "Interop" "No failures" +} + +cd "$(dirname "$0")" +SOURCE_DIR="$PWD"/../.. +interop_init +NSS_SHIM="$BINDIR"/nss_bogo_shim +BORING_SHIM="$BORING"/build/ssl/test/bssl_shim +interop_run "nss_nss" ${NSS_SHIM} ${NSS_SHIM} +interop_cleanup |