Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 #! /bin/bash
2 #
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 ########################################################################
8 #
9 # mozilla/security/nss/tests/common/init.sh
10 #
11 # initialization for NSS QA, can be included multiple times
12 # from all.sh and the individual scripts
13 #
14 # variables, utilities and shellfunctions global to NSS QA
15 # needs to work on all Unix and Windows platforms
16 #
17 # included from
18 # -------------
19 # all.sh
20 # ssl.sh
21 # sdr.sh
22 # cipher.sh
23 # perf.sh
24 # cert.sh
25 # smime.sh
26 # tools.sh
27 # fips.sh
28 #
29 # special strings
30 # ---------------
31 # FIXME ... known problems, search for this string
32 # NOTE .... unexpected behavior
33 #
34 # NOTE:
35 # -----
36 # Unlike the old QA this is based on files sourcing each other
37 # This is done to save time, since a great portion of time is lost
38 # in calling and sourcing the same things multiple times over the
39 # network. Also, this way all scripts have all shell function available
40 # and a completely common environment
41 #
42 ########################################################################
44 NSS_STRICT_SHUTDOWN=1
45 export NSS_STRICT_SHUTDOWN
47 # Init directories based on HOSTDIR variable
48 if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
49 init_directories()
50 {
51 TMP=${HOSTDIR} #TMP=${TMP-/tmp}
52 TEMP=${TMP}
53 TMPDIR=${TMP}
55 CADIR=${HOSTDIR}/CA
56 SERVERDIR=${HOSTDIR}/server
57 CLIENTDIR=${HOSTDIR}/client
58 ALICEDIR=${HOSTDIR}/alicedir
59 BOBDIR=${HOSTDIR}/bobdir
60 DAVEDIR=${HOSTDIR}/dave
61 EVEDIR=${HOSTDIR}/eve
62 FIPSDIR=${HOSTDIR}/fips
63 DBPASSDIR=${HOSTDIR}/dbpass
64 ECCURVES_DIR=${HOSTDIR}/eccurves
65 DISTRUSTDIR=${HOSTDIR}/distrust
67 SERVER_CADIR=${HOSTDIR}/serverCA
68 CLIENT_CADIR=${HOSTDIR}/clientCA
69 EXT_SERVERDIR=${HOSTDIR}/ext_server
70 EXT_CLIENTDIR=${HOSTDIR}/ext_client
72 IOPR_CADIR=${HOSTDIR}/CA_iopr
73 IOPR_SSL_SERVERDIR=${HOSTDIR}/server_ssl_iopr
74 IOPR_SSL_CLIENTDIR=${HOSTDIR}/client_ssl_iopr
75 IOPR_OCSP_CLIENTDIR=${HOSTDIR}/client_ocsp_iopr
77 CERT_EXTENSIONS_DIR=${HOSTDIR}/cert_extensions
78 STAPLINGDIR=${HOSTDIR}/stapling
80 PWFILE=${HOSTDIR}/tests.pw
81 NOISE_FILE=${HOSTDIR}/tests_noise
82 CORELIST_FILE=${HOSTDIR}/clist
84 FIPSPWFILE=${HOSTDIR}/tests.fipspw
85 FIPSBADPWFILE=${HOSTDIR}/tests.fipsbadpw
86 FIPSP12PWFILE=${HOSTDIR}/tests.fipsp12pw
88 echo "fIps140" > ${FIPSPWFILE}
89 echo "fips104" > ${FIPSBADPWFILE}
90 echo "pKcs12fips140" > ${FIPSP12PWFILE}
92 noise
94 P_SERVER_CADIR=${SERVER_CADIR}
95 P_CLIENT_CADIR=${CLIENT_CADIR}
97 if [ -n "${MULTIACCESS_DBM}" ]; then
98 P_SERVER_CADIR="multiaccess:${D_SERVER_CA}"
99 P_CLIENT_CADIR="multiaccess:${D_CLIENT_CA}"
100 fi
103 # a new log file, short - fast to search, mostly for tools to
104 # see if their portion of the cert has succeeded, also for me -
105 CERT_LOG_FILE=${HOSTDIR}/cert.log #the output.log is so crowded...
107 TEMPFILES=foobar # keep "${PWFILE} ${NOISE_FILE}" around
109 export HOSTDIR
110 }
112 # Generate noise file
113 noise()
114 {
115 # NOTE: these keys are only suitable for testing, as this whole thing
116 # bypasses the entropy gathering. Don't use this method to generate
117 # keys and certs for product use or deployment.
118 ps -efl > ${NOISE_FILE} 2>&1
119 ps aux >> ${NOISE_FILE} 2>&1
120 date >> ${NOISE_FILE} 2>&1
121 }
123 # Print selected environment variable (used for backup)
124 env_backup()
125 {
126 echo "HOSTDIR=\"${HOSTDIR}\""
127 echo "TABLE_ARGS="
128 echo "NSS_TEST_DISABLE_CRL=${NSS_TEST_DISABLE_CRL}"
129 echo "NSS_SSL_TESTS=\"${NSS_SSL_TESTS}\""
130 echo "NSS_SSL_RUN=\"${NSS_SSL_RUN}\""
131 echo "NSS_DEFAULT_DB_TYPE=${NSS_DEFAULT_DB_TYPE}"
132 echo "export NSS_DEFAULT_DB_TYPE"
133 echo "NSS_ENABLE_PKIX_VERIFY=${NSS_ENABLE_PKIX_VERIFY}"
134 echo "export NSS_ENABLE_PKIX_VERIFY"
135 echo "init_directories"
136 }
138 # Exit shellfunction to clean up at exit (error, regular or signal)
139 Exit()
140 {
141 if [ -n "$1" ] ; then
142 echo "$SCRIPTNAME: Exit: $* - FAILED"
143 html_failed "$*"
144 fi
145 echo "</TABLE><BR>" >> ${RESULTS}
146 if [ -n "${SERVERPID}" -a -f "${SERVERPID}" ]; then
147 ${KILL} `cat ${SERVERPID}`
148 fi
149 cd ${QADIR}
150 . common/cleanup.sh
151 case $1 in
152 [0-4][0-9]|[0-9])
153 exit $1;
154 ;;
155 *)
156 exit 1
157 ;;
158 esac
159 }
161 detect_core()
162 {
163 [ ! -f $CORELIST_FILE ] && touch $CORELIST_FILE
164 mv $CORELIST_FILE ${CORELIST_FILE}.old
165 coreStr=`find $HOSTDIR -type f -name '*core*'`
166 res=0
167 if [ -n "$coreStr" ]; then
168 sum $coreStr > $CORELIST_FILE
169 res=`cat $CORELIST_FILE ${CORELIST_FILE}.old | sort | uniq -u | wc -l`
170 fi
171 return $res
172 }
174 #html functions to give the resultfiles a consistant look
175 html() ######################### write the results.html file
176 { # 3 functions so we can put targets in the output.log easier
177 echo $* >>${RESULTS}
178 }
179 html_passed()
180 {
181 html_detect_core "$@" || return
182 MSG_ID=`cat ${MSG_ID_FILE}`
183 MSG_ID=`expr ${MSG_ID} + 1`
184 echo ${MSG_ID} > ${MSG_ID_FILE}
185 html "<TR><TD>#${MSG_ID}: $1 ${HTML_PASSED}"
186 echo "${SCRIPTNAME}: #${MSG_ID}: $* - PASSED"
187 }
188 html_failed()
189 {
190 html_detect_core "$@" || return
191 MSG_ID=`cat ${MSG_ID_FILE}`
192 MSG_ID=`expr ${MSG_ID} + 1`
193 echo ${MSG_ID} > ${MSG_ID_FILE}
194 html "<TR><TD>#${MSG_ID}: $1 ${HTML_FAILED}"
195 echo "${SCRIPTNAME}: #${MSG_ID}: $* - FAILED"
196 }
197 html_unknown()
198 {
199 html_detect_core "$@" || return
200 MSG_ID=`cat ${MSG_ID_FILE}`
201 MSG_ID=`expr ${MSG_ID} + 1`
202 echo ${MSG_ID} > ${MSG_ID_FILE}
203 html "<TR><TD>#${MSG_ID}: $1 ${HTML_UNKNOWN}"
204 echo "${SCRIPTNAME}: #${MSG_ID}: $* - UNKNOWN"
205 }
206 html_detect_core()
207 {
208 detect_core
209 if [ $? -ne 0 ]; then
210 MSG_ID=`cat ${MSG_ID_FILE}`
211 MSG_ID=`expr ${MSG_ID} + 1`
212 echo ${MSG_ID} > ${MSG_ID_FILE}
213 html "<TR><TD>#${MSG_ID}: $* ${HTML_FAILED_CORE}"
214 echo "${SCRIPTNAME}: #${MSG_ID}: $* - Core file is detected - FAILED"
215 return 1
216 fi
217 return 0
218 }
219 html_head()
220 {
222 html "<TABLE BORDER=1 ${TABLE_ARGS}><TR><TH COLSPAN=3>$*</TH></TR>"
223 html "<TR><TH width=500>Test Case</TH><TH width=50>Result</TH></TR>"
224 echo "$SCRIPTNAME: $* ==============================="
225 }
226 html_msg()
227 {
228 if [ "$1" -ne "$2" ] ; then
229 html_failed "$3" "$4"
230 else
231 html_passed "$3" "$4"
232 fi
233 }
234 HTML_FAILED='</TD><TD bgcolor=red>Failed</TD><TR>'
235 HTML_FAILED_CORE='</TD><TD bgcolor=red>Failed Core</TD><TR>'
236 HTML_PASSED='</TD><TD bgcolor=lightGreen>Passed</TD><TR>'
237 HTML_UNKNOWN='</TD><TD>Unknown/TD><TR>'
238 TABLE_ARGS=
241 #directory name init
242 SCRIPTNAME=init.sh
244 mozilla_root=`(cd ../../..; pwd)`
245 MOZILLA_ROOT=${MOZILLA_ROOT-$mozilla_root}
247 qadir=`(cd ..; pwd)`
248 QADIR=${QADIR-$qadir}
250 common=${QADIR}/common
251 COMMON=${TEST_COMMON-$common}
252 export COMMON
254 DIST=${DIST-${MOZILLA_ROOT}/dist}
255 TESTDIR=${TESTDIR-${MOZILLA_ROOT}/tests_results/security}
257 # Allow for override options from a config file
258 if [ -n "${OBJDIR}" -a -f ${DIST}/${OBJDIR}/platform.cfg ]; then
259 . ${DIST}/${OBJDIR}/platform.cfg
260 fi
262 # only need make if we don't already have certain variables set
263 if [ -z "${OBJDIR}" -o -z "${OS_ARCH}" -o -z "${DLL_PREFIX}" -o -z "${DLL_SUFFIX}" ]; then
264 MAKE=gmake
265 $MAKE -v >/dev/null 2>&1 || MAKE=make
266 $MAKE -v >/dev/null 2>&1 || { echo "You are missing make."; exit 5; }
267 MAKE="$MAKE --no-print-directory"
268 fi
270 if [ "${OBJDIR}" = "" ]; then
271 OBJDIR=`(cd $COMMON; $MAKE objdir_name)`
272 fi
273 if [ "${OS_ARCH}" = "" ]; then
274 OS_ARCH=`(cd $COMMON; $MAKE os_arch)`
275 fi
276 if [ "${DLL_PREFIX}" = "" ]; then
277 DLL_PREFIX=`(cd $COMMON; $MAKE dll_prefix)`
278 fi
279 if [ "${DLL_SUFFIX}" = "" ]; then
280 DLL_SUFFIX=`(cd $COMMON; $MAKE dll_suffix)`
281 fi
282 OS_NAME=`uname -s | sed -e "s/-[0-9]*\.[0-9]*//" | sed -e "s/-WOW64//"`
284 BINDIR="${DIST}/${OBJDIR}/bin"
286 # Pathnames constructed from ${TESTDIR} are passed to NSS tools
287 # such as certutil, which don't understand Cygwin pathnames.
288 # So we need to convert ${TESTDIR} to a Windows pathname (with
289 # regular slashes).
290 if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then
291 TESTDIR=`cygpath -m ${TESTDIR}`
292 QADIR=`cygpath -m ${QADIR}`
293 fi
295 # Same problem with MSYS/Mingw, except we need to start over with pwd -W
296 if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "MINGW32_NT" ]; then
297 mingw_mozilla_root=`(cd ../../..; pwd -W)`
298 MINGW_MOZILLA_ROOT=${MINGW_MOZILLA_ROOT-$mingw_mozilla_root}
299 TESTDIR=${MINGW_TESTDIR-${MINGW_MOZILLA_ROOT}/tests_results/security}
300 fi
302 # Same problem with MSYS/Mingw, except we need to start over with pwd -W
303 if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "MINGW32_NT" ]; then
304 mingw_mozilla_root=`(cd ../../..; pwd -W)`
305 MINGW_MOZILLA_ROOT=${MINGW_MOZILLA_ROOT-$mingw_mozilla_root}
306 TESTDIR=${MINGW_TESTDIR-${MINGW_MOZILLA_ROOT}/tests_results/security}
307 fi
308 echo testdir is $TESTDIR
310 #in case of backward comp. tests the calling scripts set the
311 #PATH and LD_LIBRARY_PATH and do not want them to be changed
312 if [ -z "${DON_T_SET_PATHS}" -o "${DON_T_SET_PATHS}" != "TRUE" ] ; then
313 if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" != "CYGWIN_NT" -a "$OS_NAME" != "MINGW32_NT" ]; then
314 PATH=.\;${DIST}/${OBJDIR}/bin\;${DIST}/${OBJDIR}/lib\;$PATH
315 PATH=`perl ../path_uniq -d ';' "$PATH"`
316 elif [ "${OS_ARCH}" = "Android" ]; then
317 # android doesn't have perl, skip the uniq step
318 PATH=.:${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:$PATH
319 else
320 PATH=.:${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:/bin:/usr/bin:$PATH
321 # added /bin and /usr/bin in the beginning so a local perl will
322 # be used
323 PATH=`perl ../path_uniq -d ':' "$PATH"`
324 fi
326 LD_LIBRARY_PATH=${DIST}/${OBJDIR}/lib:$LD_LIBRARY_PATH
327 SHLIB_PATH=${DIST}/${OBJDIR}/lib:$SHLIB_PATH
328 LIBPATH=${DIST}/${OBJDIR}/lib:$LIBPATH
329 DYLD_LIBRARY_PATH=${DIST}/${OBJDIR}/lib:$DYLD_LIBRARY_PATH
330 fi
332 if [ ! -d "${TESTDIR}" ]; then
333 echo "$SCRIPTNAME init: Creating ${TESTDIR}"
334 mkdir -p ${TESTDIR}
335 fi
337 #HOST and DOMSUF are needed for the server cert
339 DOMAINNAME=`which domainname`
340 if [ -z "${DOMSUF}" -a $? -eq 0 -a -n "${DOMAINNAME}" ]; then
341 DOMSUF=`domainname`
342 fi
344 case $HOST in
345 *\.*)
346 if [ -z "${DOMSUF}" ]; then
347 DOMSUF=`echo $HOST | sed -e "s/^[^.]*\.//"`
348 fi
349 HOST=`echo $HOST | sed -e "s/\..*//"`
350 ;;
351 ?*)
352 ;;
353 *)
354 HOST=`uname -n`
355 case $HOST in
356 *\.*)
357 if [ -z "${DOMSUF}" ]; then
358 DOMSUF=`echo $HOST | sed -e "s/^[^.]*\.//"`
359 fi
360 HOST=`echo $HOST | sed -e "s/\..*//"`
361 ;;
362 ?*)
363 ;;
364 *)
365 echo "$SCRIPTNAME: Fatal HOST environment variable is not defined."
366 exit 1 #does not need to be Exit, very early in script
367 ;;
368 esac
369 ;;
370 esac
372 if [ -z "${DOMSUF}" -a "${OS_ARCH}" != "Android" ]; then
373 echo "$SCRIPTNAME: Fatal DOMSUF env. variable is not defined."
374 exit 1 #does not need to be Exit, very early in script
375 fi
377 #HOSTADDR was a workaround for the dist. stress test, and is probably
378 #not needed anymore (purpose: be able to use IP address for the server
379 #cert instead of PC name which was not in the DNS because of dyn IP address
380 if [ -z "$USE_IP" -o "$USE_IP" != "TRUE" ] ; then
381 if [ -z "${DOMSUF}" ]; then
382 HOSTADDR=${HOST}
383 else
384 HOSTADDR=${HOST}.${DOMSUF}
385 fi
386 else
387 HOSTADDR=${IP_ADDRESS}
388 fi
390 #if running remote side of the distributed stress test we need to use
391 #the files that the server side gives us...
392 if [ -n "$DO_REM_ST" -a "$DO_REM_ST" = "TRUE" ] ; then
393 for w in `ls -rtd ${TESTDIR}/${HOST}.[0-9]* 2>/dev/null |
394 sed -e "s/.*${HOST}.//"` ; do
395 version=$w
396 done
397 HOSTDIR=${TESTDIR}/${HOST}.$version
398 echo "$SCRIPTNAME init: HOSTDIR $HOSTDIR"
399 echo $HOSTDIR
400 if [ ! -d $HOSTDIR ] ; then
401 echo "$SCRIPTNAME: Fatal: Remote side of dist. stress test "
402 echo " - server HOSTDIR $HOSTDIR does not exist"
403 exit 1 #does not need to be Exit, very early in script
404 fi
405 fi
407 #find the HOSTDIR, where the results are supposed to go
408 if [ -n "${HOSTDIR}" ]; then
409 version=`echo $HOSTDIR | sed -e "s/.*${HOST}.//"`
410 else
411 if [ -f "${TESTDIR}/${HOST}" ]; then
412 version=`cat ${TESTDIR}/${HOST}`
413 else
414 version=1
415 fi
416 #file has a tendency to disappear, messing up the rest of QA -
417 #workaround to find the next higher number if version file is not there
418 if [ -z "${version}" ]; then # for some strange reason this file
419 # gets truncated at times... Windos
420 for w in `ls -d ${TESTDIR}/${HOST}.[0-9]* 2>/dev/null |
421 sort -t '.' -n | sed -e "s/.*${HOST}.//"` ; do
422 version=`expr $w + 1`
423 done
424 if [ -z "${version}" ]; then
425 version=1
426 fi
427 fi
428 expr $version + 1 > ${TESTDIR}/${HOST}
430 HOSTDIR=${TESTDIR}/${HOST}'.'$version
432 mkdir -p ${HOSTDIR}
433 fi
435 #result and log file and filename init,
436 if [ -z "${LOGFILE}" ]; then
437 LOGFILE=${HOSTDIR}/output.log
438 fi
439 if [ ! -f "${LOGFILE}" ]; then
440 touch ${LOGFILE}
441 fi
442 if [ -z "${RESULTS}" ]; then
443 RESULTS=${HOSTDIR}/results.html
444 fi
445 if [ ! -f "${RESULTS}" ]; then
446 cp ${COMMON}/results_header.html ${RESULTS}
447 html "<H4>Platform: ${OBJDIR}<BR>"
448 html "Test Run: ${HOST}.$version</H4>"
449 html "${BC_ACTION}"
450 html "<HR><BR>"
451 html "<HTML><BODY>"
453 echo "********************************************" | tee -a ${LOGFILE}
454 echo " Platform: ${OBJDIR}" | tee -a ${LOGFILE}
455 echo " Results: ${HOST}.$version" | tee -a ${LOGFILE}
456 echo "********************************************" | tee -a ${LOGFILE}
457 echo "$BC_ACTION" | tee -a ${LOGFILE}
458 #if running remote side of the distributed stress test
459 # let the user know who it is...
460 elif [ -n "$DO_REM_ST" -a "$DO_REM_ST" = "TRUE" ] ; then
461 echo "********************************************" | tee -a ${LOGFILE}
462 echo " Platform: ${OBJDIR}" | tee -a ${LOGFILE}
463 echo " Results: ${HOST}.$version" | tee -a ${LOGFILE}
464 echo " remote side of distributed stress test " | tee -a ${LOGFILE}
465 echo " `uname -n -s`" | tee -a ${LOGFILE}
466 echo "********************************************" | tee -a ${LOGFILE}
467 fi
469 echo "$SCRIPTNAME init: Testing PATH $PATH against LIB $LD_LIBRARY_PATH" |\
470 tee -a ${LOGFILE}
472 KILL="kill"
474 if [ `uname -s` = "SunOS" ]; then
475 PS="/usr/5bin/ps"
476 else
477 PS="ps"
478 fi
479 #found 3 rsh's so far that do not work as expected - cygnus mks6
480 #(restricted sh) and mks 7 - if it is not in c:/winnt/system32 it
481 #needs to be set in the environ.ksh
482 if [ -z "$RSH" ]; then
483 if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then
484 RSH=/cygdrive/c/winnt/system32/rsh
485 elif [ "${OS_ARCH}" = "WINNT" ]; then
486 RSH=c:/winnt/system32/rsh
487 else
488 RSH=rsh
489 fi
490 fi
493 #more filename and directoryname init
494 CURDIR=`pwd`
496 CU_ACTION='Unknown certutil action'
498 # would like to preserve some tmp files, also easier to see if there
499 # are "leftovers" - another possibility ${HOSTDIR}/tmp
501 init_directories
503 FIPSCERTNICK="FIPS_PUB_140_Test_Certificate"
505 # domains to handle ipc based access to databases
506 D_CA="TestCA.$version"
507 D_ALICE="Alice.$version"
508 D_BOB="Bob.$version"
509 D_DAVE="Dave.$version"
510 D_EVE="Eve.$version"
511 D_SERVER_CA="ServerCA.$version"
512 D_CLIENT_CA="ClientCA.$version"
513 D_SERVER="Server.$version"
514 D_CLIENT="Client.$version"
515 D_FIPS="FIPS.$version"
516 D_DBPASS="DBPASS.$version"
517 D_ECCURVES="ECCURVES.$version"
518 D_EXT_SERVER="ExtendedServer.$version"
519 D_EXT_CLIENT="ExtendedClient.$version"
520 D_CERT_EXTENSTIONS="CertExtensions.$version"
521 D_DISTRUST="Distrust.$version"
523 # we need relative pathnames of these files abd directories, since our
524 # tools can't handle the unix style absolut pathnames on cygnus
526 R_CADIR=../CA
527 R_SERVERDIR=../server
528 R_CLIENTDIR=../client
529 R_IOPR_CADIR=../CA_iopr
530 R_IOPR_SSL_SERVERDIR=../server_ssl_iopr
531 R_IOPR_SSL_CLIENTDIR=../client_ssl_iopr
532 R_IOPR_OCSP_CLIENTDIR=../client_ocsp_iopr
533 R_ALICEDIR=../alicedir
534 R_BOBDIR=../bobdir
535 R_DAVEDIR=../dave
536 R_EVEDIR=../eve
537 R_EXT_SERVERDIR=../ext_server
538 R_EXT_CLIENTDIR=../ext_client
539 R_CERT_EXT=../cert_extensions
540 R_STAPLINGDIR=../stapling
542 #
543 # profiles are either paths or domains depending on the setting of
544 # MULTIACCESS_DBM
545 #
546 P_R_CADIR=${R_CADIR}
547 P_R_ALICEDIR=${R_ALICEDIR}
548 P_R_BOBDIR=${R_BOBDIR}
549 P_R_DAVEDIR=${R_DAVEDIR}
550 P_R_EVEDIR=${R_EVEDIR}
551 P_R_SERVERDIR=${R_SERVERDIR}
552 P_R_CLIENTDIR=${R_CLIENTDIR}
553 P_R_EXT_SERVERDIR=${R_EXT_SERVERDIR}
554 P_R_EXT_CLIENTDIR=${R_EXT_CLIENTDIR}
555 if [ -n "${MULTIACCESS_DBM}" ]; then
556 P_R_CADIR="multiaccess:${D_CA}"
557 P_R_ALICEDIR="multiaccess:${D_ALICE}"
558 P_R_BOBDIR="multiaccess:${D_BOB}"
559 P_R_DAVEDIR="multiaccess:${D_DAVE}"
560 P_R_EVEDIR="multiaccess:${D_EVE}"
561 P_R_SERVERDIR="multiaccess:${D_SERVER}"
562 P_R_CLIENTDIR="multiaccess:${D_CLIENT}"
563 P_R_EXT_SERVERDIR="multiaccess:${D_EXT_SERVER}"
564 P_R_EXT_CLIENTDIR="multiaccess:${D_EXT_CLIENT}"
565 fi
567 R_PWFILE=../tests.pw
568 R_NOISE_FILE=../tests_noise
570 R_FIPSPWFILE=../tests.fipspw
571 R_FIPSBADPWFILE=../tests.fipsbadpw
572 R_FIPSP12PWFILE=../tests.fipsp12pw
574 trap "Exit $0 Signal_caught" 2 3
576 export PATH LD_LIBRARY_PATH SHLIB_PATH LIBPATH DYLD_LIBRARY_PATH
577 export DOMSUF HOSTADDR
578 export KILL PS
579 export MOZILLA_ROOT DIST TESTDIR OBJDIR QADIR
580 export LOGFILE SCRIPTNAME
582 #used for the distributed stress test, the server generates certificates
583 #from GLOB_MIN_CERT to GLOB_MAX_CERT
584 # NOTE - this variable actually gets initialized by directly by the
585 # ssl_dist_stress.shs sl_ds_init() before init is called - need to change
586 # in both places. speaking of data encapsulatioN...
588 if [ -z "$GLOB_MIN_CERT" ] ; then
589 GLOB_MIN_CERT=0
590 fi
591 if [ -z "$GLOB_MAX_CERT" ] ; then
592 GLOB_MAX_CERT=200
593 fi
594 if [ -z "$MIN_CERT" ] ; then
595 MIN_CERT=$GLOB_MIN_CERT
596 fi
597 if [ -z "$MAX_CERT" ] ; then
598 MAX_CERT=$GLOB_MAX_CERT
599 fi
601 #################################################
602 # CRL SSL testing constatnts
603 #
606 CRL_GRP_1_BEGIN=40
607 CRL_GRP_1_RANGE=3
608 UNREVOKED_CERT_GRP_1=41
610 CRL_GRP_2_BEGIN=43
611 CRL_GRP_2_RANGE=6
612 UNREVOKED_CERT_GRP_2=46
614 CRL_GRP_3_BEGIN=49
615 CRL_GRP_3_RANGE=4
616 UNREVOKED_CERT_GRP_3=51
618 TOTAL_CRL_RANGE=`expr ${CRL_GRP_1_RANGE} + ${CRL_GRP_2_RANGE} + \
619 ${CRL_GRP_3_RANGE}`
621 TOTAL_GRP_NUM=3
623 RELOAD_CRL=1
625 NSS_DEFAULT_DB_TYPE="dbm"
626 export NSS_DEFAULT_DB_TYPE
628 MSG_ID_FILE="${HOSTDIR}/id"
629 MSG_ID=0
630 echo ${MSG_ID} > ${MSG_ID_FILE}
632 #################################################
633 # Interoperability testing constatnts
634 #
635 # if suite is setup for testing, IOPR_HOSTADDR_LIST should have
636 # at least one host name(FQDN)
637 # Example IOPR_HOSTADDR_LIST="goa1.SFBay.Sun.COM"
639 if [ -z "`echo ${IOPR_HOSTADDR_LIST} | grep '[A-Za-z]'`" ]; then
640 IOPR=0
641 else
642 IOPR=1
643 fi
644 #################################################
646 if [ "${OS_ARCH}" != "WINNT" -a "${OS_ARCH}" != "Android" ]; then
647 ulimit -c unlimited
648 fi
650 SCRIPTNAME=$0
651 INIT_SOURCED=TRUE #whatever one does - NEVER export this one please
652 fi