From 774edd476263aeed8eb6ac4632081dabffac6733 Mon Sep 17 00:00:00 2001 From: "julien.pierre.boogz%sun.com" Date: Wed, 14 Nov 2007 22:40:23 +0000 Subject: [PATCH] Fix for bug 401792 . Restore support for cygwin in all.sh . r=slavo, alexei:wq git-svn-id: svn://10.0.0.236/trunk@239393 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/security/nss/tests/cert/cert.sh | 17 ++++++++++++ .../security/nss/tests/cipher/performance.sh | 3 +++ mozilla/security/nss/tests/common/init.sh | 27 +++++++++++++++---- mozilla/security/nss/tests/fips/fips.sh | 4 +++ mozilla/security/nss/tests/iopr/cert_iopr.sh | 3 +++ 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/mozilla/security/nss/tests/cert/cert.sh b/mozilla/security/nss/tests/cert/cert.sh index 433bfa534ed..42f860a929d 100755 --- a/mozilla/security/nss/tests/cert/cert.sh +++ b/mozilla/security/nss/tests/cert/cert.sh @@ -97,6 +97,11 @@ cert_init() html_passed "Looking for root certs module." fi + if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then + ROOTCERTSFILE=`cygpath -m ${ROOTCERTSFILE}` + fi + + ################## Generate noise for our CA cert. ###################### # NOTE: these keys are only suitable for testing, as this whole thing # bypasses the entropy gathering. Don't use this method to generate @@ -220,6 +225,9 @@ cert_init_cert() CERTDIR="." PROFILEDIR=`cd ${CERTDIR}; pwd` + if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then + PROFILEDIR=`cygpath -m ${PROFILEDIR}` + fi if [ -n "${MULTIACCESS_DBM}" ]; then PROFILEDIR="multiaccess:${DOMAIN}" fi @@ -490,6 +498,9 @@ cert_CA() pwd LPROFILE=`pwd` + if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then + LPROFILE=`cygpath -m ${LPROFILE}` + fi if [ -n "${MULTIACCESS_DBM}" ]; then LPROFILE="multiaccess:${DOMAIN}" fi @@ -952,6 +963,9 @@ cert_stresscerts() cd "${CERTDIR}" PROFILEDIR=`cd ${CERTDIR}; pwd` + if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then + PROFILEDIR=`cygpath -m ${PROFILEDIR}` + fi if [ -n "${MULTIACCESS_DBM}" ]; then PROFILEDIR="multiaccess:${D_CLIENT}" fi @@ -1170,6 +1184,9 @@ cert_crl_ssl() cd $CADIR PROFILEDIR=`cd ${CLIENTDIR}; pwd` + if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then + PROFILEDIR=`cygpath -m ${PROFILEDIR}` + fi CRL_GRPS_END=`expr ${CRL_GRP_1_BEGIN} + ${TOTAL_CRL_RANGE} - 1` echo "$SCRIPTNAME: Creating Client CA Issued Certificates Range $CRL_GRP_1_BEGIN - $CRL_GRPS_END ===" CU_ACTION="Creating client test certs" diff --git a/mozilla/security/nss/tests/cipher/performance.sh b/mozilla/security/nss/tests/cipher/performance.sh index 0ac211da5e2..01c2b6b58c8 100755 --- a/mozilla/security/nss/tests/cipher/performance.sh +++ b/mozilla/security/nss/tests/cipher/performance.sh @@ -5,6 +5,9 @@ # . ../common/init.sh CURDIR=`pwd` +if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then + CURDIR=`cygpath -m ${CURDIR}` +fi CIPHERDIR=${HOSTDIR}/cipher SKTESTS=${CURDIR}/symmkey.txt diff --git a/mozilla/security/nss/tests/common/init.sh b/mozilla/security/nss/tests/common/init.sh index 8b0cde8b9ca..1806dda77b7 100644 --- a/mozilla/security/nss/tests/common/init.sh +++ b/mozilla/security/nss/tests/common/init.sh @@ -257,14 +257,23 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then COMMON=${TEST_COMMON-$common} export COMMON + MAKE=`which gmake` + if [ -z "$MAKE" ]; then + MAKE=`which make` + fi + if [ -z "$MAKE" ]; then + You are missing make. + exit 5 + fi + DIST=${DIST-${MOZILLA_ROOT}/dist} SECURITY_ROOT=${SECURITY_ROOT-${MOZILLA_ROOT}/security/nss} TESTDIR=${TESTDIR-${MOZILLA_ROOT}/tests_results/security} - OBJDIR=`(cd $COMMON; gmake objdir_name)` - OS_ARCH=`(cd $COMMON; gmake os_arch)` - DLL_PREFIX=`(cd $COMMON; gmake dll_prefix)` - DLL_SUFFIX=`(cd $COMMON; gmake dll_suffix)` - OS_NAME=`uname -s | sed -e "s/-[0-9]*\.[0-9]*//"` + OBJDIR=`(cd $COMMON; $MAKE objdir_name)` + OS_ARCH=`(cd $COMMON; $MAKE os_arch)` + DLL_PREFIX=`(cd $COMMON; $MAKE dll_prefix)` + DLL_SUFFIX=`(cd $COMMON; $MAKE dll_suffix)` + OS_NAME=`uname -s | sed -e "s/-[0-9]*\.[0-9]*//" | sed -e "s/-WOW64//"` # Pathnames constructed from ${TESTDIR} are passed to NSS tools # such as certutil, which don't understand Cygwin pathnames. @@ -272,6 +281,14 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then # regular slashes). if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then TESTDIR=`cygpath -m ${TESTDIR}` + QADIR=`cygpath -m ${QADIR}` + fi + + # Same problem with MSYS/Mingw, except we need to start over with pwd -W + if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "MINGW32_NT" ]; then + mingw_mozilla_root=`(cd ../../../..; pwd -W)` + MINGW_MOZILLA_ROOT=${MINGW_MOZILLA_ROOT-$mingw_mozilla_root} + TESTDIR=${MINGW_TESTDIR-${MINGW_MOZILLA_ROOT}/tests_results/security} fi # Same problem with MSYS/Mingw, except we need to start over with pwd -W diff --git a/mozilla/security/nss/tests/fips/fips.sh b/mozilla/security/nss/tests/fips/fips.sh index 004cb5ace2f..7d74a99ea98 100755 --- a/mozilla/security/nss/tests/fips/fips.sh +++ b/mozilla/security/nss/tests/fips/fips.sh @@ -269,6 +269,10 @@ fips_140() if [ $? -eq 0 ]; then if [ "${OS_ARCH}" = "WINNT" ]; then DBTEST=`which dbtest` + if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then + DBTEST=`cygpath -m ${DBTEST}` + MANGLEDIR=`cygpath -u ${MANGLEDIR}` + fi echo "PATH=${MANGLEDIR} ${DBTEST} -r -d ${P_R_FIPSDIR}" PATH="${MANGLEDIR}" ${DBTEST} -r -d ${P_R_FIPSDIR} > ${TMP}/dbtestoutput.txt 2>&1 RESULT=$? diff --git a/mozilla/security/nss/tests/iopr/cert_iopr.sh b/mozilla/security/nss/tests/iopr/cert_iopr.sh index 9ff9b06a42f..e43d04ee976 100644 --- a/mozilla/security/nss/tests/iopr/cert_iopr.sh +++ b/mozilla/security/nss/tests/iopr/cert_iopr.sh @@ -80,6 +80,9 @@ createDBDir() { if [ -z "`ls $trgDir | grep db`" ]; then trgDir=`cd ${trgDir}; pwd` + if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" = "CYGWIN_NT" ]; then + trgDir=`cygpath -m ${trgDir}` + fi CU_ACTION="Initializing DB at ${trgDir}" certu -N -d "${trgDir}" -f "${R_PWFILE}" 2>&1