diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-01-04 14:24:24 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-01-04 14:24:24 +0000 |
commit | dc1565216a5d20ae0d75872151523252309a1292 (patch) | |
tree | d57454ba9a40386552179eddf60d28bd1e8f3d54 /nss/tests/common | |
parent | 26c046fbc57d53136b4fb3b5e0d18298318125d4 (diff) | |
download | nss-822b884019ac3b4a984e5d3b33b2cd07bc1518c1.tar.gz |
nss-3.28.1nss-3.28.1
Diffstat (limited to 'nss/tests/common')
-rw-r--r-- | nss/tests/common/Makefile | 3 | ||||
-rwxr-xr-x | nss/tests/common/cleanup.sh | 4 | ||||
-rw-r--r-- | nss/tests/common/init.sh | 142 | ||||
-rw-r--r-- | nss/tests/common/parsegtestreport.sed | 8 |
4 files changed, 94 insertions, 63 deletions
diff --git a/nss/tests/common/Makefile b/nss/tests/common/Makefile index 5356356..7faa677 100644 --- a/nss/tests/common/Makefile +++ b/nss/tests/common/Makefile @@ -19,3 +19,6 @@ dll_prefix: dll_suffix: @echo $(DLL_SUFFIX) + +freebl_lowhash: + @echo $(FREEBL_LOWHASH) diff --git a/nss/tests/common/cleanup.sh b/nss/tests/common/cleanup.sh index 8030045..40d8bc4 100755 --- a/nss/tests/common/cleanup.sh +++ b/nss/tests/common/cleanup.sh @@ -36,6 +36,8 @@ if [ -z "${CLEANUP}" -o "${CLEANUP}" = "${SCRIPTNAME}" ]; then echo "Failed: ${FAILED_CNT}" CORE_CNT=$(cat ${RESULTS} | grep ">Failed Core<" | wc -l | sed s/\ *//) echo "Failed with core: ${CORE_CNT}" + ASAN_CNT=$(cat $LOGFILE | grep "SUMMARY: AddressSanitizer" | wc -l | sed s/\ *//) + echo "ASan failures: ${ASAN_CNT}" LINES_CNT=$(cat ${RESULTS} | grep ">Unknown<" | wc -l | sed s/\ *//) echo "Unknown status: ${LINES_CNT}" if [ ${LINES_CNT} -gt 0 ]; then @@ -46,7 +48,7 @@ if [ -z "${CLEANUP}" -o "${CLEANUP}" = "${SCRIPTNAME}" ]; then html "END_OF_TEST<BR>" html "</BODY></HTML>" rm -f ${TEMPFILES} 2>/dev/null - if [ ${FAILED_CNT} -gt 0 ]; then + if [ ${FAILED_CNT} -gt 0 ] || [ ${ASAN_CNT} -gt 0 ]; then exit 1 fi diff --git a/nss/tests/common/init.sh b/nss/tests/common/init.sh index 2c4e69c..3598e82 100644 --- a/nss/tests/common/init.sh +++ b/nss/tests/common/init.sh @@ -14,7 +14,7 @@ # variables, utilities and shellfunctions global to NSS QA # needs to work on all Unix and Windows platforms # -# included from +# included from # ------------- # all.sh # ssl.sh @@ -77,6 +77,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then CERT_EXTENSIONS_DIR=${HOSTDIR}/cert_extensions STAPLINGDIR=${HOSTDIR}/stapling SSLGTESTDIR=${HOSTDIR}/ssl_gtests + GTESTDIR=${HOSTDIR}/gtests PWFILE=${HOSTDIR}/tests.pw NOISE_FILE=${HOSTDIR}/tests_noise @@ -94,7 +95,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then P_SERVER_CADIR=${SERVER_CADIR} P_CLIENT_CADIR=${CLIENT_CADIR} - + if [ -n "${MULTIACCESS_DBM}" ]; then P_SERVER_CADIR="multiaccess:${D_SERVER_CA}" P_CLIENT_CADIR="multiaccess:${D_CLIENT_CA}" @@ -113,8 +114,8 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then # Generate noise file noise() { - # NOTE: these keys are only suitable for testing, as this whole thing - # bypasses the entropy gathering. Don't use this method to generate + # NOTE: these keys are only suitable for testing, as this whole thing + # bypasses the entropy gathering. Don't use this method to generate # keys and certs for product use or deployment. ps -efl > ${NOISE_FILE} 2>&1 ps aux >> ${NOISE_FILE} 2>&1 @@ -177,30 +178,44 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then { # 3 functions so we can put targets in the output.log easier echo $* >>${RESULTS} } - html_passed() + increase_msg_id() { - html_detect_core "$@" || return MSG_ID=`cat ${MSG_ID_FILE}` MSG_ID=`expr ${MSG_ID} + 1` echo ${MSG_ID} > ${MSG_ID_FILE} + } + html_passed_ignore_core() + { + increase_msg_id html "<TR><TD>#${MSG_ID}: $1 ${HTML_PASSED}" echo "${SCRIPTNAME}: #${MSG_ID}: $* - PASSED" } - html_failed() + html_passed() { html_detect_core "$@" || return - MSG_ID=`cat ${MSG_ID_FILE}` - MSG_ID=`expr ${MSG_ID} + 1` - echo ${MSG_ID} > ${MSG_ID_FILE} + html_passed_ignore_core "$@" + } + html_failed_ignore_core() + { + increase_msg_id html "<TR><TD>#${MSG_ID}: $1 ${HTML_FAILED}" echo "${SCRIPTNAME}: #${MSG_ID}: $* - FAILED" } + html_failed() + { + html_detect_core "$@" || return + html_failed_ignore_core "$@" || return + } + html_unknown_ignore_core() + { + increase_msg_id + html "<TR><TD>#${MSG_ID}: $1 ${HTML_UNKNOWN}" + echo "${SCRIPTNAME}: #${MSG_ID}: $* - UNKNOWN" + } html_unknown() { html_detect_core "$@" || return - MSG_ID=`cat ${MSG_ID_FILE}` - MSG_ID=`expr ${MSG_ID} + 1` - echo ${MSG_ID} > ${MSG_ID_FILE} + increase_msg_id html "<TR><TD>#${MSG_ID}: $1 ${HTML_UNKNOWN}" echo "${SCRIPTNAME}: #${MSG_ID}: $* - UNKNOWN" } @@ -208,9 +223,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then { detect_core if [ $? -ne 0 ]; then - MSG_ID=`cat ${MSG_ID_FILE}` - MSG_ID=`expr ${MSG_ID} + 1` - echo ${MSG_ID} > ${MSG_ID_FILE} + increase_msg_id html "<TR><TD>#${MSG_ID}: $* ${HTML_FAILED_CORE}" echo "${SCRIPTNAME}: #${MSG_ID}: $* - Core file is detected - FAILED" return 1 @@ -219,9 +232,9 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then } html_head() { - + html "<TABLE BORDER=1 ${TABLE_ARGS}><TR><TH COLSPAN=3>$*</TH></TR>" - html "<TR><TH width=500>Test Case</TH><TH width=50>Result</TH></TR>" + html "<TR><TH width=500>Test Case</TH><TH width=50>Result</TH></TR>" echo "$SCRIPTNAME: $* ===============================" } html_msg() @@ -257,7 +270,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then # Allow for override options from a config file if [ -n "${OBJDIR}" -a -f ${DIST}/${OBJDIR}/platform.cfg ]; then - . ${DIST}/${OBJDIR}/platform.cfg + . ${DIST}/${OBJDIR}/platform.cfg fi # only need make if we don't already have certain variables set @@ -269,7 +282,11 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then fi if [ "${OBJDIR}" = "" ]; then - OBJDIR=`(cd $COMMON; $MAKE objdir_name)` + if [ -f ${DIST}/latest ]; then + OBJDIR=$(cat ${DIST}/latest) + else + OBJDIR=`($MAKE -s -C $COMMON objdir_name)` + fi fi if [ "${OS_ARCH}" = "" ]; then OS_ARCH=`(cd $COMMON; $MAKE os_arch)` @@ -295,16 +312,16 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then # Same problem with MSYS/Mingw, except we need to start over with pwd -W if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "MINGW32_NT" ]; then - mingw_mozilla_root=`(cd ../../..; pwd -W)` - MINGW_MOZILLA_ROOT=${MINGW_MOZILLA_ROOT-$mingw_mozilla_root} - TESTDIR=${MINGW_TESTDIR-${MINGW_MOZILLA_ROOT}/tests_results/security} + mingw_mozilla_root=`(cd ../../..; pwd -W)` + MINGW_MOZILLA_ROOT=${MINGW_MOZILLA_ROOT-$mingw_mozilla_root} + TESTDIR=${MINGW_TESTDIR-${MINGW_MOZILLA_ROOT}/tests_results/security} fi # Same problem with MSYS/Mingw, except we need to start over with pwd -W if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "MINGW32_NT" ]; then - mingw_mozilla_root=`(cd ../../..; pwd -W)` - MINGW_MOZILLA_ROOT=${MINGW_MOZILLA_ROOT-$mingw_mozilla_root} - TESTDIR=${MINGW_TESTDIR-${MINGW_MOZILLA_ROOT}/tests_results/security} + mingw_mozilla_root=`(cd ../../..; pwd -W)` + MINGW_MOZILLA_ROOT=${MINGW_MOZILLA_ROOT-$mingw_mozilla_root} + TESTDIR=${MINGW_TESTDIR-${MINGW_MOZILLA_ROOT}/tests_results/security} fi echo testdir is $TESTDIR @@ -315,11 +332,11 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then PATH=.\;${DIST}/${OBJDIR}/bin\;${DIST}/${OBJDIR}/lib\;$PATH PATH=`perl ../path_uniq -d ';' "$PATH"` elif [ "${OS_ARCH}" = "Android" ]; then - # android doesn't have perl, skip the uniq step + # android doesn't have perl, skip the uniq step PATH=.:${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:$PATH - else + else PATH=.:${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:/bin:/usr/bin:$PATH - # added /bin and /usr/bin in the beginning so a local perl will + # added /bin and /usr/bin in the beginning so a local perl will # be used PATH=`perl ../path_uniq -d ':' "$PATH"` fi @@ -375,20 +392,20 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then exit 1 #does not need to be Exit, very early in script fi -#HOSTADDR was a workaround for the dist. stress test, and is probably -#not needed anymore (purpose: be able to use IP address for the server +#HOSTADDR was a workaround for the dist. stress test, and is probably +#not needed anymore (purpose: be able to use IP address for the server #cert instead of PC name which was not in the DNS because of dyn IP address if [ -z "$USE_IP" -o "$USE_IP" != "TRUE" ] ; then - if [ -z "${DOMSUF}" ]; then + if [ -z "${DOMSUF}" ]; then HOSTADDR=${HOST} - else + else HOSTADDR=${HOST}.${DOMSUF} - fi + fi else HOSTADDR=${IP_ADDRESS} fi -#if running remote side of the distributed stress test we need to use +#if running remote side of the distributed stress test we need to use #the files that the server side gives us... if [ -n "$DO_REM_ST" -a "$DO_REM_ST" = "TRUE" ] ; then for w in `ls -rtd ${TESTDIR}/${HOST}.[0-9]* 2>/dev/null | @@ -407,14 +424,14 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then #find the HOSTDIR, where the results are supposed to go if [ -n "${HOSTDIR}" ]; then - version=`echo $HOSTDIR | sed -e "s/.*${HOST}.//"` + version=`echo $HOSTDIR | sed -e "s/.*${HOST}.//"` else if [ -f "${TESTDIR}/${HOST}" ]; then version=`cat ${TESTDIR}/${HOST}` else version=1 fi -#file has a tendency to disappear, messing up the rest of QA - +#file has a tendency to disappear, messing up the rest of QA - #workaround to find the next higher number if version file is not there if [ -z "${version}" ]; then # for some strange reason this file # gets truncated at times... Windos @@ -445,18 +462,18 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then fi if [ ! -f "${RESULTS}" ]; then cp ${COMMON}/results_header.html ${RESULTS} - html "<H4>Platform: ${OBJDIR}<BR>" - html "Test Run: ${HOST}.$version</H4>" + html "<H4>Platform: ${OBJDIR}<BR>" + html "Test Run: ${HOST}.$version</H4>" html "${BC_ACTION}" - html "<HR><BR>" - html "<HTML><BODY>" + html "<HR><BR>" + html "<HTML><BODY>" echo "********************************************" | tee -a ${LOGFILE} echo " Platform: ${OBJDIR}" | tee -a ${LOGFILE} echo " Results: ${HOST}.$version" | tee -a ${LOGFILE} echo "********************************************" | tee -a ${LOGFILE} - echo "$BC_ACTION" | tee -a ${LOGFILE} -#if running remote side of the distributed stress test + echo "$BC_ACTION" | tee -a ${LOGFILE} +#if running remote side of the distributed stress test # let the user know who it is... elif [ -n "$DO_REM_ST" -a "$DO_REM_ST" = "TRUE" ] ; then echo "********************************************" | tee -a ${LOGFILE} @@ -477,7 +494,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then else PS="ps" fi -#found 3 rsh's so far that do not work as expected - cygnus mks6 +#found 3 rsh's so far that do not work as expected - cygnus mks6 #(restricted sh) and mks 7 - if it is not in c:/winnt/system32 it #needs to be set in the environ.ksh if [ -z "$RSH" ]; then @@ -489,14 +506,14 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then RSH=rsh fi fi - + #more filename and directoryname init CURDIR=`pwd` CU_ACTION='Unknown certutil action' - # would like to preserve some tmp files, also easier to see if there + # would like to preserve some tmp files, also easier to see if there # are "leftovers" - another possibility ${HOSTDIR}/tmp init_directories @@ -521,7 +538,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then D_CERT_EXTENSTIONS="CertExtensions.$version" D_DISTRUST="Distrust.$version" - # we need relative pathnames of these files abd directories, since our + # we need relative pathnames of these files abd directories, since our # tools can't handle the unix style absolut pathnames on cygnus R_CADIR=../CA @@ -540,6 +557,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then R_CERT_EXT=../cert_extensions R_STAPLINGDIR=../stapling R_SSLGTESTDIR=../ssl_gtests + R_GTESTDIR=../gtests # # profiles are either paths or domains depending on the setting of @@ -555,15 +573,15 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then P_R_EXT_SERVERDIR=${R_EXT_SERVERDIR} P_R_EXT_CLIENTDIR=${R_EXT_CLIENTDIR} if [ -n "${MULTIACCESS_DBM}" ]; then - P_R_CADIR="multiaccess:${D_CA}" - P_R_ALICEDIR="multiaccess:${D_ALICE}" - P_R_BOBDIR="multiaccess:${D_BOB}" - P_R_DAVEDIR="multiaccess:${D_DAVE}" - P_R_EVEDIR="multiaccess:${D_EVE}" - P_R_SERVERDIR="multiaccess:${D_SERVER}" - P_R_CLIENTDIR="multiaccess:${D_CLIENT}" - P_R_EXT_SERVERDIR="multiaccess:${D_EXT_SERVER}" - P_R_EXT_CLIENTDIR="multiaccess:${D_EXT_CLIENT}" + P_R_CADIR="multiaccess:${D_CA}" + P_R_ALICEDIR="multiaccess:${D_ALICE}" + P_R_BOBDIR="multiaccess:${D_BOB}" + P_R_DAVEDIR="multiaccess:${D_DAVE}" + P_R_EVEDIR="multiaccess:${D_EVE}" + P_R_SERVERDIR="multiaccess:${D_SERVER}" + P_R_CLIENTDIR="multiaccess:${D_CLIENT}" + P_R_EXT_SERVERDIR="multiaccess:${D_EXT_SERVER}" + P_R_EXT_CLIENTDIR="multiaccess:${D_EXT_CLIENT}" fi R_PWFILE=../tests.pw @@ -581,10 +599,10 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then export MOZILLA_ROOT DIST TESTDIR OBJDIR QADIR export LOGFILE SCRIPTNAME -#used for the distributed stress test, the server generates certificates -#from GLOB_MIN_CERT to GLOB_MAX_CERT -# NOTE - this variable actually gets initialized by directly by the -# ssl_dist_stress.shs sl_ds_init() before init is called - need to change +#used for the distributed stress test, the server generates certificates +#from GLOB_MIN_CERT to GLOB_MAX_CERT +# NOTE - this variable actually gets initialized by directly by the +# ssl_dist_stress.shs sl_ds_init() before init is called - need to change # in both places. speaking of data encapsulatioN... if [ -z "$GLOB_MIN_CERT" ] ; then @@ -621,7 +639,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then ${CRL_GRP_3_RANGE}` TOTAL_GRP_NUM=3 - + RELOAD_CRL=1 NSS_DEFAULT_DB_TYPE="dbm" @@ -647,7 +665,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then if [ "${OS_ARCH}" != "WINNT" -a "${OS_ARCH}" != "Android" ]; then ulimit -c unlimited - fi + fi SCRIPTNAME=$0 INIT_SOURCED=TRUE #whatever one does - NEVER export this one please diff --git a/nss/tests/common/parsegtestreport.sed b/nss/tests/common/parsegtestreport.sed new file mode 100644 index 0000000..d7c6dda --- /dev/null +++ b/nss/tests/common/parsegtestreport.sed @@ -0,0 +1,8 @@ +/\<testcase/{ + s/^.* name="\([^"]*\)" value_param="\([^"]*\)" status="\([^"]*\)" time="[^"]*" classname="\([^"]*\)".*$/\3 '\4: \1 \2'/ + t end + s/^.* name="\([^"]*\)" status="\([^"]*\)" time="[^"]*" classname="\([^"]*\)".*$/\2 '\3: \1'/ + t end +} +d +: end |