hotspot/test/runtime/7110720/Test7110720.sh
author coleenp
Wed, 01 Aug 2012 16:52:43 -0400
changeset 13469 9a2973794d8c
parent 12981 b557c10f5444
child 13523 6a7f3e56a242
permissions -rw-r--r--
7129723: MAC: Some regression tests need to recognize Mac OS X platform Summary: Add Darwin like Linux to shell scripts Reviewed-by: kvn, kamg, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12981
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     1
#
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     2
#  Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     3
#  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     4
#
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     5
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     6
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     7
#
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     8
# @test Test7110720.sh
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     9
# @bug 7110720
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    10
# @summary improve VM configuration file loading
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    11
# @run shell Test7110720.sh
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    12
#
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    13
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    14
if [ "${TESTSRC}" = "" ]
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    15
  then TESTSRC=.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    16
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    17
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    18
if [ "${TESTJAVA}" = "" ]
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    19
then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    20
  PARENT=`dirname \`which java\``
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    21
  TESTJAVA=`dirname ${PARENT}`
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    22
  echo "TESTJAVA not set, selecting " ${TESTJAVA}
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    23
  echo "If this is incorrect, try setting the variable manually."
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    24
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    25
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    26
if [ "${TESTCLASSES}" = "" ]
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    27
then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    28
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    29
  exit 1
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    30
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    31
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    32
# Jtreg sets TESTVMOPTS which may include -d64 which is
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    33
# required to test a 64-bit JVM on some platforms.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    34
# If another test harness still creates HOME/JDK64BIT,
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    35
# we can recognise that.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    36
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    37
# set platform-dependent variables
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    38
OS=`uname -s`
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    39
case "$OS" in
13469
9a2973794d8c 7129723: MAC: Some regression tests need to recognize Mac OS X platform
coleenp
parents: 12981
diff changeset
    40
  SunOS | Linux | Darwin )
12981
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    41
    FS="/"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    42
    RM=/bin/rm
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    43
    CP=/bin/cp
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    44
    MV=/bin/mv
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    45
    ## for solaris, linux it's HOME
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    46
    FILE_LOCATION=$HOME
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    47
    if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    48
    then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    49
        TESTVMOPTS=`cat ${FILE_LOCATION}${FS}JDK64BIT`
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    50
    fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    51
    ;;
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    52
  Windows_* )
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    53
    FS="\\"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    54
    RM=rm
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    55
    CP=cp
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    56
    MV=mv
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    57
    ;;
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    58
  * )
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    59
    echo "Unrecognized system!"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    60
    exit 1;
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    61
    ;;
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    62
esac
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    63
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    64
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    65
JAVA=${TESTJAVA}${FS}bin${FS}java
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    66
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    67
# Don't test debug builds, they do read the config files:
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    68
${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "debug" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    69
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    70
  echo Skipping test for debug build.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    71
  exit 0
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    72
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    73
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    74
ok=yes
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    75
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    76
$RM -f .hotspot_compiler .hotspotrc
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    77
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    78
${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    79
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    80
  echo "FAILED: base case failure"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    81
  exit 1
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    82
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    83
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    84
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    85
echo "garbage in, garbage out" > .hotspot_compiler
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    86
${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    87
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    88
  echo "FAILED: .hotspot_compiler was read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    89
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    90
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    91
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    92
$MV .hotspot_compiler hs_comp.txt
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    93
${JAVA} ${TESTVMOPTS} -XX:CompileCommandFile=hs_comp.txt -version 2>&1 | grep "garbage in" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    94
if [ "$?" = "1" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    95
  echo "FAILED: explicit compiler command file not read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    96
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    97
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    98
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    99
$RM -f .hotspot_compiler hs_comp.txt
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   100
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   101
echo "garbage" > .hotspotrc
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   102
${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   103
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   104
  echo "FAILED: .hotspotrc was read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   105
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   106
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   107
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   108
$MV .hotspotrc hs_flags.txt
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   109
${JAVA} ${TESTVMOPTS} -XX:Flags=hs_flags.txt -version 2>&1 | grep "garbage" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   110
if [ "$?" = "1" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   111
  echo "FAILED: explicit flags file not read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   112
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   113
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   114
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   115
if [ "${ok}" = "no" ]; then 
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   116
  echo "Some tests failed."
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   117
  exit 1
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   118
else 
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   119
  echo "Passed"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   120
  exit 0
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   121
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   122