jdk/test/sun/security/krb5/tools/ktcheck.sh
author weijun
Thu, 28 Oct 2010 21:14:44 +0800
changeset 7037 9fd3887c8010
child 14786 a9f61e0cbe61
permissions -rw-r--r--
6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]" 6984764: kerberos fails if service side keytab is generated using JDK ktab Reviewed-by: valeriep
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7037
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
     1
#
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
     2
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
     4
#
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
     7
# published by the Free Software Foundation.
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
     8
#
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    13
# accompanied this code).
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    14
#
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    18
#
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    21
# questions.
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    22
#
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    23
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    24
# @test
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    25
# @bug 6950546
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    26
# @summary "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    27
# @run shell ktcheck.sh
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    28
#
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    29
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    30
if [ "${TESTJAVA}" = "" ] ; then
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    31
  JAVAC_CMD=`which javac`
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    32
  TESTJAVA=`dirname $JAVAC_CMD`/..
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    33
fi
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    34
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    35
if [ "${TESTSRC}" = "" ] ; then
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    36
  TESTSRC="."
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    37
fi
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    38
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    39
OS=`uname -s`
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    40
case "$OS" in
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    41
  CYGWIN* )
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    42
    FS="/"
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    43
    ;;
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    44
  Windows_* )
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    45
    FS="\\"
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    46
    ;;
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    47
  * )
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    48
    FS="/"
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    49
    echo "Unsupported system!"
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    50
    exit 0;
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    51
    ;;
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    52
esac
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    53
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    54
KEYTAB=ktab.tmp
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    55
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    56
rm $KEYTAB
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    57
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}KtabCheck.java
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    58
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    59
EXTRA_OPTIONS="-Djava.security.krb5.conf=${TESTSRC}${FS}onlythree.conf"
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    60
KTAB="${TESTJAVA}${FS}bin${FS}ktab -J${EXTRA_OPTIONS} -k $KEYTAB -f"
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    61
CHECK="${TESTJAVA}${FS}bin${FS}java ${EXTRA_OPTIONS} KtabCheck $KEYTAB"
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    62
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    63
echo ${EXTRA_OPTIONS}
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    64
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    65
$KTAB -a me mine
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    66
$CHECK 1 16 1 23 1 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    67
$KTAB -a me mine -n 0
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    68
$CHECK 0 16 0 23 0 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    69
$KTAB -a me mine -n 1 -append
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    70
$CHECK 0 16 0 23 0 17 1 16 1 23 1 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    71
$KTAB -a me mine -append
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    72
$CHECK 0 16 0 23 0 17 1 16 1 23 1 17 2 16 2 23 2 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    73
$KTAB -a me mine
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    74
$CHECK 3 16 3 23 3 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    75
$KTAB -a me mine -n 4 -append
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    76
$CHECK 3 16 3 23 3 17 4 16 4 23 4 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    77
$KTAB -a me mine -n 5 -append
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    78
$CHECK 3 16 3 23 3 17 4 16 4 23 4 17 5 16 5 23 5 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    79
$KTAB -a me mine -n 6 -append
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    80
$CHECK 3 16 3 23 3 17 4 16 4 23 4 17 5 16 5 23 5 17 6 16 6 23 6 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    81
$KTAB -d me 3
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    82
$CHECK 4 16 4 23 4 17 5 16 5 23 5 17 6 16 6 23 6 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    83
$KTAB -d me -e 16 6
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    84
$CHECK 4 16 4 23 4 17 5 16 5 23 5 17 6 23 6 17 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    85
$KTAB -d me -e 17 6
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    86
$CHECK 4 16 4 23 4 17 5 16 5 23 5 17 6 23 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    87
$KTAB -d me -e 16 5
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    88
$CHECK 4 16 4 23 4 17 5 23 5 17 6 23 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    89
$KTAB -d me old
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    90
$CHECK 4 16 5 17 6 23 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    91
$KTAB -d me old
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    92
$CHECK 4 16 5 17 6 23 || exit 1
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    93
$KTAB -d me
9fd3887c8010 6950546: "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]"
weijun
parents:
diff changeset
    94
$CHECK || exit 1