~ubuntu-branches/ubuntu/raring/nss/raring-security

« back to all changes in this revision

Viewing changes to mozilla/security/nss/coverage/cov.sh

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-03-25 13:46:06 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100325134606-bl6liuok2w9l7snv
Tags: 3.12.6-0ubuntu1
* New upstream release 3.12.6 RTM (NSS_3_12_6_RTM)
  - fixes CVE-2009-3555 aka US-CERT VU#120541
* Adjust patches to changed upstream code base
  - update debian/patches/38_kbsd.patch
  - update debian/patches/38_mips64_build.patch
  - update debian/patches/85_security_load.patch
* Remove patches that are merged upstream
  - delete debian/patches/91_nonexec_stack.patch
  - update debian/patches/series
* Bump nspr dependency to 4.8
  - update debian/control
* Add new symbols for 3.12.6
  - update debian/libnss3-1d.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
# ***** BEGIN LICENSE BLOCK *****
 
4
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
5
#
 
6
# The contents of this file are subject to the Mozilla Public License Version
 
7
# 1.1 (the "License"); you may not use this file except in compliance with 
 
8
# the License. You may obtain a copy of the License at
 
9
# http://www.mozilla.org/MPL/
 
10
#
 
11
# Software distributed under the License is distributed on an "AS IS" basis, 
 
12
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
 
13
# for the specific language governing rights and limitations under the 
 
14
# License.
 
15
#
 
16
# The Original Code is the Network Security Services
 
17
#
 
18
# The Initial Developer of the Original Code is Sun Microsystems, Inc.
 
19
# Portions created by the Initial Developer are Copyright (C) 2007-2009
 
20
# Sun Microsystems, Inc. All Rights Reserved.
 
21
#
 
22
# Contributor(s):
 
23
#   Slavomir Katuscak <slavomir.katuscak@sun.com>, Sun Microsystems, Inc.
 
24
#
 
25
# Alternatively, the contents of this file may be used under the terms of
 
26
# either the GNU General Public License Version 2 or later (the "GPL"), or
 
27
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
28
# in which case the provisions of the GPL or the LGPL are applicable instead
 
29
# of those above. If you wish to allow use of your version of this file only
 
30
# under the terms of either the GPL or the LGPL, and not to allow others to
 
31
# use your version of this file under the terms of the MPL, indicate your
 
32
# decision by deleting the provisions above and replace them with the notice
 
33
# and other provisions required by the GPL or the LGPL. If you do not delete
 
34
# the provisions above, a recipient may use your version of this file under
 
35
# the terms of any one of the MPL, the GPL or the LGPL.
 
36
#
 
37
# ***** END LICENSE BLOCK *****
 
38
 
 
39
OS=`uname -s`
 
40
ARCH=`uname -p`
 
41
SCRIPT_DIR=`pwd`
 
42
DATE=`date +%Y%m%d`
 
43
 
 
44
if [ $# -ne 1 ]; then
 
45
    echo "Usage: $0 [securitytip|securityjes5]"
 
46
    exit 1
 
47
fi
 
48
 
 
49
BRANCH="$1"
 
50
 
 
51
if [ "${BRANCH}" != "securitytip" -a "${BRANCH}" != "securityjes5" ]; then
 
52
    echo "Usage: $0 [securitytip|securityjes5]"
 
53
    exit 1
 
54
fi
 
55
 
 
56
COV_DIR="/share/builds/mccrel3/security/coverage"
 
57
BRANCH_DIR="${COV_DIR}/${BRANCH}"
 
58
DATE_DIR="${BRANCH_DIR}/${DATE}-${ARCH}"
 
59
CVS_DIR="${DATE_DIR}/cvs_mozilla"
 
60
TCOV_DIR="${DATE_DIR}/tcov_mozilla"
 
61
 
 
62
CVS_CHECKOUT_BRANCH="cvs_checkout_${BRANCH}"
 
63
 
 
64
export HOST=`hostname`
 
65
export DOMSUF=red.iplanet.com
 
66
 
 
67
export NSS_ENABLE_ECC=1
 
68
export NSS_ECC_MORE_THAN_SUITE_B=1
 
69
export IOPR_HOSTADDR_LIST="dochinups.red.iplanet.com"
 
70
export NSS_AIA_PATH="/share/builds/mccrel3/security/aia_certs"
 
71
export NSS_AIA_HTTP="http://cindercone.red.iplanet.com/share/builds/mccrel3/security/aia_certs"
 
72
 
 
73
export USE_TCOV=1
 
74
export SUN_PROFDATA_DIR="${DATE_DIR}"
 
75
export SUN_PROFDATA="tcov_data"
 
76
 
 
77
if [ "${OS}" != "SunOS" ]; then
 
78
    echo "OS not supported"
 
79
    exit 1
 
80
fi
 
81
 
 
82
case "${ARCH}" in 
 
83
"sparc")
 
