jdk/test/sun/security/krb5/tools/ktarg.sh
author stefank
Mon, 25 Aug 2014 09:10:13 +0200
changeset 26314 f8bc1966fb30
parent 7521 2a2dfc6c09d9
permissions -rw-r--r--
8055416: Several vm/gc/heap/summary "After GC" events emitted for the same GC ID Reviewed-by: brutisso, ehelin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7296
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
     1
#
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
     2
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
     4
#
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
     7
# published by the Free Software Foundation.
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
     8
#
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    13
# accompanied this code).
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    14
#
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    18
#
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    21
# questions.
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    22
#
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    23
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    24
# @test
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    25
# @bug 7002036
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    26
# @summary ktab return code changes on a error case
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    27
# @run shell ktarg.sh
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    28
#
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    29
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    30
if [ "${TESTJAVA}" = "" ] ; then
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    31
  JAVAC_CMD=`which javac`
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    32
  TESTJAVA=`dirname $JAVAC_CMD`/..
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    33
fi
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    34
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    35
if [ "${TESTSRC}" = "" ] ; then
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    36
  TESTSRC="."
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    37
fi
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    38
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    39
OS=`uname -s`
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    40
case "$OS" in
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    41
  CYGWIN* )
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    42
    FS="/"
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    43
    ;;
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    44
  Windows_* )
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    45
    FS="\\"
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    46
    ;;
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    47
  * )
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    48
    FS="/"
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    49
    echo "Unsupported system!"
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    50
    exit 0;
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    51
    ;;
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    52
esac
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    53
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    54
KEYTAB=ktarg.tmp
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    55
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    56
rm $KEYTAB 2> /dev/null
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    57
KTAB="${TESTJAVA}${FS}bin${FS}ktab -k $KEYTAB"
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    58
7521
2a2dfc6c09d9 7004721: ktarg.sh fails when there's no default realm
weijun
parents: 7296
diff changeset
    59
$KTAB -a me@LOCAL mine || exit 1
7296
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    60
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    61
$KTAB -hello
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    62
if [ $? = 0 ]; then exit 2; fi
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    63
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    64
$KTAB
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    65
if [ $? = 0 ]; then exit 3; fi
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    66
fa827ef8c75e 7002036: ktab return code changes on a error case
weijun
parents:
diff changeset
    67
exit 0