nssqa (8901B)
1 #! /bin/sh 2 3 ######################################################################## 4 # 5 # /u/sonmi/bin/nssqa - /u/svbld/bin/init/nss/nssqa 6 # 7 # this script is supposed to automatically run QA for NSS on all required 8 # Unix and Windows (NT and 2000) platforms 9 # 10 # parameters 11 # ---------- 12 # nssversion (supported: 30b, 31, tip) 13 # builddate (default - today) 14 # 15 # options 16 # ------- 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 20 # -d debug 21 # -f <filename> - write the (error)output to filename 22 # -cron equivalient to -y -s -d -f $RESULTDIR/$HOST.nssqa 23 # 24 # 12/1/00 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 ######################################################################## 29 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... 33 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 37 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 42 fi 43 44 KILL_SELFSERV=OFF # cleanup will also kill the leftover selfserv processes 45 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 ######################################################################## 50 check_distdir() 51 { 52 set_objdir 53 54 if [ ! -d "$LOCALDIST_BIN" ] 55 then 56 Debug "Dist $DIST" 57 Warning "$LOCALDIST_BIN (the dist binaries dir) does not exist" 58 return 1 59 fi 60 61 if [ ! -d "$LOCALDIST" -a ! -h "$LOCALDIST" ] 62 then 63 Debug "Dist $DIST" 64 Warning "$LOCALDIST (the dist directory) does not exist" 65 return 1 66 fi 67 68 Debug "LOCALDIST_BIN $LOCALDIST_BIN" 69 Debug "Dist $DIST" 70 return 0 71 } 72 73 ################################ run_all ############################### 74 # local shell function to start the all.sh after asking user and redirect 75 # the output apropriately 76 ######################################################################## 77 run_all() 78 { 79 check_distdir || return 1 80 #kill_by_name selfserv 81 ask "Testing $OBJDIR continue with all.sh" "y" "n" || Exit 82 83 Debug "running all.sh in `pwd`" 84 if [ $O_SILENT = ON ] 85 then 86 if [ $O_DEBUG = ON -a $O_FILE = ON ] 87 then 88 all.sh >>$FILENAME 2>>$FILENAME 89 else 90 all.sh >/dev/null 2>/dev/null 91 fi 92 else 93 all.sh 94 fi 95 Debug "Done with all.sh " 96 line 97 } 98 99 all_sh() 100 { 101 echo 102 } 103 104 105 ########################### wait_for_build ############################# 106 # local shell function to wait until the build is finished 107 ######################################################################## 108 wait_for_build() 109 { 110 if [ $O_WIN = "ON" ] 111 then 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" 118 else 119 Wait ${OSDIR}/SVbuild.InProgress.1 0 120 #Wait for the build to finish... Unix a few hours 121 qa_stat_get_sysinfo 122 Echo "UNIX-OS-LINE: $QA_OS" 123 fi 124 find_nt_masterbuild 125 } 126 127 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 ######################################################################## 133 map_os32() 134 { 135 case `uname -s` in 136 SunOS) 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 141 MAPPED_OS=Solaris2.6 142 else 143 MAPPED_OS=Solaris8_forte6 144 fi 145 ;; 146 Darwin) 147 MAPPED_OS=Darwin6.5 148 ;; 149 AIX) 150 MAPPED_OS=AIX4.3 151 ;; 152 Linux) 153 RH_MR=`cat /etc/redhat-release | sed \ 154 -e "s/Red Hat Linux release //" -e "s/ .*//g" \ 155 -e "s/\..*//g"` 156 157 if [ "$RH_MR" = "6" ] ; then 158 MAPPED_OS=Linux2.2 159 else 160 MAPPED_OS=Linux2.4 161 LD_ASSUME_KERNEL="2.2.5" 162 export LD_ASSUME_KERNEL 163 fi 164 ;; 165 HP-UX) 166 MAPPED_OS=HPUX11.00 167 ;; 168 *) 169 if [ "$os_name" = "Windows" ] 170 then 171 MAPPED_OS=NT4.0 172 else 173 Exit "Sorry, operating system `uname -s` is not supported yet" 174 fi 175 ;; 176 esac 177 set_osdir 178 Debug "Mapped OS to $MAPPED_OS" 179 } 180 181 ############################# nssqa_main ############################### 182 # local shell function main controlling function of the nss qa 183 ######################################################################## 184 nssqa_main() 185 { 186 Debug "In function nssqa_main" 187 188 if [ $O_WIN = "OFF" -a "$O_TBX" = "OFF" -a $O_LOCAL = "OFF" ] ; then 189 if [ ! -h ${NTDIST}/WINNT5.0_DBG.OBJ -o \ 190 ! -h ${UXDIST}/SunOS5.8_OPT.OBJ -o ] ; then 191 # determine if all needed symbolic links are present, in case 192 # we build on one platform and QA on another 193 # create the symbolic links 194 #mksymlinks $* || 195 `dirname $0`/mksymlinks $NSSVER $BUILDDATE || 196 Warning "Can't make the neccessary symbolic links" 197 fi 198 fi 199 200 if [ -d $TESTSCRIPTDIR ] #the directory mozilla/security/nss/tests, 201 then # where all.sh lives 202 cd $TESTSCRIPTDIR 203 else 204 Exit "cant cd to $TESTSCRIPTDIR Exiting" 205 fi 206 207 Debug "Testing from `pwd`" 208 line 209 Debug "HOST: $HOST, DOMSUF: $DOMSUF" 210 211 if [ "$O_TBX" = "OFF" ] ; then 212 map_os32 # From the operatingsystem figure out the name of the build 213 Debug Testing build for $MAPPED_OS in $OSDIR 214 wait_for_build 215 fi 216 run_all 217 BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT" 218 run_all 219 220 # now for the 64 bit build! 221 map_os64 # From the operatingsystem figure out the name of the build 222 if [ -n "$IS_64" ] ; then #Wait for the 64 bit build to finish... 223 Debug "This is a $IS_64 platform" 224 USE_64=1;export USE_64;Debug "Use_64 set to $USE_64" 225 unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT" 226 227 run_all 228 BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT" 229 run_all 230 elif [ "$O_WIN" = "ON" ] ; then 231 OS_TARGET=WIN95;export OS_TARGET 232 Debug "OS_TARGET set to $OS_TARGET" 233 #Echo "WINDOWS-OS-LINE: $os_name $os_full $OS_TARGET" 234 unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT" 235 #if [ "$TEST_LEVEL" = "0" ] ; then 236 #QA_OS_NAME=`cd ${TESTSCRIPTDIR}/common; gmake objdir_name | \ 237 #sed -e "s/WINNT4.0.*/Windows-NT-4.0/" -e \ 238 #"s/WINNT5.0.*/Windows-2000/"` 239 #Echo "WINDOWS-OS-LINE: $QA_OS_NAME $OS_TARGET" 240 #fi 241 run_all 242 BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT" 243 run_all 244 else 245 Debug "This is a 32 bit platform" 246 fi 247 } 248 249 TEST_LEVEL=0 250 251 while [ $TEST_LEVEL -lt 2 ] ; do 252 export TEST_LEVEL 253 unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT" 254 unset USE_64;export USE_64;Debug "USE_64 $USE_64" 255 bc $TEST_LEVEL 256 Debug "About to start nssqa_main" 257 if [ $O_FILE = ON -a "$O_WIN" != "ON" ] ; then 258 nssqa_main 2>>$FILENAME 259 else 260 nssqa_main 261 fi 262 if [ "$O_TBX" = "ON" ] ; then # do not do backward compatibility 263 TEST_LEVEL=3 # testing on tinderbox 264 else 265 TEST_LEVEL=`expr $TEST_LEVEL + 1 ` 266 fi 267 done 268 269 if [ "$O_TBX" = "ON" -o "$O_LOCAL" = "ON" ] ; then 270 #FIXME - maybe it should be copied back to the networkdrive later (-ln) 271 if [ -n "${TMPFILES}" ] ; then #caused problems on tinderbox machines 272 Debug "rm -f ${TMPFILES}" 273 rm -f $TMPFILES 2>/dev/null 274 fi 275 Debug "running qa_stat" 276 . `dirname $0`/qa_stat 277 fi 278 279 280 qa_stat_get_sysinfo 281 282 Exit "nssqa completed. Done `uname -n` $QA_OS_STRING"