84
    export PATH="/usr/dist/share/sunstudio_sparc,v12.0/SUNWspro/prod/bin:/usr/sfw/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/tools/ns/bin:/usr/local/bin"
 
85
    ;;
 
86
"i386")
 
87
    export PATH="/usr/dist/share/sunstudio_i386,v12.0/SUNWspro/bin:/usr/sfw/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/tools/ns/bin:/usr/local/bin"
 
88
    ;;
 
89
*)
 
90
    echo "Platform not supported"
 
91
    exit 1
 
92
    ;;
 
93
esac
 
94
 
 
95
cvs_checkout_securitytip()
 
96
{
 
97
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/nsprpub
 
98
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/dbm
 
99
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/security/dbm
 
100
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/security/coreconf
 
101
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/security/nss
 
102
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/security/jss
 
103
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_1_RTM mozilla/security/nss/lib/freebl/ecl/ecl-curve.h
 
104
}
 
105
 
 
106
cvs_checkout_securityjes5()
 
107
{
 
108
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSPR_4_6_BRANCH mozilla/nsprpub
 
109
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_BRANCH mozilla/dbm
 
110
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_BRANCH mozilla/security/dbm
 
111
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_BRANCH mozilla/security/coreconf
 
112
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_BRANCH mozilla/security/nss
 
113
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r JSS_4_2_BRANCH mozilla/security/jss
 
114
    cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_1_RTM mozilla/security/nss/lib/freebl/ecl/ecl-curve.h
 
115
}
 
116
 
 
117
cvs_checkout()
 
118
{
 
119
    rm -rf "${DATE_DIR}"
 
120
    mkdir -p "${CVS_DIR}"
 
121
    cd "${CVS_DIR}"
 
122
 
 
123
    ${CVS_CHECKOUT_BRANCH}
 
124
}
 
125
 
 
126
run_build()
 
127
{
 
128
    cd "${CVS_DIR}/mozilla/security/nss"
 
129
    gmake nss_build_all
 
130
}
 
131
 
 
132
run_tests()
 
133
{
 
134
    cd "${CVS_DIR}/mozilla/security/nss/tests"
 
135
    ./all.sh
 
136
}
 
137
 
 
138
process_results()
 
139
{
 
140
    rm -rf "${TCOV_DIR}"
 
141
    mkdir -p "${TCOV_DIR}"
 
142
 
 
143
    cat "${SUN_PROFDATA_DIR}/${SUN_PROFDATA}/tcovd" | grep SRCFILE | grep "${CVS_DIR}/.*.c$" | sed "s:[^/]*\(.*\):\1:" | sort -u |
 
144
    while read line
 
145
    do
 
146
        DIR=`echo "${line}" | sed "s:${CVS_DIR}/\(.*\)/.*:\1:"`
 
147
        FILE=`echo "${line}" | sed "s:.*/\(.*\):\1:"`
 
148
 
 
149
        mkdir -p "${TCOV_DIR}/${DIR}"
 
150
        tcov -o "${TCOV_DIR}/${DIR}/$FILE" -x "${SUN_PROFDATA}" $line >/dev/null 2>&1
 
151
    done
 
152
}
 
153
 
 
154
cvs_checkout
 
155
run_build
 
156
run_tests
 
157
process_results
 
158
 
 
159
cd "${SCRIPT_DIR}"
 
160
./report.sh "${BRANCH}" "${DATE}" "${ARCH}"  
 
161
 
 
162
exit 0
 
163