summaryrefslogtreecommitdiff
path: root/security/nss/tests
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/tests')
-rwxr-xr-xsecurity/nss/tests/cert/cert.sh68
-rw-r--r--security/nss/tests/common/init.sh111
-rw-r--r--security/nss/tests/header86
-rwxr-xr-xsecurity/nss/tests/nssqa22
-rwxr-xr-xsecurity/nss/tests/qa_stat12
-rw-r--r--security/nss/tests/set_environment12
-rwxr-xr-xsecurity/nss/tests/ssl/ssl.sh26
-rwxr-xr-xsecurity/nss/tests/ssl/ssl_dist_stress.sh344
-rw-r--r--security/nss/tests/tools/tools.sh12
9 files changed, 617 insertions, 76 deletions
diff --git a/security/nss/tests/cert/cert.sh b/security/nss/tests/cert/cert.sh
index aa378f24e..c8ff11986 100755
--- a/security/nss/tests/cert/cert.sh
+++ b/security/nss/tests/cert/cert.sh
@@ -154,10 +154,7 @@ cert_init_cert()
# local shell function to create client certs
# initialize DB, import
# root cert
-# generate request
-# sign request
-# import Cert
-#
+# add cert to DB
########################################################################
cert_create_cert()
{
@@ -175,6 +172,19 @@ cert_create_cert()
if [ "$RET" -ne 0 ]; then
return $RET
fi
+ cert_add_cert
+ return $?
+}
+
+############################# cert_add_cert ############################
+# local shell function to add client certs to an existing CERT DB
+# generate request
+# sign request
+# import Cert
+#
+########################################################################
+cert_add_cert()
+{
CU_ACTION="Generate Cert Request for $CERTNAME"
CU_SUBJECT="CN=$CERTNAME, E=${CERTNAME}@bogus.com, O=BOGUS NSS, L=Mountain View, ST=California, C=US"
@@ -323,8 +333,8 @@ cert_ssl()
cert_create_cert ${CLIENTDIR} "TestUser" 6
echo "$SCRIPTNAME: Creating Server CA Issued Certificate for \\"
- echo " ${HOST}.${DOMSUF} ------------------------------------"
- cert_init_cert ${SERVERDIR} "${HOST}.${DOMSUF}" 1
+ echo " ${HOSTADDR} ------------------------------------"
+ cert_init_cert ${SERVERDIR} "${HOSTADDR}" 1
cp ${CADIR}/*.db .
CU_ACTION="Creating ${CERTNAME}'s Server Cert"
CU_SUBJECT="CN=${CERTNAME}, O=BOGUS Netscape, L=Mountain View, ST=California, C=US"
@@ -341,6 +351,37 @@ cert_ssl()
cert_log "SUCCESS: SSL passed"
fi
}
+############################## cert_stresscerts ################################
+# local shell function to create client certs for SSL stresstest
+########################################################################
+cert_stresscerts()
+{
+
+ ############### Creating Certs for SSL stress test #######################
+ #
+ CERTDIR="$CLIENTDIR"
+ cd "${CERTDIR}"
+
+ CERTFAILED=0
+ echo "$SCRIPTNAME: Creating Client CA Issued Certificates ==============="
+
+ CONTINUE=$GLOB_MAX_CERT
+ CERTSERIAL=10
+
+ while [ $CONTINUE -ge $GLOB_MIN_CERT ]
+ do
+ CERTNAME="TestUser$CONTINUE"
+ cert_add_cert ${CLIENTDIR} "TestUser$CONTINUE" $CERTSERIAL
+ CERTSERIAL=`expr $CERTSERIAL + 1 `
+ CONTINUE=`expr $CONTINUE - 1 `
+ done
+ if [ "$CERTFAILED" != 0 ] ; then
+ cert_log "ERROR: StressCert failed $RET"
+ else
+ cert_log "SUCCESS: StressCert passed"
+ fi
+}
+
############################## cert_cleanup ############################
# local shell function to finish this script (no exit since it might be
@@ -356,8 +397,15 @@ cert_cleanup()
################## main #################################################
-cert_init
-cert_CA
-cert_smime_client
-cert_ssl
+cert_init
+cert_CA
+cert_ssl
+cert_smime_client
+if [ -n "$DO_DIST_ST" -a "$DO_DIST_ST" = "TRUE" ] ; then
+ cert_stresscerts
+ #following lines to be used when databases are to be reused
+ #cp -r /u/sonmi/tmp/stress/kentuckyderby.13/* $HOSTDIR
+ #cp -r $HOSTDIR/../clio.8/* $HOSTDIR
+
+fi
cert_cleanup
diff --git a/security/nss/tests/common/init.sh b/security/nss/tests/common/init.sh
index f7d07f9ef..78db19ffb 100644
--- a/security/nss/tests/common/init.sh
+++ b/security/nss/tests/common/init.sh
@@ -149,17 +149,19 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
OS_ARCH=`(cd $COMMON; gmake os_arch)`
OS_NAME=`uname -s | sed -e "s/-[0-9]*\.[0-9]*//"`
- if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" != "CYGWIN_NT" ]; then
- PATH=${DIST}/${OBJDIR}/bin\;${DIST}/${OBJDIR}/lib\;$PATH
- PATH=`perl ../path_uniq -d ';' "$PATH"`
- else
- PATH=${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:$PATH
- PATH=`perl ../path_uniq -d ':' "$PATH"`
- fi
+ if [ -z "${DON_T_SET_PATHS}" -o "${DON_T_SET_PATHS}" != "TRUE" ] ; then
+ if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" != "CYGWIN_NT" ]; then
+ PATH=${DIST}/${OBJDIR}/bin\;${DIST}/${OBJDIR}/lib\;$PATH
+ PATH=`perl ../path_uniq -d ';' "$PATH"`
+ else
+ PATH=${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:$PATH
+ PATH=`perl ../path_uniq -d ':' "$PATH"`
+ fi
- LD_LIBRARY_PATH=${DIST}/${OBJDIR}/lib
- SHLIB_PATH=${DIST}/${OBJDIR}/lib
- LIBPATH=${DIST}/${OBJDIR}/lib
+ LD_LIBRARY_PATH=${DIST}/${OBJDIR}/lib
+ SHLIB_PATH=${DIST}/${OBJDIR}/lib
+ LIBPATH=${DIST}/${OBJDIR}/lib
+ fi
if [ ! -d "${TESTDIR}" ]; then
echo "$SCRIPTNAME init: Creating ${TESTDIR}"
@@ -173,7 +175,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
?*)
;;
*)
- echo "$SCRIPTNAME: HOST environment variable is not defined."
+ echo "$SCRIPTNAME: Fatal HOST environment variable is not defined."
exit 1 #does not need to be Exit, very early in script
;;
esac
@@ -181,16 +183,36 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
if [ -z "${DOMSUF}" ]; then
DOMSUF=`domainname`
if [ -z "${DOMSUF}" ]; then
- echo "$SCRIPTNAME: DOMSUF environment variable is not defined."
+ echo "$SCRIPTNAME: Fatal DOMSUF env. variable is not defined."
exit 1 #does not need to be Exit, very early in script
fi
fi
+ if [ -z "$USE_IP" -o "$USE_IP" != "TRUE" ] ; then
+ HOSTADDR=${HOST}.${DOMSUF}
+ else
+ HOSTADDR=${IP_ADDRESS}
+ fi
-#NOTE - this HOSTDIR migh not be set at the time of this test!!!
-# the original had a -s maybe meant -z???? - first replaced it with -d
-#which worked, but resulted in [ ! -d "" ] which doesn't make a lot of sense
+ #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 |
+ sed -e "s/.*${HOST}.//"` ; do
+ version=$w
+ done
+ HOSTDIR=${TESTDIR}/${HOST}.$version
+ echo "$SCRIPTNAME init: HOSTDIR $HOSTDIR"
+ echo $HOSTDIR
+ if [ ! -d $HOSTDIR ] ; then
+ echo "$SCRIPTNAME: Fatal: Remote side of dist. stress test "
+ echo " - server HOSTDIR $HOSTDIR does not exist"
+ exit 1 #does not need to be Exit, very early in script
+ fi
+ fi
- if [ -z "${HOSTDIR}" ]; then
+ if [ -n "${HOSTDIR}" ]; then
+ version=`echo $HOSTDIR | sed -e "s/.*${HOST}.//"`
+ else
if [ -f "${TESTDIR}/${HOST}" ]; then
version=`cat ${TESTDIR}/${HOST}`
else
@@ -213,6 +235,12 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
mkdir -p ${HOSTDIR}
fi
+ if [ -z "${LOGFILE}" ]; then
+ LOGFILE=${HOSTDIR}/output.log
+ fi
+ if [ ! -f "${LOGFILE}" ]; then
+ touch ${LOGFILE}
+ fi
if [ -z "${RESULTS}" ]; then
RESULTS=${HOSTDIR}/results.html
fi
@@ -220,21 +248,28 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
cp ${COMMON}/results_header.html ${RESULTS}
html "<H4>Platform: ${OBJDIR}<BR>"
html "Test Run: ${HOST}.$version</H4>"
+ html "${BC_ACTION}"
html "<HR><BR>"
html "<HTML><BODY>"
- echo "********************************************"
- echo " Platform: ${OBJDIR}"
- echo " Results: ${HOST}.$version"
- echo "********************************************"
- fi
- if [ -z "${LOGFILE}" ]; then
- LOGFILE=${HOSTDIR}/output.log
- fi
- if [ ! -f "${LOGFILE}" ]; then
- touch ${LOGFILE}
+ echo "********************************************" | tee ${LOGFILE}
+ echo " Platform: ${OBJDIR}" | tee ${LOGFILE}
+ echo " Results: ${HOST}.$version" | tee ${LOGFILE}
+ echo "********************************************" | tee ${LOGFILE}
+ echo "$BC_ACTION" | tee ${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 ${LOGFILE}
+ echo " Platform: ${OBJDIR}" | tee ${LOGFILE}
+ echo " Results: ${HOST}.$version" | tee ${LOGFILE}
+ echo " remote side of distributed stress test " | tee ${LOGFILE}
+ echo " `uname -n -s`" | tee ${LOGFILE}
+ echo "********************************************" | tee ${LOGFILE}
fi
+ echo "$SCRIPTNAME init: Testing PATH $PATH against LIB $LD_LIBRARY_PATH" |
+ tee ${LOGFILE}
+
KILL="kill"
if [ "${OS_ARCH}" = "Linux" ]; then
SLEEP="sleep 30"
@@ -244,6 +279,16 @@ 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 (restricted sh) and mks 7
+ if [ -z "$RSH" ]; then
+ if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then
+ RSH=/cygdrive/c/winnt/system32/rsh
+ elif [ "${OS_ARCH}" = "WINNT" ]; then
+ RSH=c:/winnt/system32/rsh
+ else
+ RSH=rsh
+ fi
+ fi
CURDIR=`pwd`
@@ -289,11 +334,23 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
trap "Exit $0 Signal_caught" 2 3
export PATH LD_LIBRARY_PATH SHLIB_PATH LIBPATH
- export DOMSUF
+ export DOMSUF HOSTADDR
export KILL SLEEP PS
export MOZILLA_ROOT SECURITY_ROOT DIST TESTDIR OBJDIR HOSTDIR QADIR
export LOGFILE SCRIPTNAME
+ if [ -z "$GLOB_MIN_CERT" ] ; then
+ GLOB_MIN_CERT=0
+ fi
+ if [ -z "$GLOBMAX_CERT" ] ; then
+ GLOB_MAX_CERT=200
+ fi
+ if [ -z "$MIN_CERT" ] ; then
+ MIN_CERT=$GLOB_MIN_CERT
+ fi
+ if [ -z "$MAX_CERT" ] ; then
+ MAX_CERT=$GLOB_MAX_CERT
+ fi
SCRIPTNAME=$0
INIT_SOURCED=TRUE #whatever one does - NEVER export this one please
diff --git a/security/nss/tests/header b/security/nss/tests/header
index f39bddeb9..47c111ddd 100644
--- a/security/nss/tests/header
+++ b/security/nss/tests/header
@@ -15,7 +15,7 @@
#
# parameters
# ----------
-# nssversion (supported: 30b, 31, tip)
+# nssversion (supported: 30b, 31, tip 32)
# builddate (default - today)
#
# options
@@ -156,6 +156,11 @@ then # want the init to wait forever for directories to
WIN_WAIT_FOREVER=OFF
fi
+if [ -z "$BC_MASTER" ] # master directory for backwardscompatibility testing
+then
+ BC_MASTER="20010212.1.nss32_rtm"
+fi
+
EARLY_EXIT=TRUE #before the report file has been created, causes Exit to
#create it
@@ -329,7 +334,6 @@ set_files()
write_to_tmpfile()
{
O_CRONFILE=ON
- Debug "Writing to the TMPFILE"
O_FILE=ON
FILENAME=${TMP}/nsstmp.$$ # for now write to the temporary file
# since we don't know the hostname yet
@@ -414,8 +418,8 @@ eval_opts()
NSSVER=$1
if [ -z "$NSSVER" ]
then
- NSSVER="tip"
- Debug "NSS Version: Parameters missing - defaulting to tip!"
+ NSSVER="32"
+ Debug "NSS Version: Parameters missing - defaulting to 32!"
else
BUILDDATE=$2
if [ -z "$BUILDDATE" ]
@@ -431,8 +435,6 @@ eval_opts()
shift
done
- Debug "Builddate $BUILDDATE NssVersion $NSSVER"
-
if [ -z "$BUILDDATE" ]
then
BUILDDATE=`date +%m%d`
@@ -440,8 +442,8 @@ eval_opts()
fi
if [ -z "$NSSVER" ]
then
- NSSVER="tip"
- Debug "NSS Version: Parameters missing - defaulting to tip!"
+ NSSVER="32"
+ Debug "NSS Version: Parameters missing - defaulting to 32!"
fi
Debug "Builddate $BUILDDATE NssVersion $NSSVER"
@@ -580,20 +582,76 @@ set_objdir()
#at this point $MASTEBUILD is be either NT or unix
LOCALDIST=${D1}/builds/${QAYEAR}${BUILDDATE}.${BUILDNUMBER}/${MASTERBUILD}/mozilla/dist
+ BCDIST=${D1}/builds/${BC_MASTER}/${MASTERBUILD}/mozilla/dist
LOCALDIST_BIN=${LOCALDIST}/${OBJDIR}/bin
DIST=$LOCALDIST
-#FIXME - test so PATH won't contai it double
- PATH=$TESTSCRIPTDIR:$LOCALDIST_BIN:$BASEPATH
+ if [ -z "${TEST_LEVEL}" ] ; then
+ TEST_LEVEL=0
+ fi
+ bc ${TEST_LEVEL} #set the path for the backward compatibility test
+
PATH_CONTAINS_BIN="TRUE"
export PATH_CONTAINS_BIN
- Debug "Path after set_objdir $PATH"
- Debug "PATH $PATH"
+ export OBJDIR OS_ARCH LOCALDIST LOCALDIST_BIN DIST PATH BCDIST
+}
- export OBJDIR OS_ARCH LOCALDIST LOCALDIST_BIN DIST PATH
+########################### bc #########################################
+# global shell function , sets paths for the backward compatibility test
+########################################################################
+bc()
+{
+ DON_T_SET_PATHS="TRUE"
+ case $1 in
+ 0)
+ if [ "$O_WIN" = "ON" -a "$O_CYGNUS" != ON ] ; then
+ PATH="$TESTSCRIPTDIR;$LOCALDIST_BIN;$BASEPATH"
+ else
+ PATH=$TESTSCRIPTDIR:$LOCALDIST_BIN:$BASEPATH
+ fi
+ BC_ACTION=""
+ DON_T_SET_PATHS="FALSE" #let init.sh override - FIXME - check if necessary
+ ;;
+ 1)
+ BC_ACTION="backward compatibility against shlibs in $BC_MASTER"
+ LD_LIBRARY_PATH=${BCDIST}/${OBJDIR}/lib
+ if [ "$O_WIN" = "ON" ] ; then
+ if [ "$O_CYGNUS" = ON ] ; then
+ PATH=$TESTSCRIPTDIR:$LOCALDIST_BIN:$BASEPATH:$LD_LIBRARY_PATH
+ else
+ PATH="$TESTSCRIPTDIR;$LOCALDIST_BIN;$BASEPATH;$LD_LIBRARY_PATH"
+ fi
+ else
+ PATH=$TESTSCRIPTDIR:$LOCALDIST_BIN:$BASEPATH
+ fi
+ Debug "1st stage of backward compatibility test"
+ ;;
+ *)
+ BC_ACTION="forward compatibility of binaries in $BC_MASTER"
+ BCDIST_BIN=${BCDIST}/${OBJDIR}/bin
+ LD_LIBRARY_PATH=${LOCALDIST}/${OBJDIR}/lib
+ if [ "$O_WIN" = "ON" ] ; then
+ if [ "$O_CYGNUS" = ON ] ; then
+ PATH=$TESTSCRIPTDIR:$BCDIST_BIN:$BASEPATH:$LD_LIBRARY_PATH
+ else
+ PATH="$TESTSCRIPTDIR;$BCDIST_BIN;$BASEPATH;$LD_LIBRARY_PATH"
+ fi
+ else
+ PATH=$TESTSCRIPTDIR:$BCDIST_BIN:$BASEPATH
+ fi
+ Debug "2nd stage of backward compatibility test"
+ ;;
+ esac
+ SHLIB_PATH=${LD_LIBRARY_PATH}
+ LIBPATH=${LD_LIBRARY_PATH}
+ Debug "PATH $PATH"
+ Debug "LD_LIBRARY_PATH $LD_LIBRARY_PATH"
+ export PATH LD_LIBRARY_PATH SHLIB_PATH LIBPATH
+ export DON_T_SET_PATHS BC_ACTION
}
+
########################### Ps #########################################
# global shell function , attempts a platform specific ps
########################################################################
@@ -710,7 +768,7 @@ Exit()
then
cat $FILENAME | rmail $MAILINGLIST
fi
- rm $FILENAME 2>/dev/null
+ #rm $FILENAME 2>/dev/null
elif [ $O_MAIL = "ON" -a $EARLY_EXIT = TRUE ]
then
early_exit "$1"
diff --git a/security/nss/tests/nssqa b/security/nss/tests/nssqa
index 6bac0ce21..979f3d2db 100755
--- a/security/nss/tests/nssqa
+++ b/security/nss/tests/nssqa
@@ -252,11 +252,21 @@ nssqa_main()
}
-if [ $O_FILE = ON ]
-then
- nssqa_main 2>>$FILENAME
-else
- nssqa_main
-fi
+#FIXME start TEST_LEVEL with 0
+
+TEST_LEVEL=0
+
+while [ $TEST_LEVEL -lt 3 ] ; do
+ unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT"
+ unset USE_64;export USE_64;Debug "USE_64 $USE_64"
+ bc $TEST_LEVEL
+ if [ $O_FILE = ON ]
+ then
+ nssqa_main 2>>$FILENAME
+ else
+ nssqa_main
+ fi
+ TEST_LEVEL=`expr $TEST_LEVEL + 1 `
+done
Exit "Done."
diff --git a/security/nss/tests/qa_stat b/security/nss/tests/qa_stat
index 301479510..8b5b58f58 100755
--- a/security/nss/tests/qa_stat
+++ b/security/nss/tests/qa_stat
@@ -341,6 +341,18 @@ qa_errorlist()
grep -v '0 cache hits; 1 cache misses, 0 cache not reusable' |
grep -v '0 cache hits; 0 cache misses, 0 cache not reusable' |
grep -v ' cache hits; 1 cache misses, 0 cache not reusable'
+ grep -i error */output.log |
+ grep -vi "write to SSL socket" |
+ grep -vi "HDX PR_Read returned error" |
+ grep -vi "no error" |
+ grep -vi "12285"
+ grep -i failed */output.log |
+ grep -vi "write to SSL socket" |
+ grep -vi "peer cannot verify" |
+ grep -vi "error" |
+ grep -vi "fatal" |
+ grep -vi "TCP connection reset"
+ grep -i fatal */output.log
#grep -v '999 cache hits; 1 cache misses, 0 cache not reusable'
#if [ "$1" = "1" ]
#then
diff --git a/security/nss/tests/set_environment b/security/nss/tests/set_environment
index 13dedabc4..7489668e5 100644
--- a/security/nss/tests/set_environment
+++ b/security/nss/tests/set_environment
@@ -20,10 +20,6 @@ then
QASCRIPT_DIR=`dirname $0`
fi
-
-#FIXME - where do we need the OLDPATH
-
-OLDPATH="$PATH"
PATH=.:$HOME/bin:/tools/ns/bin:/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/dist/local/exe:/usr/bin/X11:/usr/audio/bin:/u/sonmi/bin:$PATH
CVSROOT=:pserver:svbld@cvsserver:/m/src
@@ -119,20 +115,18 @@ then
os_name="Windows"
O_CYGNUS=ON
O_WIN=ON
- OLDPATH=`echo "$OLDPATH" | sed -e 's/\\\/\//g'`
PATH="`dirname $0`:.:/cygdrive/c/cygwin/bin:/cygdrive/z/nstools/bin:/cygdrive/z/nstools/perl5:/cygdrive/z/bin:/cygdrive/c/WINNT/System32:/cygdrive/c/WINNT"
-#:$OLDPATH:
RM=/cygdrive/c/cygwin/bin/rm.exe #FIXME - in case we cant cporrect
#these with the PATH alone
PATH=`perl $QASCRIPT_DIR/path_uniq "$PATH"`
+ RSH=/cygdrive/c/winnt/system32/rsh
elif [ "$os_name" = "Windows_95" -o \
"$os_name" = "Windows_NT" -o \
"$os_name" = "WINNT" -o \
+ "$os_name" = "Windows" -o \
"$os_name" = "Windows_98" ]
then
#FIXME net use, mount the neccessary pnetwork drives and partitiones first
- #OLDPATH=`echo "$OLDPATH" | sed -e 's/\\\/\//g'` FIXME - MKS shell
- # interprets \bin as <backspace>in...
PATH=`echo $SHELL | sed -e "s/.ksh.exe//g" -e "s/.sh.exe//g"`
PATH="Z:/nstools/bin;Z:/nstools/perl5;z:/bin;$PATH"
@@ -149,6 +143,7 @@ then
os_name="Windows"
O_MKS=ON
O_WIN=ON
+ RSH=c:/winnt/system32/rsh
else
EDITOR=vi
@@ -158,6 +153,7 @@ else
XMCD_LIBDIR=/usr/local/lib/xmcd
DISPLAY=:0.0
PATH=`perl $QASCRIPT_DIR/path_uniq "$PATH"`
+ RSH=rsh
fi
BASEPATH=$PATH # in case we we set and reset DIST directories the PATH
diff --git a/security/nss/tests/ssl/ssl.sh b/security/nss/tests/ssl/ssl.sh
index 399334db9..7d0539ea4 100755
--- a/security/nss/tests/ssl/ssl.sh
+++ b/security/nss/tests/ssl/ssl.sh
@@ -94,6 +94,7 @@ ssl_init()
#fileout=1
#verbose="-v" #FIXME - see where this is usefull
cd ${CLIENTDIR}
+
}
########################### is_selfserv_alive ##########################
@@ -157,15 +158,15 @@ start_selfserv()
echo "$SCRIPTNAME: $testname ----"
fi
sparam=`echo $sparam | sed -e 's;_; ;g'`
- echo "selfserv -p ${PORT} -d ${R_SERVERDIR} -n ${HOST}.${DOMSUF} \\"
+ echo "selfserv -p ${PORT} -d ${R_SERVERDIR} -n ${HOSTADDR} \\"
echo " -w nss ${sparam} -i ${R_SERVERPID} $verbose &"
echo "selfserv started at `date`"
if [ ${fileout} -eq 1 ]; then
- selfserv -p ${PORT} -d ${R_SERVERDIR} -n ${HOST}.${DOMSUF} \
+ selfserv -p ${PORT} -d ${R_SERVERDIR} -n ${HOSTADDR} \
-w nss ${sparam} -i ${R_SERVERPID} $verbose \
> ${SERVEROUTFILE} 2>&1 &
else
- selfserv -p ${PORT} -d ${R_SERVERDIR} -n ${HOST}.${DOMSUF} \
+ selfserv -p ${PORT} -d ${R_SERVERDIR} -n ${HOSTADDR} \
-w nss ${sparam} -i ${R_SERVERPID} $verbose &
fi
wait_for_selfserv
@@ -258,9 +259,9 @@ ssl_stress()
start_selfserv
echo "strsclnt -p ${PORT} -d . -w nss $cparam $verbose \\"
- echo " ${HOST}.${DOMSUF}"
+ echo " ${HOSTADDR}"
echo "strsclnt started at `date`"
- strsclnt -p ${PORT} -d . -w nss $cparam $verbose ${HOST}.${DOMSUF}
+ strsclnt -p ${PORT} -d . -w nss $cparam $verbose ${HOSTADDR}
echo "strsclnt completed at `date`"
html_msg $? $value "${testname}"
@@ -271,6 +272,7 @@ ssl_stress()
html "</TABLE><BR>"
}
+
############################## ssl_cleanup #############################
# local shell function to finish this script (no exit since it might be
# sourced)
@@ -284,8 +286,12 @@ ssl_cleanup()
################## main #################################################
-ssl_init
-ssl_cov
-ssl_auth
-ssl_stress
-ssl_cleanup
+#this script may be sourced from the distributed stress test - in this case do nothing...
+
+if [ -z "$DO_REM_ST" -a -z "$DO_DIST_ST" ] ; then
+ ssl_init
+ ssl_cov
+ ssl_auth
+ ssl_stress
+ ssl_cleanup
+fi
diff --git a/security/nss/tests/ssl/ssl_dist_stress.sh b/security/nss/tests/ssl/ssl_dist_stress.sh
new file mode 100755
index 000000000..9a5cb63af
--- /dev/null
+++ b/security/nss/tests/ssl/ssl_dist_stress.sh
@@ -0,0 +1,344 @@
+#! /bin/sh
+#
+# The contents of this file are subject to the Mozilla Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code is the Netscape security libraries.
+#
+# The Initial Developer of the Original Code is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1994-2000 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the
+# terms of the GNU General Public License Version 2 or later (the
+# "GPL"), in which case the provisions of the GPL are applicable
+# instead of those above. If you wish to allow use of your
+# version of this file only under the terms of the GPL and not to
+# allow others to use your version of this file under the MPL,
+# indicate your decision by deleting the provisions above and
+# replace them with the notice and other provisions required by
+# the GPL. If you do not delete the provisions above, a recipient
+# may use your version of this file under either the MPL or the
+# GPL.
+#
+#
+########################################################################
+#
+# mozilla/security/nss/tests/ssl/ssl_dist_stress.sh
+#
+# Script to test NSS SSL - distributed stresstest - this script needs to
+# source the regular ssl.sh (for shellfunctions, certs and variables
+# initialisation)
+# create certs
+# start server
+# start itself via rsh on different systems to connect back to the server
+#
+#
+# needs to work on all Unix and Windows platforms
+#
+# special strings
+# ---------------
+# FIXME ... known problems, search for this string
+# NOTE .... unexpected behavior
+#
+# FIXME _ don't know yet how long to wait until the server needs to be killed
+# especially on NT
+#
+########################################################################
+
+############################## ssl_ds_init #############################
+# local shell function to initialize this script
+########################################################################
+ssl_ds_init()
+{
+ if [ -z "$GLOB_MIN_CERT" ] ; then
+ GLOB_MIN_CERT=0
+ fi
+ if [ -z "$GLOBMAX_CERT" ] ; then
+ GLOB_MAX_CERT=200
+ fi
+ IP_PARAM=""
+ CD_QADIR_SSL=""
+
+
+ if [ -n "$1" ] ; then
+ ssl_ds_eval_opts $*
+ fi
+ SCRIPTNAME=ssl_dist_stress.sh # sourced - $0 would point to all.sh
+
+ if [ -z "${CLEANUP}" ] ; then # if nobody else is responsible for
+ CLEANUP="${SCRIPTNAME}" # cleaning this script will do it
+ fi
+
+ ssl_init # let some other script do the hard work (initialize, generate certs, ...
+
+ SCRIPTNAME=ssl_dist_stress.sh
+ echo "$SCRIPTNAME: SSL distributed stress tests ==============================="
+
+}
+
+######################### ssl_ds_usage #################################
+# local shell function to explain the usage
+########################################################################
+ssl_ds_usage()
+{
+ echo "Usage: `basename $1`"
+ echo " -host hostname "
+ echo " ...host who runs the server, for distributed stress test"
+ echo " -stress "
+ echo " ...runs the server sider of the distributed stress test"
+ echo " -dir unixdirectory "
+ echo " ...lets the server side of the distributed stress test"
+ echo " know where to find the scritp to start on the remote side"
+ echo " -certnum start-end"
+ echo " ... provides the range of certs for distributed stress test"
+ echo " for example -certnum 10-20 will connect 10 times"
+ echo " no blanks in the range string (not 10 - 20)"
+ echo " valid range ${GLOB_MIN_CERT}-${GLOB_MAX_CERT}"
+ echo " -? ...prints this text"
+ exit 1 #does not need to be Exit, very early in script
+}
+
+######################### ssl_ds_eval_opts #############################
+# local shell function to deal with options and parameters
+########################################################################
+ssl_ds_eval_opts()
+{
+ #use $0 not $SCRIPTNAM<E, too early, SCRIPTNAME not yet set
+
+ while [ -n "$1" ]
+ do
+ case $1 in
+ -host)
+ BUILD_OPT=1
+ export BUILD_OPT
+ DO_REM_ST="TRUE"
+ shift
+ SERVERHOST=$1
+ HOST=$1
+ if [ -z $SERVERHOST ] ; then
+ echo "$0 `uname -n`: -host requires hostname"
+ ssl_ds_usage
+ fi
+ echo "$0 `uname -n`: host $HOST ($1)"
+ ;;
+ -certn*)
+ shift
+ rangeOK=`echo $1 | sed -e 's/[0-9][0-9]*-[0-9][0-9]*/OK/'`
+ MIN_CERT=`echo $1 | sed -e 's/-[0-9][0-9]*//' -e 's/^00*//'`
+ MAX_CERT=`echo $1 | sed -e 's/[0-9][0-9]*-//' -e 's/^00*//'`
+ if [ -z "$rangeOK" -o "$rangeOK" != "OK" -o \
+ -z "$MIN_CERT" -o -z "$MAX_CERT" -o \
+ "$MIN_CERT" -gt "$MAX_CERT" -o \
+ "$MIN_CERT" -lt "$GLOB_MIN_CERT" -o \
+ "$MAX_CERT" -gt "$GLOB_MAX_CERT" ] ; then
+ echo "$0 `uname -n`: -certn range not valid"
+ ssl_ds_usage
+ fi
+ echo "$0 `uname -n`: will use certs from $MIN_CERT to $MAX_CERT"
+ ;;
+ -server|-stress|-dist*st*)
+ BUILD_OPT=1
+ export BUILD_OPT
+ DO_DIST_ST="TRUE"
+ ;;
+ -dir|-unixdir|-uxdir|-qadir)
+ shift
+ UX_DIR=$1
+ #FIXME - we need a default unixdir
+ if [ -z "$UX_DIR" ] ; then # -o ! -d "$UX_DIR" ] ; then can't do, Win doesn't know...
+ echo "$0 `uname -n`: -dir requires directoryname "
+ ssl_ds_usage
+ fi
+ CD_QADIR_SSL="cd $UX_DIR"
+ ;;
+ -ip*)
+ shift
+ IP_ADDRESS=$1
+ if [ -z "$IP_ADDRESS" ] ; then
+ echo "$0 `uname -n`: -ip requires ip-address "
+ ssl_ds_usage
+ fi
+ USE_IP=TRUE
+ IP_PARAM="-ip $IP_ADDRESS"
+ ;;
+ -h|-help|"-?"|*)
+ ssl_ds_usage
+ ;;
+ esac
+ shift
+ done
+}
+
+############################## ssl_ds_rem_stress #######################
+# local shell function to perform the client part of the SSL stress test
+########################################################################
+
+ssl_ds_rem_stress()
+{
+ testname="SSL remote part of Stress test (`uname -n`)"
+ echo "$SCRIPTNAME `uname -n`: $testname"
+
+ #cp -r "${CLIENTDIR}" /tmp/ssl_ds.$$ #FIXME
+ #cd /tmp/ssl_ds.$$
+ #verbose="-v"
+
+ cd ${CLIENTDIR}
+
+ CONTINUE=$MAX_CERT
+ while [ $CONTINUE -ge $MIN_CERT ]
+ do
+ echo "strsclnt -D -p ${PORT} -d . -w nss -c 1 $verbose "
+ echo " -n TestUser$CONTINUE ${HOSTADDR} #`uname -n`"
+ strsclnt -D -p ${PORT} -d . -w nss -c 1 $verbose \
+ -n "TestUser$CONTINUE" ${HOSTADDR} &
+ #${HOSTADDR} &
+ CONTINUE=`expr $CONTINUE - 1 `
+ #sleep 4 #give process time to start up
+ done
+
+ html_msg 0 0 "${testname}" #FIXME
+}
+
+######################### ssl_ds_dist_stress ###########################
+# local shell function to perform the server part of the new, distributed
+# SSL stress test
+########################################################################
+
+ssl_ds_dist_stress()
+{
+ max_clientlist="
+ box-200
+ washer-200
+ dryer-200
+ hornet-50
+ shabadoo-50
+ y2sun2-10
+ galileo-10
+ shame-10
+ axilla-10
+ columbus-10
+ smarch-10
+ nugget-10
+ charm-10
+ hp64-10
+ biggayal-10
+ orville-10
+ kwyjibo-10
+ hbombaix-10
+ raven-10
+ jordan-10
+ phaedrus-10
+ louie-10
+ trex-10
+ compaqtor-10"
+
+ #clientlist=" box-200 washer-50 charm-10 jordan-10 louie-10 smarch-10 phaedrus-10 charm-10 hbombaix-20 box-200 washer-50 "
+ #clientlist=" box-200 washer-50 louie-10 hbombaix-10 charm-10 trex-20 jordan-10 box-200 compaqtor-10 "
+ #clientlist=" box-2 washer-5" #FIXME ADJUST
+ clientlist=" box-200 charm-10 jordan-10 louie-10 smarch-10 phaedrus-10 charm-10 "
+
+ html_head "SSL Distributed Stress Test"
+
+ testname="SSL distributed Stress test"
+
+ echo cd "${CLIENTDIR}"
+ cd "${CLIENTDIR}"
+ if [ -z "CD_QADIR_SSL" ] ; then
+ CD_QADIR_SSL="cd $QADIR/ssl"
+ else
+ cp -r $HOSTDIR $HOSTDIR/../../../../../y2sun2_Solaris8/mozilla/tests_results/security
+ fi
+
+ #sparam=" -t 128 -D -r "
+ sparam=" -t 16 -D -r -r "
+ start_selfserv
+
+ for c in $clientlist
+ do
+ client=`echo $c | sed -e "s/-.*//"`
+ number=`echo $c | sed -e "s/.*-//"`
+ CLIENT_OK="TRUE"
+ echo $client
+ ping $client >/dev/null || CLIENT_OK="FALSE"
+ if [ "$CLIENT_OK" = "FALSE" ] ; then
+ echo "$SCRIPTNAME `uname -n`: $client can't be reached - skipping"
+ else
+ get_certrange $number
+ echo "$SCRIPTNAME `uname -n`: $RSH $client -l svbld \\ "
+ echo " \" $CD_QADIR_SSL ;ssl_dist_stress.sh \\"
+ echo " -host $HOST -certnum $CERTRANGE $IP_PARAM \" "
+ $RSH $client -l svbld \
+ " $CD_QADIR_SSL;ssl_dist_stress.sh -host $HOST -certnum $CERTRANGE $IP_PARAM " &
+ fi
+ done
+
+ echo cd "${CLIENTDIR}"
+ cd "${CLIENTDIR}"
+
+ sleep 300 # give the clients time to finish #FIXME ADJUST
+
+ echo "GET /stop HTTP/1.0\n\n" > stdin.txt #check to make sure it has /r/n
+ echo "tstclnt -h clio.red.iplanet.com -p 8443 -d ${CLIENTDIR} -n TestUser0 "
+ echo " -w nss -f < stdin.txt"
+ tstclnt -h clio.red.iplanet.com -p 8443 -d ${CLIENTDIR} -n TestUser0 \
+ -w nss -f < stdin.txt
+
+ html_msg 0 0 "${testname}"
+ html "</TABLE><BR>"
+}
+
+############################ get_certrange #############################
+# local shell function to find the range of certs that the next remote
+# client is supposed to use (only for server side of the dist stress test
+########################################################################
+get_certrange()
+{
+ rangeOK=`echo $1 | sed -e 's/[0-9][0-9]*/OK/'`
+ if [ -z "$rangeOK" -o "$rangeOK" != "OK" -o $1 = "OK" ] ; then
+ range=10
+ echo "$SCRIPTNAME `uname -n`: $1 is not a valid number of certs "
+ echo " defaulting to 10 for $client"
+ else
+ range=$1
+ if [ $range -gt $GLOB_MAX_CERT ] ; then
+ range=$GLOB_MAX_CERT
+ fi
+ fi
+ if [ -z "$FROM_CERT" ] ; then # start new on top of the cert stack
+ FROM_CERT=$GLOB_MAX_CERT
+ elif [ `expr $FROM_CERT - $range + 1 ` -lt 0 ] ; then
+ FROM_CERT=$GLOB_MAX_CERT # dont let it fall below 0 on the TO_CERT
+
+ fi
+ TO_CERT=`expr $FROM_CERT - $range + 1 `
+ if [ $TO_CERT -lt 0 ] ; then # it's not that I'm bad in math, I just
+ TO_CERT=0 # don't trust expr...
+ fi
+ CERTRANGE="${TO_CERT}-${FROM_CERT}"
+ FROM_CERT=`expr ${TO_CERT} - 1 ` #start the next client one below
+}
+
+
+################## main #################################################
+
+DO_DIST_ST="TRUE"
+. ssl.sh
+ssl_ds_init $*
+if [ -n "$DO_REM_ST" -a "$DO_REM_ST" = "TRUE" ] ; then
+ ssl_ds_rem_stress
+ exit 0 #no cleanup on purpose
+elif [ -n "$DO_DIST_ST" -a "$DO_DIST_ST" = "TRUE" ] ; then
+ ssl_ds_dist_stress
+fi
+ssl_cleanup
diff --git a/security/nss/tests/tools/tools.sh b/security/nss/tests/tools/tools.sh
index 25b42866b..34dc76145 100644
--- a/security/nss/tests/tools/tools.sh
+++ b/security/nss/tests/tools/tools.sh
@@ -158,7 +158,17 @@ tools_cleanup()
################## main #################################################
tools_init
-tools_p12
+
+#FIXME - tmp workaround for tests that do not work in 3.2 RTM
+#echo $BC_ACTION | grep "forward compatibility" && RUN_TOOLS_P12="FALSE"
+echo $BC_ACTION | grep "compatibility" && RUN_TOOLS_P12="FALSE"
+if [ -n "${RUN_TOOLS_P12}" -a "${RUN_TOOLS_P12}" = "FALSE" ] ; then
+ html_msg 0 0 "Can't run pk12util tests for NSS 3.2 (pk12util -i)"
+ html_msg 0 0 "Can't run pk12util tests for NSS 3.2 (pk12util -o)"
+else
+ tools_p12
+fi
+
tools_sign
tools_cleanup