added comments, fixed HOSTNAME problem

This commit is contained in:
sonmi%netscape.com 2001-08-27 23:27:37 +00:00
Родитель 29f2f618b6
Коммит d0829175f1
1 изменённых файлов: 41 добавлений и 10 удалений

Просмотреть файл

@ -42,8 +42,8 @@
# variables, utilities and shellfunctions global to NSS QA # variables, utilities and shellfunctions global to NSS QA
# needs to work on all Unix and Windows platforms # needs to work on all Unix and Windows platforms
# #
# included from (don't expect this to be up to date) # included from
# -------------------------------------------------- # -------------
# all.sh # all.sh
# ssl.sh # ssl.sh
# sdr.sh # sdr.sh
@ -52,6 +52,7 @@
# cert.sh # cert.sh
# smime.sh # smime.sh
# tools.sh # tools.sh
# fips.sh
# #
# special strings # special strings
# --------------- # ---------------
@ -71,6 +72,7 @@
if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
# Exit shellfunction to clean up at exit (error, regular or signal)
Exit() Exit()
{ {
if [ -n "$1" ] ; then if [ -n "$1" ] ; then
@ -97,6 +99,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
esac esac
} }
#html functions to give the resultfiles a consistant look
html() ######################### write the results.html file html() ######################### write the results.html file
{ # 3 functions so we can put targets in the output.log easier { # 3 functions so we can put targets in the output.log easier
echo $* >>${RESULTS} echo $* >>${RESULTS}
@ -129,7 +132,11 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
fi fi
fi fi
} }
HTML_FAILED='</TD><TD bgcolor=red>Failed</TD><TR>'
HTML_PASSED='</TD><TD bgcolor=lightGreen>Passed</TD><TR>'
#directory name init
SCRIPTNAME=init.sh SCRIPTNAME=init.sh
mozilla_root=`(cd ../../../..; pwd)` mozilla_root=`(cd ../../../..; pwd)`
@ -149,6 +156,8 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
OS_ARCH=`(cd $COMMON; gmake os_arch)` OS_ARCH=`(cd $COMMON; gmake os_arch)`
OS_NAME=`uname -s | sed -e "s/-[0-9]*\.[0-9]*//"` OS_NAME=`uname -s | sed -e "s/-[0-9]*\.[0-9]*//"`
#in case of backward comp. tests the calling scripts set the
#PATH and LD_LIBRARY_PATH and do not want them to be changed
if [ -z "${DON_T_SET_PATHS}" -o "${DON_T_SET_PATHS}" != "TRUE" ] ; then if [ -z "${DON_T_SET_PATHS}" -o "${DON_T_SET_PATHS}" != "TRUE" ] ; then
if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" != "CYGWIN_NT" ]; then if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" != "CYGWIN_NT" ]; then
PATH=.\;${DIST}/${OBJDIR}/bin\;${DIST}/${OBJDIR}/lib\;$PATH PATH=.\;${DIST}/${OBJDIR}/bin\;${DIST}/${OBJDIR}/lib\;$PATH
@ -170,6 +179,15 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
mkdir -p ${TESTDIR} mkdir -p ${TESTDIR}
fi fi
#HOST and DOMSUF are needed for the server cert
case $HOST in
*\.*)
HOST=`echo $HOST | sed -e "s/\..*//"`
;;
?*)
;;
*)
HOST=`uname -n`
case $HOST in case $HOST in
*\.*) *\.*)
HOST=`echo $HOST | sed -e "s/\..*//"` HOST=`echo $HOST | sed -e "s/\..*//"`
@ -181,6 +199,8 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
exit 1 #does not need to be Exit, very early in script exit 1 #does not need to be Exit, very early in script
;; ;;
esac esac
;;
esac
if [ -z "${DOMSUF}" ]; then if [ -z "${DOMSUF}" ]; then
DOMSUF=`domainname` DOMSUF=`domainname`
@ -189,14 +209,17 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
exit 1 #does not need to be Exit, very early in script exit 1 #does not need to be Exit, very early in script
fi fi
fi 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
#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 "$USE_IP" -o "$USE_IP" != "TRUE" ] ; then
HOSTADDR=${HOST}.${DOMSUF} HOSTADDR=${HOST}.${DOMSUF}
else else
HOSTADDR=${IP_ADDRESS} HOSTADDR=${IP_ADDRESS}
fi fi
#if running remote side of the distributed stress test we need to use the files that #if running remote side of the distributed stress test we need to use
#the server side gives us... #the files that the server side gives us...
if [ -n "$DO_REM_ST" -a "$DO_REM_ST" = "TRUE" ] ; then if [ -n "$DO_REM_ST" -a "$DO_REM_ST" = "TRUE" ] ; then
for w in `ls -rtd ${TESTDIR}/${HOST}.[0-9]* 2>/dev/null | for w in `ls -rtd ${TESTDIR}/${HOST}.[0-9]* 2>/dev/null |
sed -e "s/.*${HOST}.//"` ; do sed -e "s/.*${HOST}.//"` ; do
@ -212,6 +235,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
fi fi
fi fi
#find the HOSTDIR, where the results are supposed to go
if [ -n "${HOSTDIR}" ]; then if [ -n "${HOSTDIR}" ]; then
version=`echo $HOSTDIR | sed -e "s/.*${HOST}.//"` version=`echo $HOSTDIR | sed -e "s/.*${HOST}.//"`
else else
@ -220,6 +244,8 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
else else
version=1 version=1
fi fi
#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 if [ -z "${version}" ]; then # for some strange reason this file
# gets truncated at times... Windos # gets truncated at times... Windos
for w in `ls -d ${TESTDIR}/${HOST}.[0-9]* 2>/dev/null | for w in `ls -d ${TESTDIR}/${HOST}.[0-9]* 2>/dev/null |
@ -237,6 +263,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
mkdir -p ${HOSTDIR} mkdir -p ${HOSTDIR}
fi fi
#result and log file and filename init,
if [ -z "${LOGFILE}" ]; then if [ -z "${LOGFILE}" ]; then
LOGFILE=${HOSTDIR}/output.log LOGFILE=${HOSTDIR}/output.log
fi fi
@ -274,6 +301,8 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
KILL="kill" KILL="kill"
if [ "${OS_ARCH}" = "Linux" ]; then if [ "${OS_ARCH}" = "Linux" ]; then
#on linux the selfserv needs up to 30 seconds to fully die and free
#the socket
SLEEP="sleep 30" SLEEP="sleep 30"
fi fi
if [ `uname -s` = "SunOS" ]; then if [ `uname -s` = "SunOS" ]; then
@ -281,7 +310,9 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
else else
PS="ps" PS="ps"
fi fi
#found 3 rsh's so far that do not work as expected - cygnus mks6 (restricted sh) and mks 7 #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 if [ -z "$RSH" ]; then
if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then
RSH=/cygdrive/c/winnt/system32/rsh RSH=/cygdrive/c/winnt/system32/rsh
@ -293,11 +324,9 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
fi fi
#more filename and directoryname init
CURDIR=`pwd` CURDIR=`pwd`
HTML_FAILED='</TD><TD bgcolor=red>Failed</TD><TR>'
HTML_PASSED='</TD><TD bgcolor=lightGreen>Passed</TD><TR>'
CU_ACTION='Unknown certutil action' 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
@ -355,6 +384,8 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
export MOZILLA_ROOT SECURITY_ROOT DIST TESTDIR OBJDIR HOSTDIR QADIR export MOZILLA_ROOT SECURITY_ROOT DIST TESTDIR OBJDIR HOSTDIR QADIR
export LOGFILE SCRIPTNAME export LOGFILE SCRIPTNAME
#used for the distributed stress test, the server generates certificates
#from GLOB_MIN_CERT to GLOB_MAX_CERT
if [ -z "$GLOB_MIN_CERT" ] ; then if [ -z "$GLOB_MIN_CERT" ] ; then
GLOB_MIN_CERT=0 GLOB_MIN_CERT=0
fi fi