~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/security/nss/tests/nssqa

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
        OSF1)
 
147
            MAPPED_OS=OSF1V4.0
 
148
            ;;
 
149
        Darwin)
 
150
            MAPPED_OS=Darwin6.5
 
151
            ;;  
 
152
        AIX)
 
153
            MAPPED_OS=AIX4.3
 
154
            ;;
 
155
        Linux)
 
156
            RH_MR=`cat /etc/redhat-release | sed \
 
157
                -e "s/Red Hat Linux release //" -e "s/ .*//g" \
 
158
                -e "s/\..*//g"`
 
159
            
 
160
            if [ "$RH_MR" = "6" ] ; then
 
161
                MAPPED_OS=Linux2.2
 
162
            else
 
163
                MAPPED_OS=Linux2.4
 
164
                LD_ASSUME_KERNEL="2.2.5"
 
165
                export LD_ASSUME_KERNEL
 
166
            fi
 
167
            ;;
 
168
        HP-UX)
 
169
            MAPPED_OS=HPUX11.00
 
170
            ;;
 
171
        *)
 
172
            if [ "$os_name" = "Windows" ]
 
173
            then
 
174
                MAPPED_OS=NT4.0
 
175
            else
 
176
                Exit "Sorry, operating system `uname -s` is not supported yet"
 
177
            fi
 
178
            ;;
 
179
    esac
 
180
    set_osdir
 
181
    Debug "Mapped OS to $MAPPED_OS"
 
182
}
 
183
 
 
184
############################# nssqa_main ###############################
 
185
# local shell function main controlling function of the nss qa
 
186
########################################################################
 
187
nssqa_main()
 
188
{
 
189
  Debug "In function nssqa_main"
 
190
 
 
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
 
198
          #mksymlinks $* ||
 
199
          `dirname $0`/mksymlinks  $NSSVER $BUILDDATE ||
 
200
              Warning "Can't make the neccessary symbolic links"
 
201
      fi
 
202
  fi
 
203
 
 
204
  if [ -d $TESTSCRIPTDIR ]    #the directory mozilla/security/nss/tests, 
 
205
  then            # where all.sh lives
 
206
      cd $TESTSCRIPTDIR
 
207
  else
 
208
      Exit "cant cd to $TESTSCRIPTDIR Exiting"
 
209
  fi
 
210
 
 
211
  Debug "Testing from `pwd`"
 
212
  line
 
213
  Debug "HOST: $HOST, DOMSUF: $DOMSUF"
 
214
 
 
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
 
218
      wait_for_build
 
219
  fi
 
220
  run_all
 
221
  BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT"
 
222
  run_all
 
223
  
 
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"
 
230
 
 
231
      run_all
 
232
      BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT"
 
233
      run_all
 
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"
 
244
      #fi
 
245
      run_all
 
246
      BUILD_OPT=1; export BUILD_OPT; Debug "BUILD_OPT $BUILD_OPT"
 
247
      run_all
 
248
  else
 
249
      Debug "This is a 32 bit platform"
 
250
  fi
 
251
}
 
252
  
 
253
TEST_LEVEL=0
 
254
 
 
255
while [ $TEST_LEVEL -lt 2 ] ; do 
 
256
    export TEST_LEVEL
 
257
    unset BUILD_OPT;export BUILD_OPT;Debug "BUILD_OPT $BUILD_OPT"
 
258
    unset USE_64;export USE_64;Debug "USE_64 $USE_64"
 
259
    bc $TEST_LEVEL
 
260
    Debug "About to start nssqa_main"
 
261
    if [ $O_FILE = ON -a "$O_WIN" != "ON" ] ; then
 
262
        nssqa_main 2>>$FILENAME
 
263
    else
 
264
        nssqa_main
 
265
    fi
 
266
    if [  "$O_TBX" = "ON" ] ; then      # do not do backward compatibility 
 
267
         TEST_LEVEL=3                   # testing on tinderbox
 
268
    else
 
269
         TEST_LEVEL=`expr $TEST_LEVEL + 1 `
 
270
    fi
 
271
done
 
272
 
 
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
 
278
    fi
 
279
    Debug "running qa_stat"
 
280
    . `dirname $0`/qa_stat
 
281
fi
 
282
 
 
283
  
 
284
qa_stat_get_sysinfo
 
285
 
 
286
Exit "nssqa completed. Done `uname -n` $QA_OS_STRING"