security/nss/tests/cmdtests/cmdtests.sh

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 #! /bin/sh
michael@0 2 #
michael@0 3 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 6
michael@0 7 ########################################################################
michael@0 8 # Script to run small tests to test specific crashes of NSS
michael@0 9 #
michael@0 10 # needs to work on all Unix and Windows platforms
michael@0 11 #
michael@0 12 # included from
michael@0 13 # --------------
michael@0 14 # all.sh
michael@0 15 #
michael@0 16 # tests implemented:
michael@0 17 # vercrt (verify encryption cert - bugzilla bug 119059)
michael@0 18 # vercrtfps (verify encryption cert in fips mode - bugzilla bug 119214)
michael@0 19 # test3 (CERT_FindUserCertByUsage called 2nd time - bug 118864)
michael@0 20 #
michael@0 21 # special strings
michael@0 22 # ---------------
michael@0 23 #
michael@0 24 ########################################################################
michael@0 25
michael@0 26 ############################## cmdtests_init ###########################
michael@0 27 # local shell function to initialize this script
michael@0 28 ########################################################################
michael@0 29 cmdtests_init()
michael@0 30 {
michael@0 31 SCRIPTNAME=cmdtests.sh # sourced - $0 would point to all.sh
michael@0 32
michael@0 33 if [ -z "${CLEANUP}" ] ; then # if nobody else is responsible for
michael@0 34 CLEANUP="${SCRIPTNAME}" # cleaning this script will do it
michael@0 35 fi
michael@0 36
michael@0 37 if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
michael@0 38 cd ../common
michael@0 39 . ./init.sh
michael@0 40 fi
michael@0 41 if [ ! -r $CERT_LOG_FILE ]; then # we need certificates here
michael@0 42 cd ../cert
michael@0 43 . ./cert.sh
michael@0 44 fi
michael@0 45 SCRIPTNAME=cmdtests.sh
michael@0 46 html_head "Tests in cmd/tests"
michael@0 47
michael@0 48 # grep "SUCCESS: cmd/tests passed" $CERT_LOG_FILE >/dev/null || {
michael@0 49 # Exit 15 "Fatal - cert.sh needs to pass first"
michael@0 50 # }
michael@0 51
michael@0 52 CMDTESTSDIR=${HOSTDIR}/cmd/tests
michael@0 53 COPYDIR=${CMDTESTSDIR}/copydir
michael@0 54
michael@0 55 R_CMDTESTSDIR=../cmd/tests
michael@0 56 R_COPYDIR=../cmd/tests/copydir
michael@0 57 P_R_COPYDIR=${R_COPYDIR}
michael@0 58
michael@0 59 if [ -n "${MULTIACCESS_DBM}" ]; then
michael@0 60 P_R_COPYDIR="multiaccess:Cmdtests.$version"
michael@0 61 fi
michael@0 62
michael@0 63 mkdir -p ${CMDTESTSDIR}
michael@0 64 mkdir -p ${COPYDIR}
michael@0 65 mkdir -p ${CMDTESTSDIR}/html
michael@0 66
michael@0 67 cd ${CMDTESTSDIR}
michael@0 68 }
michael@0 69
michael@0 70 ############################## ct_vercrt ##################################
michael@0 71 # CERT_VerifyCert should not fail when verifying encryption cert
michael@0 72 # Bugzilla Bug 119059
michael@0 73 ########################################################################
michael@0 74 #ct_vercrt()
michael@0 75 #{
michael@0 76 # echo "$SCRIPTNAME: Verify encryption certificate ----------------------"
michael@0 77 # echo "vercrt"
michael@0 78 # vercrt
michael@0 79 # ret=$?
michael@0 80 # html_msg $ret 0 "Verify encryption certificate (vercrt)"
michael@0 81 #
michael@0 82 #}
michael@0 83
michael@0 84
michael@0 85 ############################## cmdtests_cleanup ########################
michael@0 86 # local shell function to finish this script (no exit since it might be
michael@0 87 # sourced)
michael@0 88 ########################################################################
michael@0 89 cmdtests_cleanup()
michael@0 90 {
michael@0 91 html "</TABLE><BR>"
michael@0 92 cd ${QADIR}
michael@0 93 . common/cleanup.sh
michael@0 94 }
michael@0 95
michael@0 96 ################## main #################################################
michael@0 97
michael@0 98 cmdtests_init
michael@0 99
michael@0 100 #ct_vercrt
michael@0 101 cmdtests_cleanup

mercurial