6112N/A#
6112N/A# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
6112N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6112N/A#
6112N/A# This code is free software; you can redistribute it and/or modify it
6112N/A# under the terms of the GNU General Public License version 2 only, as
6112N/A# published by the Free Software Foundation.
6112N/A#
6112N/A# This code is distributed in the hope that it will be useful, but WITHOUT
6112N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6112N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6112N/A# version 2 for more details (a copy is included in the LICENSE file that
6112N/A# accompanied this code).
6112N/A#
6112N/A# You should have received a copy of the GNU General Public License version
6112N/A# 2 along with this work; if not, write to the Free Software Foundation,
6112N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6112N/A#
6112N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6112N/A# or visit www.oracle.com if you need additional information or have any
6112N/A# questions.
6112N/A#
6112N/A
6112N/A# @test
6112N/A# @bug 8014196
6112N/A# @summary ktab creates a file with zero kt_vno
6112N/A# @run shell ktzero.sh
6112N/A#
6112N/A
6112N/Aif [ "${TESTJAVA}" = "" ] ; then
6112N/A JAVAC_CMD=`which javac`
6112N/A TESTJAVA=`dirname $JAVAC_CMD`/..
6112N/Afi
6112N/A
6112N/Aif [ "${TESTSRC}" = "" ] ; then
6112N/A TESTSRC="."
6112N/Afi
6112N/A
6112N/AOS=`uname -s`
6112N/Acase "$OS" in
6112N/A CYGWIN* )
6112N/A FS="/"
6112N/A ;;
6112N/A Windows_* )
6112N/A FS="\\"
6112N/A ;;
6112N/A * )
6112N/A FS="/"
6112N/A echo "Unsupported system!"
6112N/A exit 0;
6112N/A ;;
6112N/Aesac
6112N/A
6112N/AKEYTAB=ktzero.tmp
6112N/A
6112N/Arm $KEYTAB 2> /dev/null
6112N/AKTAB="${TESTJAVA}${FS}bin${FS}ktab -k $KEYTAB"
6112N/A
6112N/A# Listing non-existing ktab should fail
6112N/A$KTAB -l && exit 1
6112N/A
6112N/A# Can add to non-existing ktab
6112N/A$KTAB -a me@LOCAL mine || exit 2
6112N/A
6112N/A# Now can be listed
6112N/A$KTAB -l || exit 3
6112N/A
6112N/Aecho ABCDEFG > $KEYTAB
6112N/A
6112N/A# Invalid keytab should fail for all commands
6112N/A$KTAB -l && exit 4
6112N/A$KTAB -a me@LOCAL mine && exit 2
6112N/A
6112N/Aexit 0