autotest.sh revision 321
418N/A#
418N/A# Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
605N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
418N/A#
1063N/A# This code is free software; you can redistribute it and/or modify it
418N/A# under the terms of the GNU General Public License version 2 only, as
418N/A# published by the Free Software Foundation.
919N/A#
919N/A# This code is distributed in the hope that it will be useful, but WITHOUT
919N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
919N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
919N/A# version 2 for more details (a copy is included in the LICENSE file that
919N/A# accompanied this code).
919N/A#
919N/A# You should have received a copy of the GNU General Public License version
919N/A# 2 along with this work; if not, write to the Free Software Foundation,
919N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
919N/A#
919N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
919N/A# CA 95054 USA or visit www.sun.com if you need additional information or
919N/A# have any questions.
919N/A#
919N/A
919N/A# @test
418N/A# @summary (almost) all keytool behaviors
418N/A# @author Weijun Wang
418N/A#
418N/A# set a few environment variables so that the shell-script can run stand-alone
493N/A# in the source directory
418N/Aif [ "${TESTSRC}" = "" ] ; then
970N/A TESTSRC="."
970N/Afi
970N/Aif [ "${TESTCLASSES}" = "" ] ; then
970N/A TESTCLASSES="."
1143N/Afi
1143N/Aif [ "${TESTJAVA}" = "" ] ; then
1143N/A echo "TESTJAVA not set. Test cannot execute."
1143N/A echo "FAILED!!!"
970N/A exit 1
970N/Afi
970N/A
970N/A# set platform-dependent variables
970N/AOS=`uname -s`
970N/Acase "$OS" in
970N/A SunOS )
970N/A FS="/"
970N/A LIBNAME=libsoftokn3.so
418N/A ARCH=`isainfo`
1167N/A case "$ARCH" in
418N/A sparc* )
911N/A PF="solaris-sparc"
1167N/A ;;
1167N/A * )
911N/A echo "Will not run test on: Solaris ${ARCH}"
418N/A exit 0;
553N/A ;;
418N/A esac
553N/A ;;
553N/A Linux )
553N/A LIBNAME=libsoftokn3.so
553N/A ARCH=`uname -m`
418N/A FS="/"
418N/A case "$ARCH" in
1225N/A i[3-6]86 )
1231N/A PF="linux-i586"
418N/A ;;
418N/A * )
1143N/A echo "Will not run test on: Linux ${ARCH}"
493N/A exit 0;
418N/A ;;
1143N/A esac
1143N/A ;;
1143N/A * )
1143N/A echo "Will not run test on: ${OS}"
1143N/A exit 0;
1143N/A ;;
1143N/Aesac
1143N/A
1143N/A${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}KeyToolTest.java || exit 10
1143N/A
1143N/ANSS=${TESTSRC}${FS}..${FS}..${FS}pkcs11${FS}nss
418N/A
418N/Acp ${TESTSRC}${FS}p11-nss.txt .
851N/Acp ${NSS}${FS}db${FS}cert8.db .
418N/Acp ${NSS}${FS}db${FS}key3.db .
851N/Acp ${NSS}${FS}db${FS}secmod.db .
418N/A
1196N/Achmod u+w key3.db
1196N/Achmod u+w cert8.db
1196N/A
1196N/Aecho | ${TESTJAVA}${FS}bin${FS}java -Dfile -Dnss \
1196N/A -Dnss.lib=${NSS}${FS}lib${FS}${PF}${FS}${LIBNAME} \
418N/A KeyToolTest
493N/Astatus=$?
418N/A
857N/Arm -f p11-nss.txt
851N/Arm -f cert8.db
851N/Arm -f key3.db
672N/Arm -f secmod.db
418N/A
857N/Arm HumanInputStream*.class
857N/Arm KeyToolTest.class
857N/Arm TestException.class
857N/A
857N/Aexit $status
857N/A
857N/A