From 2fc75660bcf148c13eea61597fde458be2f6c18f Mon Sep 17 00:00:00 2001 From: "kaie%kuix.de" Date: Thu, 3 May 2012 10:35:19 +0000 Subject: [PATCH] Bug 741873 - If the OCSP server is unreachable during NSS test suite execution, return a failure, 2 patches, r=rrelyea git-svn-id: svn://10.0.0.236/trunk@263786 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/security/nss/tests/chains/chains.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/mozilla/security/nss/tests/chains/chains.sh b/mozilla/security/nss/tests/chains/chains.sh index e5a66a40d57..d81f28ef2a2 100644 --- a/mozilla/security/nss/tests/chains/chains.sh +++ b/mozilla/security/nss/tests/chains/chains.sh @@ -762,18 +762,13 @@ check_ocsp() CERT_FILE=${CERT} fi + # sample line: + # URI: "http://ocsp.server:2601" OCSP_HOST=$(${BINDIR}/pp -t certificate -i ${CERT_FILE} | grep URI | sed "s/.*:\/\///" | sed "s/:.*//") + OCSP_PORT=$(${BINDIR}/pp -t certificate -i ${CERT_FILE} | grep URI | sed "s/.*:.*:\([0-9]*\)\"/\1/") - if [ "${OS_ARCH}" = "WINNT" ]; then - ping -n 1 ${OCSP_HOST} - return $? - elif [ "${OS_ARCH}" = "HP-UX" ]; then - ping ${OCSP_HOST} -n 1 - return $? - else - ping -c 1 ${OCSP_HOST} - return $? - fi + tstclnt -h ${OCSP_HOST} -p ${OCSP_PORT} -q -t 20 + return $? } ############################ parse_result ############################## @@ -965,10 +960,13 @@ parse_config() break ;; "check_ocsp") + TESTNAME="Test that OCSP server is reachable" check_ocsp ${VALUE} if [ $? -ne 0 ]; then - echo "OCSP server not accessible, skipping OCSP tests" + html_failed "$TESTNAME" break; + else + html_passed "$TESTNAME" fi ;; "ku")