~ubuntu-branches/ubuntu/intrepid/xulrunner-1.9/intrepid

« back to all changes in this revision

Viewing changes to mozilla/security/nss/tests/dbtests/dbtests.sh

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack, Alexander Sack, Fabien Tassin
  • Date: 2008-02-13 11:47:21 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080213114721-7om0mgzngvuk9czv
Tags: 1.9~b3+nobinonly-0ubuntu1
* release FIREFOX_3_0b3_RELEASE

[ Alexander Sack ]
* submit patch that ships xpcshell to bugzilla
  - rename debian/patches/ship_xpcshell.patch =>
           debian/patches/bz410617_att295212_ship_xpcshell.patch
  - update debian/patches/series
* fix tooltip in epiphany: previously displayed out of screen bounds
  (LP: #37507)
  - add debian/patches/bz233371_att297343_fix_outofscreen_embed_tooltip.patch
  - update debian/patches/series
* use default upstream gcc tweaks for improved performance - especially of the
  javascript engine
  - update debian/rules
* update global extension/plugin patch to apply cleanly against latest code
  - update debian/patches/bzXXX_gre_extension_plugin_support.patch
* fix pyxpcom build failure introduced by recent commit
  - add debian/patches/bzXXX_fix_pyxpcom_build_failure.patch
  - update debian/patches/series
* add distro independent global install locations for extensions,
  /usr/lib/mozilla/extensions and /usr/share/mozilla/extensions
  - update debian/xulrunner-1.9.dirs
* support embedded tarball layout when either there is a *.tar.bz2 in orig tarball
  or if DEBIAN_MOZCLIENT_EMBEDDED is not unset (you will need this to produce embedded
  tarballs during |get-orig-source|
  - update debian/rules
* bump minimum libnss3-dev build requirements to >= 3.12.0~1.9b3
  - update debian/control
* bump minimum libnspr4-dev build requirements to >= 4.7.0~1.9b3
  - update debian/control

[ Fabien Tassin ]
* Drop patches applied upstream
  - drop debian/patches/bz410617_att295212_ship_xpcshell.patch
  - drop debian/patches/bz404634_att294921.patch
  - drop debian/patches/bz386610_python2.5_ftbfs_amd64.patch
  - drop debian/patches/bz373918_att295042.patch
  - drop debian/patches/bz408062_unstable_pc.patch
  - drop debian/patches/bz384304_fix_recursive_symlinks.patch
  - update debian/patches/series
* Refresh diverged patches:
  - update debian/patches/bzXXX_pc_honour_system_nspr_nss.patch
  - update debian/patches/rename_venkman_addon.patch
  - update debian/patches/bz344818_cairo_xrender.patch
* Install links for all .so libs in the -dev package
  - update debian/patches/dont_install_so_in_dev.patch
* Bump gtk requirement to 2.12 as per Mozilla bug 412432
  - update debian/control
* Add #DEBHELPER# token to postinst/prerm scripts
  - update debian/xulrunner-1.9.{postinst,prerm}
* Install previously missed libdbusservice.so
  - update debian/xulrunner-1.9.install
* Update venkman patch to also rename locales
  - update debian/patches/rename_venkman_addon.patch
* Bump requirement for system cairo to >= 1.5.8 as we now need
  the newly added cairo_path_extents()
  - update debian/rules
* Include mozilla-devscripts file using -include so ifneq could be omitted
  - update debian/rules
* Fix missing .so symlinks regression
  - update debian/patches/dont_install_so_in_dev.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
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 Netscape security libraries.
17
 
#
18
 
# The Initial Developer of the Original Code is
19
 
# Netscape Communications Corporation.
20
 
# Portions created by the Initial Developer are Copyright (C) 1994-2000
21
 
# the Initial Developer. All Rights Reserved.
22
 
#
23
 
# Contributor(s):
24
 
#   Sonja Mirtitsch Sun Microsystems
25
 
#
26
 
# Alternatively, the contents of this file may be used under the terms of
27
 
# either the GNU General Public License Version 2 or later (the "GPL"), or
28
 
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
 
# in which case the provisions of the GPL or the LGPL are applicable instead
30
 
# of those above. If you wish to allow use of your version of this file only
31
 
# under the terms of either the GPL or the LGPL, and not to allow others to
32
 
# use your version of this file under the terms of the MPL, indicate your
33
 
# decision by deleting the provisions above and replace them with the notice
34
 
# and other provisions required by the GPL or the LGPL. If you do not delete
35
 
# the provisions above, a recipient may use your version of this file under
36
 
# the terms of any one of the MPL, the GPL or the LGPL.
37
 
#
38
 
# ***** END LICENSE BLOCK *****
39
 
 
40
 
########################################################################
41
 
#
42
 
# mozilla/security/nss/tests/dbtest/dbtest.sh
43
 
#
44
 
# Certificate generating and handeling for NSS QA, can be included 
45
 
# multiple times from all.sh and the individual scripts
46
 
#
47
 
# needs to work on all Unix and Windows platforms
48
 
#
49
 
# included from (don't expect this to be up to date)
50
 
# --------------------------------------------------
51
 
#   all.sh
52
 
#   ssl.sh
53
 
#   smime.sh
54
 
#   tools.sh
55
 
#
56
 
# special strings
57
 
# ---------------
58
 
#   FIXME ... known problems, search for this string
59
 
#   NOTE .... unexpected behavior
60
 
#
61
 
# FIXME - Netscape - NSS
62
 
########################################################################
63
 
 
64
 
############################## dbtest_init ###############################
65
 
# local shell function to initialize this script
66
 
########################################################################
67
 
dbtest_init()
68
 
{
69
 
  SCRIPTNAME="dbtests.sh"
70
 
  if [ -z "${CLEANUP}" ] ; then     # if nobody else is responsible for
71
 
      CLEANUP="${SCRIPTNAME}"       # cleaning this script will do it
72
 
  fi
73
 
  if [ -z "${INIT_SOURCED}" ] ; then
74
 
      cd ../common
75
 
      . ./init.sh
76
 
  fi
77
 
  if [ ! -r $CERT_LOG_FILE ]; then  # we need certificates here
78
 
      cd ../cert
79
 
      . ./cert.sh
80
 
  fi
81
 
 
82
 
  SCRIPTNAME="dbtests.sh"
83
 
  DBTEST_LOG=${HOSTDIR}/dbtest.log    #we don't want all the errormessages 
84
 
         # in the output.log, otherwise we can't tell what's a real error
85
 
  RONLY_DIR=${HOSTDIR}/ronlydir
86
 
  EMPTY_DIR=${HOSTDIR}/emptydir
87
 
 
88
 
  html_head "CERT and Key DB Tests"
89
 
 
90
 
}
91
 
 
92
 
############################## dbtest_cleanup ############################
93
 
# local shell function to finish this script (no exit since it might be
94
 
# sourced)
95
 
########################################################################
96
 
dbtest_cleanup()
97
 
{
98
 
  html "</TABLE><BR>" 
99
 
  cd ${QADIR}
100
 
  chmod a+rw $RONLY_DIR
101
 
  . common/cleanup.sh
102
 
}
103
 
 
104
 
Echo()
105
 
{
106
 
    echo
107
 
    echo "---------------------------------------------------------------"
108
 
    echo "| $*"
109
 
    echo "---------------------------------------------------------------"
110
 
}
111
 
dbtest_main()
112
 
{
113
 
    cd ${HOSTDIR}
114
 
 
115
 
    
116
 
    Echo "test opening the database read/write in a nonexisting directory"
117
 
    certutil -L -X -d ./non_existant_dir
118
 
    ret=$?
119
 
    if [ $ret -ne 255 ]; then
120
 
      html_failed "<TR><TD> Certutil succeeded in a nonexisting directory $ret"
121
 
    else
122
 
      html_passed "<TR><TD> Certutil didn't work in a nonexisting dir $ret" 
123
 
    fi
124
 
    dbtest -r -d ./non_existant_dir
125
 
    ret=$?
126
 
    if [ $ret -ne 46 ]; then
127
 
      html_failed "<TR><TD> Dbtest readonly succeeded in a nonexisting directory $ret"
128
 
    else
129
 
      html_passed "<TR><TD> Dbtest readonly didn't work in a nonexisting dir $ret" 
130
 
    fi
131
 
 
132
 
    Echo "test force opening the database in a nonexisting directory"
133
 
    dbtest -f -d ./non_existant_dir
134
 
    ret=$?
135
 
    if [ $ret -ne 0 ]; then
136
 
      html_failed "<TR><TD> Dbtest force failed in a nonexisting directory $ret"
137
 
    else
138
 
      html_passed "<TR><TD> Dbtest force succeeded in a nonexisting dir $ret"
139
 
    fi
140
 
 
141
 
    Echo "test opening the database readonly in an empty directory"
142
 
    mkdir $EMPTY_DIR
143
 
    tstclnt -h  ${HOST}  -d $EMPTY_DIR 
144
 
    ret=$?
145
 
    if [ $ret -ne 1 ]; then
146
 
      html_failed "<TR><TD> Tstclnt succeded in an empty directory $ret"
147
 
    else
148
 
      html_passed "<TR><TD> Tstclnt didn't work in an empty dir $ret"
149
 
    fi
150
 
    dbtest -r -d $EMPTY_DIR
151
 
    ret=$?
152
 
    if [ $ret -ne 46 ]; then
153
 
      html_failed "<TR><TD> Dbtest readonly succeeded in an empty directory $ret"
154
 
    else
155
 
      html_passed "<TR><TD> Dbtest readonly didn't work in an empty dir $ret" 
156
 
    fi
157
 
    rm -rf $EMPTY_DIR/* 2>/dev/null
158
 
    certutil -D -n xxxx -d $EMPTY_DIR #created DB
159
 
    ret=$?
160
 
    if [ $ret -ne 255 ]; then 
161
 
        html_failed "<TR><TD> Certutil succeeded in deleting a cert in an empty directory $ret"
162
 
    else
163
 
        html_passed "<TR><TD> Certutil didn't work in an empty dir $ret"
164
 
    fi
165
 
    rm -rf $EMPTY_DIR/* 2>/dev/null
166
 
    Echo "test force opening the database  readonly in a empty directory"
167
 
    dbtest -r -f -d $EMPTY_DIR
168
 
    ret=$?
169
 
    if [ $ret -ne 0 ]; then
170
 
      html_failed "<TR><TD> Dbtest force readonly failed in an empty directory $ret"
171
 
    else
172
 
      html_passed "<TR><TD> Dbtest force readonly succeeded in an empty dir $ret"
173
 
    fi
174
 
 
175
 
    Echo "test opening the database r/w in a readonly directory"
176
 
    mkdir $RONLY_DIR
177
 
    cp -r ${CLIENTDIR}/* $RONLY_DIR
178
 
    chmod -w $RONLY_DIR $RONLY_DIR/*
179
 
 
180
 
    # On Mac OS X 10.1, if we do a "chmod -w" on files in an
181
 
    # NFS-mounted directory, it takes several seconds for the
182
 
    # first open to see the files are readonly, but subsequent
183
 
    # opens immediately see the files are readonly.  As a
184
 
    # workaround we open the files once first.  (Bug 185074)
185
 
    if [ "${OS_ARCH}" = "Darwin" ]; then
186
 
        cat $RONLY_DIR/* > /dev/null
187
 
    fi
188
 
 
189
 
    dbtest -d $RONLY_DIR
190
 
    ret=$?
191
 
    if [ $ret -ne 46 ]; then
192
 
      html_failed "<TR><TD> Dbtest r/w succeeded in an readonly directory $ret"
193
 
    else
194
 
      html_passed "<TR><TD> Dbtest r/w didn't work in an readonly dir $ret" 
195
 
    fi
196
 
    certutil -D -n "TestUser" -d .
197
 
    ret=$?
198
 
    if [ $ret -ne 255 ]; then
199
 
      html_failed "<TR><TD> Certutil succeeded in deleting a cert in an readonly directory $ret"
200
 
    else
201
 
        html_passed "<TR><TD> Certutil didn't work in an readonly dir $ret"
202
 
    fi
203
 
    
204
 
    Echo "test opening the database ronly in a readonly directory"
205
 
 
206
 
    dbtest -d $RONLY_DIR -r
207
 
    ret=$?
208
 
    if [ $ret -ne 0 ]; then
209
 
      html_failed "<TR><TD> Dbtest readonly failed in a readonly directory $ret"
210
 
    else
211
 
      html_passed "<TR><TD> Dbtest readonly succeeded in a readonly dir $ret" 
212
 
    fi
213
 
 
214
 
    Echo "test force opening the database  r/w in a readonly directory"
215
 
    dbtest -d $RONLY_DIR -f
216
 
    ret=$?
217
 
    if [ $ret -ne 0 ]; then
218
 
      html_failed "<TR><TD> Dbtest force failed in a readonly directory $ret"
219
 
    else
220
 
      html_passed "<TR><TD> Dbtest force succeeded in a readonly dir $ret"
221
 
    fi
222
 
 
223
 
    Echo "ls -l $RONLY_DIR"
224
 
    ls -ld $RONLY_DIR $RONLY_DIR/*
225
 
 
226
 
}
227
 
 
228
 
################## main #################################################
229
 
 
230
 
dbtest_init 
231
 
dbtest_main >$DBTEST_LOG 2>&1
232
 
dbtest_cleanup