3 ########################################################################
5 # /u/sonmi/bin/nssqa - /u/svbld/bin/init/nss/nssqa
7 # this script is supposed to automatically run QA for NSS on all required
8 # Unix and Windows (NT and 2000) platforms
12 # nssversion (supported: 30b, 31, tip)
13 # builddate (default - today)
17 # -y answer all questions with y - use at your own risk...ignores warnings
18 # -s silent (only usefull with -y)
19 # -h, -? - you guessed right - displays this text
21 # -f <filename> - write the (error)output to filename
22 # -cron equivalient to -y -s -d -f $RESULTDIR/$HOST.nssqa
25 # took out the (unused) local directory for releasebuild QA on NT
26 # cleaned up 32 - 64 bit issues
27 # took hardcoded machinenames out
28 ########################################################################
30 O_OPTIONS=ON # accept options (see above for listing)
31 WIN_WAIT_FOREVER=ON # first we wait forever for a TESTDIR to appear, than
32 # we wait forever for the build to finish...
34 TBX_EXIT=50 # in case we are running on a tinderbox build, any
35 # early exit needs to return an error
36 . `dirname $0`/header # utilities, shellfunctions etc, global to NSS QA
38 if [ -z "$O_TBX" -o "$O_TBX" != "ON" ] ; then
39 is_running ${TMP}/nssqa
40 # checks if the file exists, if yes Exits, if not
41 # creates to implement a primitive locking mechanism
44 KILL_SELFSERV=OFF # cleanup will also kill the leftover selfserv processes
46 ################################ check_distdir #########################
47 # local shell function to check if the DIST directory exists, if not there
48 # is no use to continue the test
49 ########################################################################
54 if [ ! -d "$LOCALDIST_BIN" ]
57 Warning "$LOCALDIST_BIN (the dist binaries dir) does not exist"
61 if [ ! -d "$LOCALDIST" -a ! -h "$LOCALDIST" ]
64 Warning "$LOCALDIST (the dist directory) does not exist"
68 Debug "LOCALDIST_BIN $LOCALDIST_BIN"
73 ################################ run_all ###############################
74 # local shell function to start the all.sh after asking user and redirect
75 # the output apropriately
76 ########################################################################
79 check_distdir || return 1
80 #kill_by_name selfserv
81 ask "Testing $OBJDIR continue with all.sh" "y" "n" || Exit
83 Debug "running all.sh in `pwd`"
86 if [ $O_DEBUG = ON -a $O_FILE = ON ]
88 all.sh >>$FILENAME 2>>$FILENAME
90 all.sh >/dev/null 2>/dev/null
95 Debug "Done with all.sh "
105 ########################### wait_for_build #############################
106 # local shell function to wait until the build is finished
107 ########################################################################
112 WaitForever ${OSDIR}/SVbuild.InProgress.1 0
113 #Wait for the build to finish Windows a lot longer
114 OS_TARGET=WINNT;export OS_TARGET;Debug "OS_TARGET set to $OS_TARGET"
115 QA_OS_NAME=`cd ${TESTSCRIPTDIR}/common; gmake objdir_name | \
116 sed -e "s/WINNT4.0.*/Windows-NT-4.0/" -e "s/WINNT5.0.*/Windows-2000/"`
117 Echo "WINDOWS-OS-LINE: $QA_OS_NAME"
119 Wait ${OSDIR}/SVbuild.InProgress.1 0
120 #Wait for the build to finish... Unix a few hours
122 Echo "UNIX-OS-LINE: $QA_OS"
128 ########################### map_os #############################
129 # local shell function: From the operatingsystem figure out the name of
130 # the build ; needed to detemine if the build finished, passed and for
131 # the directory names
132 ########################################################################
137 S_REL=`uname -r | sed -e "s/^[^\.]*\.//g"`
138 if [ `uname -p` = "i386" ] ; then
139 MAPPED_OS=Solaris8_x86
140 elif [ "$S_REL" -lt 8 ] ; then
143 MAPPED_OS=Solaris8_forte6
156 RH_MR=`cat /etc/redhat-release | sed \
157 -e "s/Red Hat Linux release //" -e "s/ .*//g" \
160 if [ "$RH_MR" = "6" ] ; then
164 LD_ASSUME_KERNEL="2.2.5"
165 export LD_ASSUME_KERNEL
172 if [ "$os_name" = "Windows" ]
176 Exit "Sorry, operating system `uname -s` is not supported yet"
181 Debug "Mapped OS to $MAPPED_OS"
184 ############################# nssqa_main ###############################
185 # local shell function main controlling function of the nss qa
186 ########################################################################
189 Debug "In function nssqa_main"
191 if [ $O_WIN = "OFF" -a "$O_TBX" = "OFF" -a $O_LOCAL = "OFF" ] ; then
192 if [ ! -h ${NTDIST}/WINNT5.0_DBG.OBJ -o \
193 ! -h ${UXDIST}/SunOS5.8_OPT.OBJ -o \
194 ! -h ${UXDIST}/OSF1V5.0_DBG.OBJ ] ; then
195 # determine if all needed symbolic links are present, in case
196 # we build on one platform and QA on another
197 # create the symbolic links
199 `dirname $0`/mksymlinks $NSSVER $BUILDDATE ||
200 Warning "Can't make the neccessary symbolic links"
204 if [ -d $TESTSCRIPTDIR ] #the directory mozilla/security/nss/tests,
205 then # where all.sh lives
208 Exit "cant cd to $TESTSCRIPTDIR Exiting"
211 Debug "Testing from `pwd`"
213 Debug "HOST: $HOST, DOMSUF: $DOMSUF"
215 if [ "$O_TBX" = "OFF" ] ; then
216 map_os32 # From the operatingsystem figure out the name of the build
217 Debug Testing build for $MAPPED_OS in $OSDIR
221 BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT"
224 # now for the 64 bit build!
225 map_os64 # From the operatingsystem figure out the name of the build
226 if [ -n "$IS_64" ] ; then #Wait for the 64 bit build to finish...
227 Debug "This is a $IS_64 platform"
228 USE_64=1;export USE_64;Debug "Use_64 set to $USE_64"
229 unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT"
232 BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT"
234 elif [ "$O_WIN" = "ON" ] ; then
235 OS_TARGET=WIN95;export OS_TARGET
236 Debug "OS_TARGET set to $OS_TARGET"
237 #Echo "WINDOWS-OS-LINE: $os_name $os_full $OS_TARGET"
238 unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT"
239 #if [ "$TEST_LEVEL" = "0" ] ; then
240 #QA_OS_NAME=`cd ${TESTSCRIPTDIR}/common; gmake objdir_name | \
241 #sed -e "s/WINNT4.0.*/Windows-NT-4.0/" -e \
242 #"s/WINNT5.0.*/Windows-2000/"`
243 #Echo "WINDOWS-OS-LINE: $QA_OS_NAME $OS_TARGET"
246 BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT"
249 Debug "This is a 32 bit platform"
255 while [ $TEST_LEVEL -lt 2 ] ; do
257 unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT"
258 unset USE_64;export USE_64;Debug "USE_64 $USE_64"
260 Debug "About to start nssqa_main"
261 if [ $O_FILE = ON -a "$O_WIN" != "ON" ] ; then
262 nssqa_main 2>>$FILENAME
266 if [ "$O_TBX" = "ON" ] ; then # do not do backward compatibility
267 TEST_LEVEL=3 # testing on tinderbox
269 TEST_LEVEL=`expr $TEST_LEVEL + 1 `
273 if [ "$O_TBX" = "ON" -o "$O_LOCAL" = "ON" ] ; then
274 #FIXME - maybe it should be copied back to the networkdrive later (-ln)
275 if [ -n "${TMPFILES}" ] ; then #caused problems on tinderbox machines
276 Debug "rm -f ${TMPFILES}"
277 rm -f $TMPFILES 2>/dev/null
279 Debug "running qa_stat"
280 . `dirname $0`/qa_stat
286 Exit "nssqa completed. Done `uname -n` $QA_OS_STRING"