new qa wrapper - per wtc's request moved here from /m/src

This commit is contained in:
sonmi%netscape.com 2000-12-12 23:08:15 +00:00
Родитель 17bd870492
Коммит 3d521a7164
5 изменённых файлов: 1761 добавлений и 0 удалений

909
security/nss/tests/header Normal file
Просмотреть файл

@ -0,0 +1,909 @@
#! /bin/sh
########################################################################
#
# /u/sonmi/bin/header - /u/svbld/bin/init/nss/header
#
# variables, utilities and shellfunktions global to NSS QA
# needs to work on all Unix platforms
#
# included from (don't expect this to be up to date)
# --------------------------------------------------
# qa_stat
# mksymlinks
# nssqa
#
# parameters
# ----------
# nssversion (supported: 30b, 31, tip)
# builddate (default - today)
#
# options
# -------
# -y answer all questions with y - use at your own risk... ignores warnings
# -s silent (only usefull with -y)
# -h, -? - you guessed right - displays this text
# -d debug
# -f <filename> - write the (error)output to filename
# -m <mailinglist> - send filename to mailinglist (csl) only useful
# with -f
# -l <mozroot> run on a local build O_LOCAL
# -cron equivalient to -y -s -d -f $RESULTDIR/$HOST.<scriptname>
#
# special strings
# ---------------
# FIXME ... known problems, search for this string
# NOTE .... unexpected behavior
#
# moduls (not yet)
# ----------------
# --# INIT
# --# USERCOM
# --# UTILS
#
# FIXME - split in init / usercom / utils
#
########################################################################
#------------------------------# INIT #------------------------------
# below the option flags get initialized
if [ -z "$QASCRIPT_DIR" ]
then
QASCRIPT_DIR=`dirname $0`
fi
export QASCRIPT_DIR
O_ALWAYS_YES=OFF # turned on by -y answer all questions with y
if [ -z "$O_INIT" ] # header is global, some including scripts may not
then # want the init to run, the others don't need to bother
O_INIT=ON
fi
if [ -z "$O_PARAM" ] # header is global, some including scripts may not
then # require parameters, the others don't need to bother
O_PARAM=ON
fi
if [ -z "$O_OPTIONS" ] # header is global, some including scripts may not
then # permit options, they don't need to bother
O_OPTIONS=OFF
fi
O_SILENT=OFF # turned on by -s silent (only usefull with -y)
O_DEBUG=OFF # turned on by -d - calls to Debug produce output when ON
O_FILE=OFF # turned on by -f echo all output to a file $FILENAME
O_CRON=OFF # turned on by -cron cron use only
O_LOCAL=OFF # turned on by -l run on a local build in $MOZROOT
O_MAIL=OFF # turned on by -m - sends email
if [ -z "$DOMSUF" ]
then
DOMSUF=red.iplanet.com
DS_WAS_SET=FALSE
else
DS_WAS_SET=TRUE
fi
TMPFILES=""
WAIT_FOR=600 # if waiting for an event sleep n seconds before rechecking
# recomended value 10 minutes 600
WAIT_TIMES=30 # recheck n times before giving up - recomended 30 - total of 5h
if [ -z "$QAYEAR" ] # may I introduce - the y2k+1 bug? QA for last year
then # might not work
QAYEAR=`date +%Y`
fi
if [ -z "$TMP" ]
then
if [ -z "$TEMP" ]
then
TMP="/tmp"
else
TMP=$TEMP
fi
fi
if [ ! -w "$TMP" ]
then
echo "Can't write to tmp directory $TMP - exiting"
echo "Can't write to tmp directory $TMP - exiting" >&2
exit 1
fi
KILL_SELFSERV=OFF # if sourcing script sets this to on cleanup will also
# kill the running selfserv processes
# Set the masterbuilds
if [ -z "$MASTERBUILD" ]
then
MASTERBUILD=y2sun2_Solaris8
#MASTERBUILD=shame_Solaris2.6
fi
if [ -z "$BUILDNUMBER" ]
then
BUILDNUMBER=1
fi
export BUILDNUMBER
if [ -z "$NT_MASTERBUILD" ]
then
NT_MASTERBUILD=blowfish_NT4.0_Win95
fi
O_LDIR=OFF #local QA dir for NT, temporary
if [ -z "$WIN_WAIT_FOREVER" ] # header is global, some including scripts
then # want the init to wait forever for directories to
# appear (windows only) if OFF exit, if ON wait forever
WIN_WAIT_FOREVER=OFF
fi
################################### glob_init ##########################
# global shell function, main initialisation function
########################################################################
glob_init()
{
if [ $O_PARAM = "ON" ]
then
eval_opts $* # parse parameters and options - set flags
fi
if [ $O_CRON = "ON" ] # if running from cron HOST needs to be
then # known early, so the output file name
set_host # can be constructed. If running interactive
fi # it needs to be called by sourcing script
. $QASCRIPT_DIR/set_environment #finds out if we are running on Windows
Debug "Path after set_environment $PATH"
umask 0
set_dirs
set_files
set_vars
}
################################### set_vars ###########################
# global shell function, sets the environment variables, part of init
########################################################################
set_vars()
{
if [ -z "$LOGNAME" ]
then
if [ $O_WIN = "ON" ]
then
LOGNAME=$USERNAME
else
LOGNAME=$USER
fi
if [ -z "$LOGNAME" ]
then
LOGNAME=$UNAME
if [ -z "$LOGNAME" ]
then
LOGNAME=`basename $HOME`
fi
fi
fi
if [ -z "$LOGNAME" ]
then
Exit "Can't determine current user"
fi
}
################################### set_dirs ###########################
# global shell function, sets the directories, part of init
########################################################################
set_dirs()
{
#O_LOCAL
if [ "$O_WIN" = "ON" ]
then
win_set_dirs
else
D1=/h/hs-sca15c/export/builds/mccrel/nss/nss$NSSVER
D3=${D2}/${MASTERBUILD}
UXDIST=${D3}/mozilla/dist
RESULTDIR=${D3}/mozilla/tests_results/security
fi
D2=${D1}/builds/${QAYEAR}${BUILDDATE}.${BUILDNUMBER}
UX_MASTERDIR=${D2}/${MASTERBUILD}
NT_MASTERDIR=${D2}/${NT_MASTERBUILD}
UXDIST=${UX_MASTERDIR}/mozilla/dist
NTDIST=${NT_MASTERDIR}/mozilla/dist
RESULTDIR=${UX_MASTERDIR}/mozilla/tests_results/security
#O_LOCAL
if [ "$O_WIN" = "ON" ]
then
MASTERBUILD=$NT_MASTERBUILD
MOZILLA_ROOT=${NT_MASTERDIR}/mozilla
else
MOZILLA_ROOT=${UX_MASTERDIR}/mozilla
fi
TESTSCRIPTDIR=${MOZILLA_ROOT}/security/nss/tests
if [ ! -d $TESTSCRIPTDIR ]
then
if [ "$O_WIN" = "ON" -a "$WIN_WAIT_FOREVER" = "ON" ]
then
WaitForever $TESTSCRIPTDIR/all.sh 1
else
Exit "Test directory $TESTSCRIPTDIR does not exist"
fi
fi
COMMON=${TESTSCRIPTDIR}/common
set_objdir
Debug "NTDIST $NTDIST"
Debug "UXDIST $UXDIST"
Debug "TESTSCRIPTDIR $TESTSCRIPTDIR"
Debug "RESULTDIR $RESULTDIR"
Debug "TMP $TMP"
Debug "LOCALDIST_BIN $LOCALDIST_BIN"
Debug "COMMON $COMMON"
Debug "MOZILLA_ROOT $MOZILLA_ROOT"
export D1 D2 NTDIST UXDIST RESULTDIR TESTSCRIPTDIR
export UX_MASTERDIR NT_MASTERDIR COMMON MOZILLA_ROOT
}
################################### set_files ###########################
# global shell function, sets filenames, initializes files, part of init
########################################################################
set_files()
{
if [ $O_CRON = "ON" ]
then
NEWFILENAME=$RESULTDIR/$HOST.`basename $0`
if [ ! -d $RESULTDIR ]
then
mkdir -p $RESULTDIR || Exit "Error: can't make $RESULTDIR"
fi
if [ ! -w $RESULTDIR ]
then
Exit "can't touch $NEWFILENAME"
fi
touch $NEWFILENAME || Exit "Error: can't touch $NEWFILENAME"
cat $FILENAME >>$NEWFILENAME || Exit "Error: can't append $FILENAME to $NEWFILENAME"
TMPFILES="$TMPFILES $FILENAME"
FILENAME=$NEWFILENAME
Debug "Writing output to $FILENAME"
fi
}
################################### eval_opts ##########################
# global shell function, evapuates options and parameters, sets flags
# variables and defaults
########################################################################
eval_opts()
{
while [ -n "$1" ]
do
case $1 in
-cron)
O_CRON=ON
O_SILENT=ON
O_DEBUG=ON # FIXME take out!
O_ALWAYS_YES=ON
O_FILE=ON
FILENAME=${TMP}/nsstmp.$$ # for now write to the temporary file
# since we don't know the hostname yet
# will be inserted to the real file later
TMPFILES="$TMPFILES nsstmp.$$"
touch $FILENAME || Exit "Error: can't touch $FILENAME"
# NOTE we append rather that creating
Debug "Writing output to $FILENAME"
export O_CRON
;;
-l)
O_LOCAL=ON #Now what -
shift
MOZROOT=$1
if [ -z "$MOZROOT" ]
then
glob_usage "Error: -l requires a directory to follow, for example $HOME/src/tip1025 "
fi
Warning "-l not implemented yet (or only halfway)"
Debug "testing locally on $MOZROOT"
;;
-S*|-s*)
O_SILENT=ON
;;
-Y*|-y)
O_ALWAYS_YES=ON
;;
-d*|-D)
O_DEBUG=ON
#set -x
;;
-m*|-M*)
O_MAIL=ON
shift
MAILINGLIST=$1
if [ -z "$MAILINGLIST" ]
then
glob_usage "Error: -m requires a mailinglist to follow, for example sonmi,wtc,nelsonb "
fi
Debug "Sending result to $MAILINGLIST"
;;
-f*|-F*)
O_FILE=ON
shift
FILENAME=$1
if [ -z "$FILENAME" ]
then
glob_usage "Error: -f requires a filename to follow"
fi
#rm -f $FILENAME 2>/dev/null
touch $FILENAME || Exit "Error: can't touch $FILENAME"
#NOTE we append rather that creating
Debug "Writing output to $FILENAME"
;;
-h|-help|"-?")
glob_usage
;;
-*)
glob_usage "Error: Can't handle option $1"
;;
?*)
NSSVER=$1
if [ -z "$NSSVER" ]
then
NSSVER="tip"
Debug "NSS Version: Parameters missing - defaulting to tip!"
else
BUILDDATE=$2
if [ -z "$BUILDDATE" ]
then
BUILDDATE=`date +%m%d`
Debug "Builddate: Parameters missing - defaulting to today!"
else
shift
fi
fi
;;
esac
shift
done
Debug "Builddate $BUILDDATE NssVersion $NSSVER"
if [ -z "$BUILDDATE" ]
then
BUILDDATE=`date +%m%d`
Debug "Builddate: Parameters missing - defaulting to today!"
fi
if [ -z "$NSSVER" ]
then
NSSVER="tip"
Debug "NSS Version: Parameters missing - defaulting to tip!"
fi
Debug "Builddate $BUILDDATE NssVersion $NSSVER"
export BUILDDATE NSSVER
}
######################### win_set_dirs ################################
# global shell function, interactively finds the directories in case
# windows can't get to the default
########################################################################
win_set_dirs()
{
Debug "set Windows Directories..."
TMP=`echo "$TMP" | sed -e 's/\\\/\//g'`
Debug "TMP reformated to $TMP"
if [ "$O_CYGNUS" = ON ]
then
D1=/cygdrive/w/nss/nss$NSSVER
else
D1=w:/nss/nss$NSSVER
fi
if [ ! -w $D1 ]
then
Echo "Windows special... can't write in $D1"
if [ "$O_CYGNUS" = ON ]
then
D1=/cygdrive/u/nss/nss$NSSVER
else
D1="u:/nss/nss$NSSVER"
fi
else
Debug "D1 set to $D1"
return
fi
while [ ! -w $D1 ]
do
if [ "$O_CRON" = "ON" ]
then
Exit "cant write in $D1"
fi
Warning "cant write in $D1"
Echo "input start directory (u:/nss, d:/src/nss, f:/shared/nss) "
read D
if [ -n "$D" ]
then
D1=$D/nss$NSSVER
fi
done
Debug "D1 set to $D1"
}
########################### set_host ##################################
# global shell function, sets required variables HOST and DOMSUF, and asks
# the user if it has been set right
########################################################################
set_host()
{
set_host_done=0
if [ $DS_WAS_SET = FALSE ] #give chance to overwrite, espec. for NT
then
DOMSUF=`domainname 2>/dev/null`
if [ -z "$DOMSUF" ]
then
DOMSUF=`echo $HOST | grep '\.' | sed -e "s/[^\.]*\.//"`
if [ -z "$DOMSUF" ]
then
DOMSUF=`cat /etc/defaultdomain 2>/dev/null`
if [ -z "$DOMSUF" ]
then
DOMSUF="red.iplanet.com"
fi
fi
fi
fi
HOST=`echo $HOST | sed -e "s/\..*//"`
if [ -z "$HOST" ]
then
HOST=`uname -n | sed -e "s/\..*//"`
fi
if [ $O_DEBUG = "ON" ]
then
while [ $set_host_done -eq 0 ]
do
Echo
ask "DOMSUF=$DOMSUF, HOST=$HOST - OK", "y" "n" &&
set_host_done=1
if [ $set_host_done -eq 0 ]
then
Echo "input DOMSUF: "
read D
if [ -n "$D" ]
then
DOMSUF=$D
fi
Echo "input HOST: "
read H
if [ -n "$H" ]
then
HOST=$H
fi
fi
done
fi
export HOST DOMSUF
Debug "HOST: $HOST, DOMSUF: $DOMSUF"
}
#-----------------------------# UTILS #----------------------------------
################################### set_objdir #########################
# global shell function, sets the object directories and DIST
########################################################################
set_objdir()
{
OBJDIR=`cd ${TESTSCRIPTDIR}/common; gmake objdir_name`
OS_ARCH=`cd ${TESTSCRIPTDIR}/common; gmake os_arch`
#at this point $MASTEBUILD is be either NT or unix
LOCALDIST=${D1}/builds/${QAYEAR}${BUILDDATE}.${BUILDNUMBER}/${MASTERBUILD}/mozilla/dist
LOCALDIST_BIN=${LOCALDIST}/${OBJDIR}/bin
DIST=$LOCALDIST
#FIXME - test so PATH won't contai it double
PATH=$TESTSCRIPTDIR:$LOCALDIST_BIN:$BASEPATH
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
}
########################### Ps #########################################
# global shell function , attempts a platform specific ps
########################################################################
Ps()
{
#AIX, OSF ps -ef, solaris /usr/5bin/ps -ef, win ps -ef but no user id
#linux ps -ef, HP
if [ $os_name = "SunOS" ]
then
/usr/5bin/ps -ef
else
ps -ef
fi
}
########################### kill_by_name ################################
# global shell function , kills the process whose name is given as
# parameter
########################################################################
kill_by_name()
{
for PID in `Ps | grep "$1" | grep -v grep | \
sed -e "s/^ *//g" -e "s/^[^ ]* //" -e "s/^ *//g" -e "s/ .*//g"`
do
if [ $O_WIN = "ON" -a $O_CYGNUS = "ON" ]
then
ask "Do you want to kill Process $PID (`Ps | grep $PID | \
grep -v grep | awk '{ print $1, $2, $6, $7, $8, $9 }' | \
sed -e "s/[0-9]:[0-6][0-9]//g" | grep $PID `)" \
"y" "n" && {
kill $PID
sleep 1
kill -9 $PID 2>/dev/null
}
else
ask "Do you want to kill Process $PID (`Ps | grep $PID | \
grep -v grep | awk '{ print $1, $2, $8, $9, $10, $11 }' | \
sed -e "s/[0-9]:[0-6][0-9]//g" | grep $PID `)" \
"y" "n" && {
kill $PID
sleep 1
kill -9 $PID 2>/dev/null
}
fi
done
}
############################### Exit ###################################
# global shell function , central exiting point
# cleanup: temporary files, kill the remaining selfservers if sourcing
# script sets KILL_SELFSERV
########################################################################
Exit()
{
Echo $1
if [ "$O_CRON" = "OFF" ]
then
echo $1 >&2
fi
if [ -n "${TMPFILES}" ]
then
Debug "rm -f ${TMPFILES}"
rm -f $TMPFILES 2>/dev/null
fi
O_ALWAYS_YES=ON # set to non-interactive - don't ask anymore questions here
if [ $KILL_SELFSERV = "ON" ]
then
kill_by_name selfserv
fi
if [ $O_MAIL = "ON" -a $O_FILE = "ON" ]
then
cat $FILENAME | rmail $MAILINGLIST
fi
#chmod a+rw ${RESULTDIR} ${RESULTDIR}/* ${RESULTDIR}/*/* &
exit
}
trap "rm -f ${TMPFILES} 2>/dev/null; Exit 'killed... cleaning up...'" 2 3 15
################################ Wait ##################################
# global shell function to wait for an event to happen, 1st parameter
# filename to watch, 2nd parameter 0 - wait for it to disappear, 1 wait
# for it to be created.
# uses the variables WAIT_FOR and WAIT_TIMES
# WAIT_FOR: if waiting for an event sleep n seconds before rechecking
# recomended value 10 minutes 600
# WAIT_TIMES: recheck n times before giving up to prevent endless loop
# recomended 30 - total of 5h
########################################################################
Wait()
{
i=0
Debug "Waiting for $1"
while [ $i -lt $WAIT_TIMES ]
do
i=`expr $i + 1`
if [ -f "$1" -a $2 -eq 1 ] # if file exists and is supposed to
then
return
fi
if [ ! -f "$1" -a $2 -eq 0 ] # not exists and not supposed to exist
then
return
fi
Debug "Waiting for $1, loop #$i, about to sleep $WAIT_FOR seconds zzzz..."
sleep $WAIT_FOR
done
TOTAL=`expr $WAIT_TIMES \* $WAIT_FOR / 60`
Exit "I HAVE WAITED LONG ENOUGH FOR $1 NOW, I'M GONE! (THAT WAS A TOTAL OF $TOTAL MINUTES) I have better things to do... "
}
################################ WaitForever ##################################
# global shell function to wait for an event to happen, 1st parameter
# filename to watch, 2nd parameter 0 - wait for it to disappear, 1 wait
# for it to be created.
# because we daon't have any relyable cron on NT...
########################################################################
WaitForever()
{
i=0
Debug "Waiting for $1"
TOTAL=0
while [ 1 ]
do
i=`expr $i + 1`
if [ -f "$1" -a $2 -eq 1 ] # if file exists and is supposed to
then
return
fi
if [ ! -f "$1" -a $2 -eq 0 ] # not exists and not supposed to exist
then
return
fi
Debug "Waiting for $1, loop #$i, about to sleep $WAIT_FOR seconds Total $TOTAL"
sleep $WAIT_FOR
TOTAL=`expr $i \* $WAIT_FOR / 60`
if [ -n "$MAX_FOREVER" ] # we are cheating. Forever can be very short...
then
if [ "$TOTAL" -gt "$MAX_FOREVER" ]
then
Exit "I HAVE WAITED LONG ENOUGH FOR $1 NOW, I'M GONE! (THAT WAS A TOTAL OF $TOTAL MINUTES) I have better things to do... "
fi
fi
done
}
################################### is_running #########################
# global shell function , implements primitive locking mechanism
# filename is passed as a parameter, if filename.* exists we assume calling
# script is running already and exit, otherwise filename.processid is
# created
########################################################################
is_running()
{
Debug "Testing if $0 is already running... file ${1} - ${1}.$$"
if [ -f ${1}.* ]
then
Exit "$0 seems to be running already ($1 exists) - Exiting"
fi
TMPFILES="$TMPFILES ${1}.$$"
echo "running $0 on `date` PID $$" >${1}.$$
Debug "wrote \"running $0 on `date` PID $$\" to ${1}.$$"
}
#---------------------------# USERCOM #---------------------------------
############################## Echo #####################################
# global shell function , depending on the options the output gets written
# to a file, or is being discarded
# FIXME \n and \c are mistreates by differnet shells, and linux has /bin/echo
# instead of /usr/bin/echo
########################################################################
Echo ()
{
if [ $O_SILENT = OFF ]
then
echo "$*"
#/usr/bin/echo "$*"
fi
if [ $O_FILE = ON ]
then
echo "$*" >>$FILENAME
fi
}
################################### ask ################################
# global shell function, Asks the a question, and gives the returns 0
# on the 1st choice, 1 on the 2nd choice
#
# PARAMETERS:
# $1 question text
# $2 1st choice
# $3 2nd choice
#
# MODIFIERS:
# -y O_ALWAYS_YES will assume a first choice always (not neccessaryly "y")
#
# RETURN:
# 0 - User picked 1st choice
# 1 - User picked 2nd choice
#
# EXAMPLE
# ask "Would you like to continue" "y" "n" || Exit
# will produce the string "Would you like to continue (y/n) ?",
# read input from keyboard (or assume a yes with option -y)
# - on a yes it will return 0, on a no it will return 1, the
# shell interprets it as error and the || Exit will be executed
#
# NOTE: NEVER use "n" as the second parameter - it will mess up -y
# don't ask "Continue" "n" "y" || Exit # it will Exit on a "y"
#
########################################################################
Ask()
{
ask $*
}
ask()
{
if [ $O_ALWAYS_YES = ON ]
then
Echo "$1 ($2/$3) ?"
Echo "YES!"
return 0
fi
A=""
while [ 1 ]
do
Echo "$1 ($2/$3) ?"
read A
if [ -n "$A" ]
then
if [ $A = $2 ]
then
return 0
elif [ $A = $3 ]
then
return 1
fi
fi
done
return 0
}
################################### Warning ############################
# global shell function, Asks the user a "... continue? (y/n)" question,
# and exits when the user answers with no
# NOTE -y will answer the warnings always with yes
########################################################################
Warning ()
{
ask "WARNING: $0: \n $* continue " "y" "n" || Exit
}
################################### Debug ############################
# global shell function, when option -d Debugging output is written
########################################################################
Debug()
{
if [ $O_DEBUG = ON ]
then
Echo "DEBUG: (`date +%H:%M`) $0: $*"
fi
}
################################### line ###############################
# global shell function, supposed to make output more readable...
########################################################################
line()
{
Echo
#Echo "======================================================================="
#Echo
}
################################### opt_usage ##########################
# global shell function, tells user about available options
########################################################################
opt_usage()
{
if [ $O_OPTIONS = "ON" ]
then
Echo
line
Echo
Echo " -y answer all questions with y - use at your own risk..."
Echo " -s silent (only usefull with -y)"
Echo " -h, -? - you guessed right - displays this text"
Echo " -d debug"
Echo " -f <filename> - write the (error)output to filename"
Echo " -m <mailinglist> - send filename to mailinglist (csl "
Echo " example sonmi,nelsonb,wtc) only useful with -f"
Echo " -cron equivalient to -y -s -d -f \$RESULTDIR/\$HOST.nssqa"
Echo " -l <mozroot> run on a local build"
fi
}
################################### glob_usage #########################
# global shell function, how to use the calling script (parameters, options)
########################################################################
glob_usage()
{
line
Echo $1
Echo
if [ $O_OPTIONS = "ON" ]
then
Echo "usage $0 [options] nssversion builddate"
else
Echo "usage $0 nssversion builddate"
fi
Echo " for example: $0 30b 0926"
Echo " $0 31 1002"
opt_usage
Echo
Exit
}
tell()
{
if [ $O_SILENT = OFF ]
then
line
pwd
ls -CF
line
fi
if [ $O_FILE = ON ]
then
line
pwd >>$FILENAME
ls -CF >>$FILENAME
line
fi
}
set_host()
{
set_host_done=0
HOST=`echo $HOST | sed -e "s/.red.iplanet.com//"`
DOMSUF=`cat /etc/defaultdomain 2>/dev/null`
if [ -z "$DOMSUF" ]
then
DOMSUF="red.iplanet.com"
fi
if [ -z "$HOST" ]
then
HOST=`uname -n | sed -e "s/.red.iplanet.com//"`
fi
while [ $set_host_done -eq 0 ]
do
Echo
ask "DOMSUF=$DOMSUF, HOST=$HOST - OK", "y" "n" &&
set_host_done=1
if [ $set_host_done -eq 0 ]
then
Echo "input DOMSUF: "
read D
if [ -n "$D" ]
then
DOMSUF=$D
fi
Echo "input HOST: "
read H
if [ -n "$H" ]
then
HOST=$H
fi
fi
done
export HOST DOMSUF
Debug "HOST: $HOST, DOMSUF: $DOMSUF"
}
if [ $O_INIT = "ON" ]
then
glob_init $*
fi

