summaryrefslogtreecommitdiffstats
path: root/security/nss/tests/dbupgrade
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /security/nss/tests/dbupgrade
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'security/nss/tests/dbupgrade')
-rwxr-xr-xsecurity/nss/tests/dbupgrade/dbupgrade.sh106
1 files changed, 106 insertions, 0 deletions
diff --git a/security/nss/tests/dbupgrade/dbupgrade.sh b/security/nss/tests/dbupgrade/dbupgrade.sh
new file mode 100755
index 000000000..0302e6143
--- /dev/null
+++ b/security/nss/tests/dbupgrade/dbupgrade.sh
@@ -0,0 +1,106 @@
+#!/bin/sh
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+########################################################################
+#
+# mozilla/security/nss/tests/dbupgrade/dbupgrade.sh
+#
+# Script to upgrade databases to Shared DB
+#
+# needs to work on all Unix and Windows platforms
+#
+# special strings
+# ---------------
+# FIXME ... known problems, search for this string
+# NOTE .... unexpected behavior
+#
+########################################################################
+
+############################ dbupgrade_init ############################
+# local shell function to initialize this script
+########################################################################
+dbupgrade_init()
+{
+ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
+ cd ${QADIR}/common
+ . ./init.sh
+ fi
+
+ if [ ! -r "${CERT_LOG_FILE}" ]; then # we need certificates here
+ cd ${QADIR}/cert
+ . ./cert.sh
+ fi
+
+ if [ ! -d ${HOSTDIR}/SDR ]; then # we also need sdr as well
+ cd ${QADIR}/sdr
+ . ./sdr.sh
+ fi
+
+ SCRIPTNAME=dbupgrade.sh
+ if [ -z "${CLEANUP}" ] ; then # if nobody else is responsible for
+ CLEANUP="${SCRIPTNAME}" # cleaning this script will do it
+ fi
+
+ echo "$SCRIPTNAME: DB upgrade tests ==============================="
+}
+
+############################ dbupgrade_main ############################
+# local shell function to upgrade certificate databases
+########################################################################
+dbupgrade_main()
+{
+ # 'reset' the databases to initial values
+ echo "Reset databases to their initial values:"
+ cd ${HOSTDIR}
+ ${BINDIR}/certutil -D -n objsigner -d alicedir 2>&1
+ ${BINDIR}/certutil -M -n FIPS_PUB_140_Test_Certificate -t "C,C,C" -d fips -f ${FIPSPWFILE} 2>&1
+ ${BINDIR}/certutil -L -d fips 2>&1
+ rm -f smime/alicehello.env
+
+ # test upgrade to the new database
+ echo "nss" > ${PWFILE}
+ html_head "Legacy to shared Library update"
+ dirs="alicedir bobdir CA cert_extensions client clientCA dave eccurves eve ext_client ext_server SDR server serverCA ssl_gtests stapling tools/copydir"
+ for i in $dirs
+ do
+ echo $i
+ if [ -d $i ]; then
+ echo "upgrading db $i"
+ ${BINDIR}/certutil -G -g 512 -d sql:$i -f ${PWFILE} -z ${NOISE_FILE} 2>&1
+ html_msg $? 0 "Upgrading $i"
+ else
+ echo "skipping db $i"
+ html_msg 0 0 "No directory $i"
+ fi
+ done
+
+ if [ -d fips ]; then
+ echo "upgrading db fips"
+ ${BINDIR}/certutil -S -g 1024 -n tmprsa -t "u,u,u" -s "CN=tmprsa, C=US" -x -d sql:fips -f ${FIPSPWFILE} -z ${NOISE_FILE} 2>&1
+ html_msg $? 0 "Upgrading fips"
+ # remove our temp certificate we created in the fist token
+ ${BINDIR}/certutil -F -n tmprsa -d sql:fips -f ${FIPSPWFILE} 2>&1
+ ${BINDIR}/certutil -L -d sql:fips 2>&1
+ fi
+
+ html "</TABLE><BR>"
+}
+
+########################## dbupgrade_cleanup ###########################
+# local shell function to finish this script (no exit since it might be
+# sourced)
+########################################################################
+dbupgrade_cleanup()
+{
+ cd ${QADIR}
+ . common/cleanup.sh
+}
+
+################################# main #################################
+
+dbupgrade_init
+dbupgrade_main
+dbupgrade_cleanup