1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/tests/nssqa Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,286 @@ 1.4 +#! /bin/sh 1.5 + 1.6 +######################################################################## 1.7 +# 1.8 +# /u/sonmi/bin/nssqa - /u/svbld/bin/init/nss/nssqa 1.9 +# 1.10 +# this script is supposed to automatically run QA for NSS on all required 1.11 +# Unix and Windows (NT and 2000) platforms 1.12 +# 1.13 +# parameters 1.14 +# ---------- 1.15 +# nssversion (supported: 30b, 31, tip) 1.16 +# builddate (default - today) 1.17 +# 1.18 +# options 1.19 +# ------- 1.20 +# -y answer all questions with y - use at your own risk...ignores warnings 1.21 +# -s silent (only usefull with -y) 1.22 +# -h, -? - you guessed right - displays this text 1.23 +# -d debug 1.24 +# -f <filename> - write the (error)output to filename 1.25 +# -cron equivalient to -y -s -d -f $RESULTDIR/$HOST.nssqa 1.26 +# 1.27 +# 12/1/00 1.28 +# took out the (unused) local directory for releasebuild QA on NT 1.29 +# cleaned up 32 - 64 bit issues 1.30 +# took hardcoded machinenames out 1.31 +######################################################################## 1.32 + 1.33 +O_OPTIONS=ON # accept options (see above for listing) 1.34 +WIN_WAIT_FOREVER=ON # first we wait forever for a TESTDIR to appear, than 1.35 + # we wait forever for the build to finish... 1.36 + 1.37 +TBX_EXIT=50 # in case we are running on a tinderbox build, any 1.38 + # early exit needs to return an error 1.39 +. `dirname $0`/header # utilities, shellfunctions etc, global to NSS QA 1.40 + 1.41 +if [ -z "$O_TBX" -o "$O_TBX" != "ON" ] ; then 1.42 + is_running ${TMP}/nssqa 1.43 + # checks if the file exists, if yes Exits, if not 1.44 + # creates to implement a primitive locking mechanism 1.45 +fi 1.46 + 1.47 +KILL_SELFSERV=OFF # cleanup will also kill the leftover selfserv processes 1.48 + 1.49 +################################ check_distdir ######################### 1.50 +# local shell function to check if the DIST directory exists, if not there 1.51 +# is no use to continue the test 1.52 +######################################################################## 1.53 +check_distdir() 1.54 +{ 1.55 + set_objdir 1.56 + 1.57 + if [ ! -d "$LOCALDIST_BIN" ] 1.58 + then 1.59 + Debug "Dist $DIST" 1.60 + Warning "$LOCALDIST_BIN (the dist binaries dir) does not exist" 1.61 + return 1 1.62 + fi 1.63 + 1.64 + if [ ! -d "$LOCALDIST" -a ! -h "$LOCALDIST" ] 1.65 + then 1.66 + Debug "Dist $DIST" 1.67 + Warning "$LOCALDIST (the dist directory) does not exist" 1.68 + return 1 1.69 + fi 1.70 + 1.71 + Debug "LOCALDIST_BIN $LOCALDIST_BIN" 1.72 + Debug "Dist $DIST" 1.73 + return 0 1.74 +} 1.75 + 1.76 +################################ run_all ############################### 1.77 +# local shell function to start the all.sh after asking user and redirect 1.78 +# the output apropriately 1.79 +######################################################################## 1.80 +run_all() 1.81 +{ 1.82 + check_distdir || return 1 1.83 + #kill_by_name selfserv 1.84 + ask "Testing $OBJDIR continue with all.sh" "y" "n" || Exit 1.85 + 1.86 + Debug "running all.sh in `pwd`" 1.87 + if [ $O_SILENT = ON ] 1.88 + then 1.89 + if [ $O_DEBUG = ON -a $O_FILE = ON ] 1.90 + then 1.91 + all.sh >>$FILENAME 2>>$FILENAME 1.92 + else 1.93 + all.sh >/dev/null 2>/dev/null 1.94 + fi 1.95 + else 1.96 + all.sh 1.97 + fi 1.98 + Debug "Done with all.sh " 1.99 + line 1.100 +} 1.101 + 1.102 +all_sh() 1.103 +{ 1.104 + echo 1.105 +} 1.106 + 1.107 + 1.108 +########################### wait_for_build ############################# 1.109 +# local shell function to wait until the build is finished 1.110 +######################################################################## 1.111 +wait_for_build() 1.112 +{ 1.113 + if [ $O_WIN = "ON" ] 1.114 + then 1.115 + WaitForever ${OSDIR}/SVbuild.InProgress.1 0 1.116 + #Wait for the build to finish Windows a lot longer 1.117 + OS_TARGET=WINNT;export OS_TARGET;Debug "OS_TARGET set to $OS_TARGET" 1.118 + QA_OS_NAME=`cd ${TESTSCRIPTDIR}/common; gmake objdir_name | \ 1.119 + sed -e "s/WINNT4.0.*/Windows-NT-4.0/" -e "s/WINNT5.0.*/Windows-2000/"` 1.120 + Echo "WINDOWS-OS-LINE: $QA_OS_NAME" 1.121 + else 1.122 + Wait ${OSDIR}/SVbuild.InProgress.1 0 1.123 + #Wait for the build to finish... Unix a few hours 1.124 + qa_stat_get_sysinfo 1.125 + Echo "UNIX-OS-LINE: $QA_OS" 1.126 + fi 1.127 + find_nt_masterbuild 1.128 +} 1.129 + 1.130 + 1.131 +########################### map_os ############################# 1.132 +# local shell function: From the operatingsystem figure out the name of 1.133 +# the build ; needed to detemine if the build finished, passed and for 1.134 +# the directory names 1.135 +######################################################################## 1.136 +map_os32() 1.137 +{ 1.138 + case `uname -s` in 1.139 + SunOS) 1.140 + S_REL=`uname -r | sed -e "s/^[^\.]*\.//g"` 1.141 + if [ `uname -p` = "i386" ] ; then 1.142 + MAPPED_OS=Solaris8_x86 1.143 + elif [ "$S_REL" -lt 8 ] ; then 1.144 + MAPPED_OS=Solaris2.6 1.145 + else 1.146 + MAPPED_OS=Solaris8_forte6 1.147 + fi 1.148 + ;; 1.149 + OSF1) 1.150 + MAPPED_OS=OSF1V4.0 1.151 + ;; 1.152 + Darwin) 1.153 + MAPPED_OS=Darwin6.5 1.154 + ;; 1.155 + AIX) 1.156 + MAPPED_OS=AIX4.3 1.157 + ;; 1.158 + Linux) 1.159 + RH_MR=`cat /etc/redhat-release | sed \ 1.160 + -e "s/Red Hat Linux release //" -e "s/ .*//g" \ 1.161 + -e "s/\..*//g"` 1.162 + 1.163 + if [ "$RH_MR" = "6" ] ; then 1.164 + MAPPED_OS=Linux2.2 1.165 + else 1.166 + MAPPED_OS=Linux2.4 1.167 + LD_ASSUME_KERNEL="2.2.5" 1.168 + export LD_ASSUME_KERNEL 1.169 + fi 1.170 + ;; 1.171 + HP-UX) 1.172 + MAPPED_OS=HPUX11.00 1.173 + ;; 1.174 + *) 1.175 + if [ "$os_name" = "Windows" ] 1.176 + then 1.177 + MAPPED_OS=NT4.0 1.178 + else 1.179 + Exit "Sorry, operating system `uname -s` is not supported yet" 1.180 + fi 1.181 + ;; 1.182 + esac 1.183 + set_osdir 1.184 + Debug "Mapped OS to $MAPPED_OS" 1.185 +} 1.186 + 1.187 +############################# nssqa_main ############################### 1.188 +# local shell function main controlling function of the nss qa 1.189 +######################################################################## 1.190 +nssqa_main() 1.191 +{ 1.192 + Debug "In function nssqa_main" 1.193 + 1.194 + if [ $O_WIN = "OFF" -a "$O_TBX" = "OFF" -a $O_LOCAL = "OFF" ] ; then 1.195 + if [ ! -h ${NTDIST}/WINNT5.0_DBG.OBJ -o \ 1.196 + ! -h ${UXDIST}/SunOS5.8_OPT.OBJ -o \ 1.197 + ! -h ${UXDIST}/OSF1V5.0_DBG.OBJ ] ; then 1.198 + # determine if all needed symbolic links are present, in case 1.199 + # we build on one platform and QA on another 1.200 + # create the symbolic links 1.201 + #mksymlinks $* || 1.202 + `dirname $0`/mksymlinks $NSSVER $BUILDDATE || 1.203 + Warning "Can't make the neccessary symbolic links" 1.204 + fi 1.205 + fi 1.206 + 1.207 + if [ -d $TESTSCRIPTDIR ] #the directory mozilla/security/nss/tests, 1.208 + then # where all.sh lives 1.209 + cd $TESTSCRIPTDIR 1.210 + else 1.211 + Exit "cant cd to $TESTSCRIPTDIR Exiting" 1.212 + fi 1.213 + 1.214 + Debug "Testing from `pwd`" 1.215 + line 1.216 + Debug "HOST: $HOST, DOMSUF: $DOMSUF" 1.217 + 1.218 + if [ "$O_TBX" = "OFF" ] ; then 1.219 + map_os32 # From the operatingsystem figure out the name of the build 1.220 + Debug Testing build for $MAPPED_OS in $OSDIR 1.221 + wait_for_build 1.222 + fi 1.223 + run_all 1.224 + BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT" 1.225 + run_all 1.226 + 1.227 + # now for the 64 bit build! 1.228 + map_os64 # From the operatingsystem figure out the name of the build 1.229 + if [ -n "$IS_64" ] ; then #Wait for the 64 bit build to finish... 1.230 + Debug "This is a $IS_64 platform" 1.231 + USE_64=1;export USE_64;Debug "Use_64 set to $USE_64" 1.232 + unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT" 1.233 + 1.234 + run_all 1.235 + BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT" 1.236 + run_all 1.237 + elif [ "$O_WIN" = "ON" ] ; then 1.238 + OS_TARGET=WIN95;export OS_TARGET 1.239 + Debug "OS_TARGET set to $OS_TARGET" 1.240 + #Echo "WINDOWS-OS-LINE: $os_name $os_full $OS_TARGET" 1.241 + unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT" 1.242 + #if [ "$TEST_LEVEL" = "0" ] ; then 1.243 + #QA_OS_NAME=`cd ${TESTSCRIPTDIR}/common; gmake objdir_name | \ 1.244 + #sed -e "s/WINNT4.0.*/Windows-NT-4.0/" -e \ 1.245 + #"s/WINNT5.0.*/Windows-2000/"` 1.246 + #Echo "WINDOWS-OS-LINE: $QA_OS_NAME $OS_TARGET" 1.247 + #fi 1.248 + run_all 1.249 + BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT" 1.250 + run_all 1.251 + else 1.252 + Debug "This is a 32 bit platform" 1.253 + fi 1.254 +} 1.255 + 1.256 +TEST_LEVEL=0 1.257 + 1.258 +while [ $TEST_LEVEL -lt 2 ] ; do 1.259 + export TEST_LEVEL 1.260 + unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT" 1.261 + unset USE_64;export USE_64;Debug "USE_64 $USE_64" 1.262 + bc $TEST_LEVEL 1.263 + Debug "About to start nssqa_main" 1.264 + if [ $O_FILE = ON -a "$O_WIN" != "ON" ] ; then 1.265 + nssqa_main 2>>$FILENAME 1.266 + else 1.267 + nssqa_main 1.268 + fi 1.269 + if [ "$O_TBX" = "ON" ] ; then # do not do backward compatibility 1.270 + TEST_LEVEL=3 # testing on tinderbox 1.271 + else 1.272 + TEST_LEVEL=`expr $TEST_LEVEL + 1 ` 1.273 + fi 1.274 +done 1.275 + 1.276 +if [ "$O_TBX" = "ON" -o "$O_LOCAL" = "ON" ] ; then 1.277 +#FIXME - maybe it should be copied back to the networkdrive later (-ln) 1.278 + if [ -n "${TMPFILES}" ] ; then #caused problems on tinderbox machines 1.279 + Debug "rm -f ${TMPFILES}" 1.280 + rm -f $TMPFILES 2>/dev/null 1.281 + fi 1.282 + Debug "running qa_stat" 1.283 + . `dirname $0`/qa_stat 1.284 +fi 1.285 + 1.286 + 1.287 +qa_stat_get_sysinfo 1.288 + 1.289 +Exit "nssqa completed. Done `uname -n` $QA_OS_STRING"