236
security/nss/tests/nssqa Executable file
Просмотреть файл

@ -0,0 +1,236 @@
#! /bin/sh
########################################################################
#
# /u/sonmi/bin/nssqa - /u/svbld/bin/init/nss/nssqa
#
# this script is supposed to automatically run QA for NSS on all required
# Unix and Windows (NT and 2000) platforms
#
# parameters
# ----------
# nssversion (supported: 30b, 31, tip)
# builddate (default - today)
#
# options
# -------
# -y answer all questions with y - use at your own risk...ignores warnings
# -s silent (only usefull with -y)
# -h, -? - you guessed right - displays this text
# -d debug
# -f <filename> - write the (error)output to filename
# -cron equivalient to -y -s -d -f $RESULTDIR/$HOST.nssqa
# -l <mozroot> run on a local build
#
# 12/1/00
# took out the (unused) local directory for releasebuild QA on NT
# cleaned up 32 - 64 bit issues
# took hardcoded machinenames out
########################################################################
O_OPTIONS=ON # accept options (see above for listing)
WIN_SET_LOCALDIRS=ON # run QA in a local directory rather than accross
# the net
WIN_WAIT_FOREVER=ON # first we wait forever for a TESTDIR to appear, than
# we wait forever for the build to finish...
. `dirname $0`/header # utilities, shellfunctions etc, global to NSS QA
is_running ${TMP}/nssqa # checks if the file exists, if yes Exits, if not
# creates to implement a primitive locking mechanism
if [ $O_CRON = "OFF" ] # if we are running from cron this has been done
then
set_host # sets the HOST and DOMSUF variables - carefull,
fi # hardcoded to redplanet
KILL_SELFSERV=ON # cleanup will also kill the leftover selfserv processes
#. `dirname $0`/nssqa.header #derived from init.sh
################################ check_distdir #########################
# local shell function to check if the DIST directory exists, if not there
# is no use to continue the test
########################################################################
check_distdir()
{
set_objdir
if [ ! -d "$LOCALDIST_BIN" ]
then
Debug "Dist $DIST"
Warning "$LOCALDIST_BIN (the dist binaries dir) does not exist"
return 1
fi
if [ ! -d "$LOCALDIST" -a ! -h "$LOCALDIST" ]
then
Debug "Dist $DIST"
Warning "$LOCALDIST (the dist directory) does not exist"
return 1
fi
Debug "LOCALDIST_BIN $LOCALDIST_BIN"
Debug "Dist $DIST"
return 0
}
################################ run_all ###############################
# local shell function to start the all.sh after asking user and redirect
# the output apropriately
########################################################################
run_all()
{
check_distdir || return 1
kill_by_name selfserv
ask "Testing $OBJDIR continue with all.sh" "y" "n" || Exit
Debug "running all.sh in `pwd`... please be patient :)"
if [ $O_SILENT = ON ]
then
if [ $O_DEBUG = ON -a $O_FILE = ON ]
then
all.sh >>$FILENAME 2>>$FILENAME
else
all.sh >/dev/null 2>/dev/null
fi
else
#if [ $O_DEBUG = ON -a $O_FILE = ON ] #FIXME - write to tmp file and copy
#then
#all.sh 2>&1 | tee $FILENAME
#else
all.sh
#fi
fi
Debug "Done with all.sh "
line
}
all_sh()
{
echo
}
# determine if all needed symbolic links are present, in case
# we build on one platform and QA on another
if [ $O_WIN = "OFF" ]
then
if [ ! -h ${NTDIST}/WINNT5.0_DBG.OBJ -o \
! -h ${UXDIST}/SunOS5.8_OPT.OBJ -o \
! -h ${UXDIST}/OSF1V5.0_DBG.OBJ ]
then
# create the symbolic links
mksymlinks $* ||
glob_usage "Can't make the neccessary symbolic links"
fi
fi
if [ -d $TESTSCRIPTDIR ] #the directory mozilla/security/nss/tests,
then # where all.sh lives
cd $TESTSCRIPTDIR
else
Exit "cant cd to $TESTSCRIPTDIR Exiting"
fi
Debug testing from `pwd`
line
Debug "HOST: $HOST, DOMSUF: $DOMSUF"
# From the operatingsystem figure out the name of the build
case `uname -s` in
SunOS)
#first testing the 32 bit 2.6 build, even on 2.8
MAPPED_OS=Solaris2.6
;;
OSF1)
MAPPED_OS=OSF1V4.0
;;
AIX)
MAPPED_OS=AIX4.3
;;
Linux)
MAPPED_OS=Linux2.2
;;
HP-UX)
MAPPED_OS=HPUX11.00
;;
*)
if [ "$os_name" = "Windows" ]
then
MAPPED_OS=NT4.0
else
Exit "Sorry, operating system `uname -s` is not supported yet"
fi
;;
esac
OSDIR=${D1}/builds/${QAYEAR}${BUILDDATE}.${BUILDNUMBER}/*${MAPPED_OS}*
Debug Testing build for $MAPPED_OS in $OSDIR
if [ $O_WIN = "ON" ]
then
WaitForever ${OSDIR}/SVbuild.InProgress.1 0 #Wait for the build to finish...
OS_TARGET=WINNT;export OS_TARGET;Debug "OS_TARGET set to $OS_TARGET"
Echo "WINDOWS-OS-LINE: $os_name $os_full $OS_TARGET"
else
Wait ${OSDIR}/SVbuild.InProgress.1 0 #Wait for the build to finish...
fi
Debug "Dist $DIST"
run_all
BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT"
run_all
IS_64=""
# now for the 64 bit build!
case `uname -s` in
#OSF1) has been done already - always 64 bit
SunOS)
MAPPED_OS=Solaris*8
IS_64=`(isainfo -v | grep 64)>/dev/null && echo 64 bit`
OSDIR=${D1}/builds/${QAYEAR}${BUILDDATE}.${BUILDNUMBER}/*${MAPPED_OS}
if [ -n "$IS_64" ]
then #Wait for the 64 bit build to finish...
Debug Testing build for $MAPPED_OS in $OSDIR
Wait ${OSDIR}/SVbuild.InProgress.1 0
fi
;;
AIX)
IS_64=`lslpp -l | grep "bos.64bit"> /dev/null && echo 64 bit`
;;
HP-UX)
IS_64=`getconf KERNEL_BITS | grep 64 >/dev/null && echo 64 bit`
;;
*)
if [ "$O_WIN" = "ON" ]
then
OS_TARGET=WIN95;export OS_TARGET;Debug "OS_TARGET set to $OS_TARGET"
Echo "WINDOWS-OS-LINE: $os_name $os_full $OS_TARGET"
unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT"
run_all
BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT"
run_all
Debug "Copy results from $NT_MASTERDIR/mozilla/tests_results/security to $RESULTDIR"
cp -r $NT_MASTERDIR/mozilla/tests_results/security/* $RESULTDIR
fi
Exit "Done."
;;
esac
if [ -n "$IS_64" ]
then #Wait for the 64 bit build to finish...
Debug "This is a $IS_64 platform"
USE_64=1;export USE_64;Debug "Use_64 set to $USE_64"
unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT"
run_all
BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT"
run_all
else
Debug "This is a 32 bit platform"
fi
Exit "Done."

82
security/nss/tests/path_uniq Executable file
Просмотреть файл

@ -0,0 +1,82 @@
#! /bin/perl
########################################################################
#
# /u/sonmi/bin/path_uniq
#
# this script makes components of a PATH like string unique cand prints
# it to stdout
#
# parameters
# ----------
# PATH
#
# options
# -------
# -d delimiter - default :
#
# usefull enhancements: in the usage part, try to guess what was meant as
# a path and echo it to stdout to not break for PATHs with blanks
#
########################################################################
sub usage {
print STDERR "usage $0 [-d <delimiter>] PATH\n";
print STDERR " this script makes components of the PATH unique, if you\n";
print STDERR " pass in a searchpath A:B:C:A:B:E it will print A:B:C:E to\n";
print STDERR " the stdout\n";
print STDERR " the parameters you gave were: ";
for ( $i = 0; $i <= $#ARGV; $i++ ) {
print STDERR " $ARGV[$i]\n";
}
exit ;
}
$i = 0;
$j = 0;
$delimiter = ":";
$searchpath = "";
@pathcomponents;
$found=0;
$newpath="";
if ( $ARGV[0] eq '-d' ) {
if ( $#ARGV != 2 ) {
usage;
}
$delimiter = $ARGV[1];
$searchpath = $ARGV[2];
} else {
if ( $#ARGV != 0 ) {
usage;
}
$searchpath = $ARGV[0];
}
@pathcomponents=split($delimiter, $searchpath);
for ( $i = 0; $i <= $#pathcomponents; $i++ ) {
$found=0;
for ( $j = 0; $j < $i; $j++ ) {
if ( $pathcomponents[$j] eq $pathcomponents[$i] ) {
#print "$i and $j match - $pathcomponents[$i] - $pathcomponents[$j]\n";
$found=1;
last;
}
}
if ( $found == 0 ) {
#print "$pathcomponents[$i]:";
if ($i == 0) {
$newpath = $pathcomponents[$i];
} else {
$newpath=join($delimiter, $newpath,$pathcomponents[$i]);
}
}
}
print "$newpath\n";
exit;

365
security/nss/tests/qa_stat Executable file
Просмотреть файл

@ -0,0 +1,365 @@
#! /bin/sh
########################################################################
#
# /u/sonmi/bin/qa_stat - /u/svbld/bin/init/nss/qa_stat
#
# this script is supposed to automatically run QA for NSS on all required
# Unix platforms
#
# parameters
# ----------
# nssversion (supported: 30b, 31, tip)
# builddate (default - today)
#
# options
# -------
# -y answer all questions with y - use at your own risk...ignores warnings
# -s silent (only usefull with -y)
# -h, -? - you guessed right - displays this text
# -d debug
# -f <filename> - write the (error)output to filename
# -m <mailinglist> - send filename to mailinglist (csl) only useful
# with -f
# -cron equivalient to -y -s -d -f $RESULTDIR/$HOST.qa_stat
#
########################################################################
O_OPTIONS=ON
. /u/sonmi/bin/header
DOCDIR=/u/sonmi/doc
Debug "NTDIST $NTDIST"
Debug "UXDIST $UXDIST"
Debug "TESTSCRIPTDIR $TESTSCRIPTDIR"
Debug "RESULTDIR $RESULTDIR"
############################### find_qa_systems ##########################
# local shell function, tries to determine the QA operating system
########################################################################
find_qa_systems()
{
for w in `ls $RESULTDIR | grep \. | sed -e "s/\..*//" | sort -u`
do
QA_OS=""
QA_RHVER=""
IS_64=""
IS_WIN=""
grep WINDOWS-OS-LINE ${RESULTDIR}/${w}.nssqa >>$TMP_PLATFORMLIST_FILE #FIXME - if windows don't attempt an rsh
#w=`echo $d | sed -e "s/\..*//"`
QA_SYS=`rsh $w uname -sr`
echo $QA_SYS | grep Linux && QA_RHVER=`rsh $w cat /etc/redhat-release`
if [ -n "$QA_RHVER" ]
then
QA_OS=`echo $w $QA_RHVER | sed -e "s/Red Hat /RH /" -e "s/ release//"`
else
echo $QA_SYS | grep "SunOS 5.8" && \
IS_64=`rsh $w isainfo -v | grep 64 >/dev/null && echo 64 bit`
echo $QA_SYS | grep "HP" && \
IS_64=`rsh $w getconf KERNEL_BITS | grep 64 >/dev/null && \
echo 64 bit`
echo $QA_SYS | grep "AIX" && \
IS_64=`rsh $w lslpp -l | grep "bos.64bit"> /dev/null && \
echo 64 bit`
QA_OS=`echo "$w $QA_SYS $IS_64"`
fi
echo $QA_OS
echo $QA_OS | sed -e "s/ /_/g" >>$TMP_PLATFORMLIST_FILE # use later for
# missing list
done
}
################################### set_files ##########################
# local shell function, sets the name of the resultfile to:
# <filename> if option -f <filename>
# $RESULTDIR/result if write permission
# (mozilla/tests_results/security/result)
# $HOME/resultNSS${NSSVER}-${BUILDDATE} if no write permission in $RESULTDIR
########################################################################
set_files()
{
if [ $O_FILE = ON -a $O_CRON = OFF ] # if -f was specified write there
then
RFILE=$FILENAME
else
RFILE=${RESULTDIR}/result
#RFILE=${RESULTDIR}/result.$$
if [ ! -w $RESULTDIR ]
then
RFILE=$HOME/resultNSS${NSSVER}-${BUILDDATE}
Debug "Using alternate resultfile $RFILE"
elif [ $O_CRON = ON ]
then
find ${RESULTDIR} -exec chmod a+rw {} \; #FIXME - umask
#doesn't seem to work - this is a tmp workaround
fi
if [ -d $RESULTDIR ]
then
cd $RESULTDIR
else
glob_usage "$RESULTDIR does not exist"
fi
fi
TMP_E_FILE=${RFILE}.E$$
TMP_P_FILE=${RFILE}.P$$
TMP_A_FILE=${RFILE}.A$$
TMP_PLATFORMLIST_FILE=${RFILE}.Q$$
HTML_FILE=${RFILE}.html
TMPFILES="$TMPFILES $TMP_E_FILE $TMP_P_FILE"
FILENAME=$RFILE #we might want to mail it...later switch to html file
O_FILE="ON"
rm $HTML_FILE $RFILE $TMP_A_FILE $TMP_E_FILE $TMP_P_FILE 2>/dev/null
cp $DOCDIR/QAheader.html $HTML_FILE
}
################################# html_eot #########################
# local shell function, writes end of the html table
########################################################################
html_eot()
{
echo '</table>'
}
################################# html_footer #########################
# local shell function, writes end of the html body
########################################################################
html_footer()
{
echo '</body>'
echo '</html>'
}
################################# setQAsysvars #########################
# local shell function, sets system specific variables
########################################################################
setQAsysvars()
{
if [ "$MACHINE" != "0" ]
then
TESTDATE=`ls -ld $MACHINE | awk '{ print $5, $6, $7 }'`
TESTNUMBER=`echo $MACHINE | sed -e 's/.*\.//'`
SYSNAME=`echo $MACHINE | sed -e 's/\..*//'`
Debug "SYSNAME= $SYSNAME"
#QA_SYS_OS=`rsh $SYSNAME uname -sr` #rsh never returns???
echo $SYSNAME >>/tmp/qasys
QA_SYS_OS=`grep $SYSNAME $TMP_A_FILE | sed -e "s/$SYSNAME //"`
Debug "QA_SYS_OS= $QA_SYS_OS"
#QA_SYS_OS="SunOS 5.8"
fi
BUILD_SYS=`echo $BUILDPLATFORM | sed -e 's/\.OBJ//' -e 's/_DBG/ Debug/' \
-e 's/_OPT/ Optimized/' -e 's/_64/ 64bit/' -e 's/_glibc_PTH//' \
-e 's/_/ /'`
Debug "BUILD_SYS=$BUILD_SYS"
if [ -f "${RESULTDIR}/${MACHINE}/results.html" ]
then
RESULT="http://cindercone${RESULTDIR}/${MACHINE}/results.html"
Debug "RESULT=$RESULT"
else
RESULT="0"
Debug "no resultfile"
fi
if [ -f "${RESULTDIR}/${MACHINE}/output.log" ]
then
LOG="http://cindercone${RESULTDIR}/${MACHINE}/output.log"
Debug "LOG=$LOG"
else
LOG="0"
Debug "no logfile"
fi
}
HTML_ERRORCOLOR=\"#FF0000\"
HTML_ERRORMSG=Failed
HTML_MISSINGCOLOR=\"#FFFFCC\"
HTML_MISSINGMSG=Missing
HTML_PASSEDCOLOR=\"#66FF99\"
HTML_PASSEDMSG=Passed
################################# html_line() #########################
# local shell function, writes a line in the html table
########################################################################
html_line()
{
echo '<tr NOSAVE>'
echo '<td NOSAVE>'$BUILD_SYS'</td>'
echo ''
echo '<td NOSAVE>'$QA_SYS_OS'</td>'
echo ''
echo '<td>'$SYSNAME'</td>'
#echo '<td>'$SYSNAME $TESTNUMBER $TESTDATE'</td>'
echo ''
if [ "$1" = "failed" ]
then
echo '<td BGCOLOR='$HTML_ERRORCOLOR' NOSAVE><b>'$HTML_ERRORMSG'</b></td>'
elif [ "$1" = "passed" ]
then
echo '<td BGCOLOR='$HTML_PASSEDCOLOR' NOSAVE>'$HTML_PASSEDMSG'</td>'
else
echo '<td BGCOLOR='$HTML_MISSINGCOLOR' NOSAVE>'$HTML_MISSINGMSG'</td>'
fi
if [ "$RESULT" = "0" ]
then
echo '<td BGCOLOR='$HTML_MISSINGCOLOR' NOSAVE>'$HTML_MISSINGMSG'</td>'
else
echo '<td>&nbsp;<a href="'$RESULT'">result</a>&nbsp;</td>'
fi
echo ''
if [ "$LOG" = "0" ]
then
echo '<td BGCOLOR='$HTML_MISSINGCOLOR' NOSAVE>'$HTML_MISSINGMSG'</td>'
else
echo '<td>&nbsp;<a href="'$LOG'">log</a>&nbsp;</td>'
fi
echo ''
if [ "$1" = "failed" ]
then
echo '<td>&nbsp;<a href="#errorlist">error</a>&nbsp;</td>'
else
echo '<td></td>'
fi
echo '<td>'$TESTDATE $TESTNUMBER'</td>'
echo '</tr>'
}
################################# qa_errorlist #########################
# local shell function, finds problems in the previously run QA
########################################################################
qa_errorlist()
{
if [ "$1" = "1" ]
then
echo " R e s u l t E r r o r l i s t"
lline
fi
#FIXME - take bad password out!!!!
grep red */results.html | grep -v 'bad password' |
sed -e 's/.results.html:<TR><TD>/ /' -e 's/<[^>]*>/ /g'
if [ "$1" = "1" ]
then
lline
echo " O u t p u t E r r o r / W a r n i n g l i s t"
lline
fi
grep 'cache hits; .* cache misses, .* cache not reusable' */output.log |
grep -v selfserv |
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 -v '999 cache hits; 1 cache misses, 0 cache not reusable'
if [ "$1" = "1" ]
then
lline
echo " C o r e l i s t "
lline
fi
find . -name core -print 2>/dev/null
}
platformlist()
{
lline
echo " P l a t f o r m l i s t "
grep Platform */results.html |
sed -e 's/.results.html:<H4>Platform:/ /' \
-e 's/<BR>//' |
while read MACHINE BUILDPLATFORM
do
grep $MACHINE $1 >/dev/null
ret=$?
setQAsysvars
if [ $ret -eq 0 ]
then
echo "Failed $MACHINE $BUILDPLATFORM"
html_line failed >>$HTML_FILE
#echo "1 $MACHINE $BUILDPLATFORM Failed 2"
else
echo "Passed $MACHINE $BUILDPLATFORM"
html_line passed >>$HTML_FILE
#echo "1 $MACHINE $BUILDPLATFORM passed 2"
fi
done
}
############################ check_platforms ###########################
# local shell function, finds out if we ran on all required platforms
########################################################################
check_platforms()
{
lline
echo " M i s s i n g P l a t f o r m s"
lline
QA_MISSING="QA report missing"
MACHINE="0"
for BUILDPLATFORM in `cat $TESTSCRIPTDIR/platformlist`
do
grep $BUILDPLATFORM $TMP_PLATFORMLIST_FILE > /dev/null || {
echo "$BUILDPLATFORM not tested: $QA_MISSING" >>$TMP_P_FILE
setQAsysvars
html_line missing >>$HTML_FILE
}
done
}
lline()
{
echo
echo "------------------------------------------------------------------"
echo
}
header()
{
lline
echo "QA results for NSS $NSSVER builddate $QAYEAR $BUILDDATE "
echo "today's date `date`"
lline
echo "testing in $RESULTDIR"
}
set_files
find_qa_systems >$TMP_A_FILE 2>/dev/null
#header > $RFILE
qa_errorlist 1 > $TMP_E_FILE
cat $TMP_E_FILE
platformlist $TMP_E_FILE > $RFILE
cat $RFILE
echo "" >$TMP_P_FILE
check_platforms $RFILE
html_eot >>$HTML_FILE
echo '<a NAME="errorlist"></a>' >> $HTML_FILE
qa_errorlist 2 | sed -e "s/^/<br>/" >>$HTML_FILE
html_footer >>$HTML_FILE
FILENAME=$HTML_FILE #we might want to mail it...
Exit

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

@ -0,0 +1,169 @@
#! /bin/sh
########################################################################
#
# /u/sonmi/bin/cron_environment
#
# sourced from the header if running from cron to get the full environment
# to run nssqa
#
# This is derived from the .cshrc file for the svbld account.
#
########################################################################
if [ -z "$HOME" ]
then
HOME=/u/svbld
fi
if [ -z "$QASCRIPT_DIR" ]
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
os_name=`uname -s`
os_version=`uname -r`
os_full=""
if [ -f /u/svbld/bin/nsarch ]
then
os_full=`/u/svbld/bin/nsarch -f` #FIXME
fi
MANPATH=/usr/share/man:/usr/openwin/man:/usr/local/man
export CVSROOT HOME os_name os_version os_full MANPATH
if [ $os_name = "HP-UX" ]
then
PATH=$PATH:/usr/local/bin:/opt/aCC/bin:/usr/local/bin/audio:/tools/ns/bin:/etc:/usr/contrib/bin:/usr/contrib/bin/X11:/usr/local/hpux/bin:/nfs/iapp1/hphome/bin:/etc
elif [ $os_name = "SunOS" ]
then
XAPPLRESDIR=/usr/openwin/lib/app-defaults:/usr/local/lib/X11/app-defaults
OPENWINHOME=/usr/openwin
LD_LIBRARY_PATH=$OPENWINHOME/lib
PATH=/tools/ns/bin:$PATH:/opt/SUNWspro/bin:/usr/bin/X11:/usr/openwin/bin:/usr/openwin/demo
if [ $os_version = "5.8" -o $os_version = "5.7" ]
then
PATH=$PATH:/tools/ns/workshop-5.0/bin
else
PATH=$PATH:/tools/ns/workshop-4.0/bin
fi
PATH=$PATH:/usr/ccs/bin:/usr/ucb/bin:/opt/SUNWwabi/bin:/usr/local/bin:/tools/ns/bin:/etc:/tools/contrib/bin
PATH=/usr/ucb:/h/tortoise/export/share/builds/tools/sparc_sun_solaris2.5.1/perl5.004/bin:$PATH
export XAPPLRESDIR OPENWINHOME LD_LIBRARY_PATH
elif [ $os_name = "IRIX" ]
then
PATH=$PATH:/tools/ns/bin:/usr/local/bin:/etc:/usr/bsd
MANPATH=/tools/ns/man:/usr/local/man
elif [ $os_name = "IRIX64" ]
then
PATH=$PATH:/tools/ns/bin:/usr/local/bin:/etc:/usr/bsd
MANPATH=/tools/ns/man:/usr/local/man
elif [ $os_name = "Linux" ]
then
PATH=/lib:/usr/lib:/bin:/sbin:/usr/bin:/usr/sbin:$PATH
elif [ $os_name = "AIX" ]
then
PATH=$PATH:/tools/contrib/bin:/usr/local/bin
TERM=vt100
export TERM
elif [ $os_name = "OSF1" ]
then
PATH=/h/tortoise/export/share/builds/tools/alpha_dec_osf4.0/perl5.004/bin:$PATH:/usr/local/bin
fi
if [ "$os_full" = "HPUX 11.00" ]
then
PATH=/h/tortoise/export/share/builds/tools/hppa1.1_hp_hpux11.00/perl5.004/bin:$PATH
elif [ "$os_full" = "HPUX 10.10" ]
then
PATH=/h/tortoise/export/share/builds/tools/hppa1.1_hp_hpux10.10/perl5.004/bin:$PATH
elif [ "$os_full" = "AIX 4.1.4.0" ]
then
PATH=/h/tortoise/export/share/builds/tools/rs6000_ibm_aix3.2.5/perl5.004/bin:$PATH
elif [ "$os_full" = "AIX 4.1.5.0" ]
then
PATH=/h/tortoise/export/share/builds/tools/rs6000_ibm_aix3.2.5/perl5.004/bin:$PATH
elif [ "$os_full" = "AIX 4.2.1.0" ]
then
PATH=/h/tortoise/export/share/builds/tools/rs6000_ibm_aix4.1/perl5.004/bin:$PATH
elif [ "$os_name" = "IRIX" ]
then
PATH=/tools/ns-arch/soft/perl-5.004_04/run/default/mips_sgi_irix5.3/bin:$PATH
elif [ "$os_name" = "IRIX64" ]
then
PATH=/tools/ns-arch/soft/perl-5.004_04/run/default/mips_sgi_irix5.3/bin:$PATH
fi
O_CYGNUS=OFF
O_MKS=OFF
O_WIN=OFF
if [ "$os_name" = "CYGWIN_NT-4.0" -o \
"$os_name" = "CYGWIN_NT-5.0" -o \
"$os_name" = "CYGWIN_95-4.0" -o \
"$os_name" = "CYGWIN_98-4.10" ]
then
#FIXME net use, mount the neccessary pnetwork drives and partitiones first
#FIXME - take MKS out of the PATH
os_full=$os_name
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"`
elif [ "$os_name" = "Windows_95" -o \
"$os_name" = "Windows_NT" -o \
"$os_name" = "WINNT" -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"
if [ "$os_name" = "Windows_NT" -o \
"$os_name" = "WINNT" ]
then
PATH="${PATH};C:/WINNT/System32;C:/WINNT;.;"
fi
PATH="`dirname $0`;$PATH"
PATH=`perl $QASCRIPT_DIR/path_uniq -d ';' "$PATH"`
echo $PATH
os_full=$os_name
os_name="Windows"
O_MKS=ON
O_WIN=ON
else
EDITOR=vi
EMACSLOADPATH=/u/svbld/emacs
PYTHONPATH=.:/tools/ns/lib/python1.4
PAGER=less
XMCD_LIBDIR=/usr/local/lib/xmcd
DISPLAY=:0.0
PATH=`$QASCRIPT_DIR/path_uniq "$PATH"`
fi
BASEPATH=$PATH # in case we we set and reset DIST directories the PATH
# needs to change accordingly
export PATH EDITOR EMACSLOADPATH PYTHONPATH PAGER XMCD_LIBDIR DISPLAY MANPATH os_full os_name BASEPATH
umask 022
system=`uname -n` # name of this system.