hotspot/test/runtime/7110720/Test7110720.sh
author mikael
Tue, 24 Dec 2013 11:48:39 -0800
changeset 22234 da823d78ad65
parent 16457 92af83361777
permissions -rw-r--r--
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013 Summary: Copyright year updated for files modified during 2013 Reviewed-by: twisti, iveresov
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
#
22234
da823d78ad65 8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents: 16457
diff changeset
     2
#  Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
12981
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}" = "" ]
16457
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 13523
diff changeset
    15
then
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 13523
diff changeset
    16
  TESTSRC=${PWD}
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 13523
diff changeset
    17
  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
12981
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    18
fi
16457
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 13523
diff changeset
    19
echo "TESTSRC=${TESTSRC}"
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 13523
diff changeset
    20
## Adding common setup Variables for running shell tests.
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 13523
diff changeset
    21
. ${TESTSRC}/../../test_env.sh
12981
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    22
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    23
# 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
    24
# 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
    25
# 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
    26
# we can recognise that.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    27
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    28
# set platform-dependent variables
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    29
OS=`uname -s`
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    30
case "$OS" in
13469
9a2973794d8c 7129723: MAC: Some regression tests need to recognize Mac OS X platform
coleenp
parents: 12981
diff changeset
    31
  SunOS | Linux | Darwin )
12981
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    32
    FS="/"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    33
    RM=/bin/rm
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    34
    CP=/bin/cp
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    35
    MV=/bin/mv
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    36
    ## for solaris, linux it's HOME
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    37
    FILE_LOCATION=$HOME
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    38
    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
    39
    then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    40
        TESTVMOPTS=`cat ${FILE_LOCATION}${FS}JDK64BIT`
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    41
    fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    42
    ;;
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    43
  Windows_* )
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    44
    FS="\\"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    45
    RM=rm
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    46
    CP=cp
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    47
    MV=mv
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    48
    ;;
13523
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    49
  CYGWIN_* )
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    50
    FS="/"
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    51
    RM=rm
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    52
    CP=cp
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    53
    MV=mv
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    54
    ;;
12981
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    55
  * )
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    56
    echo "Unrecognized system!"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    57
    exit 1;
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
esac
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    60
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
JAVA=${TESTJAVA}${FS}bin${FS}java
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
# 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
    65
${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
    66
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    67
  echo Skipping test for debug build.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    68
  exit 0
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    69
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    70
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    71
ok=yes
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    72
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    73
$RM -f .hotspot_compiler .hotspotrc
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    74
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    75
${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
    76
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    77
  echo "FAILED: base case failure"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    78
  exit 1
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    79
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    80
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    81
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    82
echo "garbage in, garbage out" > .hotspot_compiler
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    83
${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
    84
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    85
  echo "FAILED: .hotspot_compiler was read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    86
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    87
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    88
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    89
$MV .hotspot_compiler hs_comp.txt
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    90
${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
    91
if [ "$?" = "1" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    92
  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
    93
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    94
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    95
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    96
$RM -f .hotspot_compiler hs_comp.txt
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    97
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    98
echo "garbage" > .hotspotrc
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    99
${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
   100
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   101
  echo "FAILED: .hotspotrc was read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   102
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   103
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   104
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   105
$MV .hotspotrc hs_flags.txt
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   106
${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
   107
if [ "$?" = "1" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   108
  echo "FAILED: explicit flags file not read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   109
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   110
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   111
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   112
if [ "${ok}" = "no" ]; then 
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   113
  echo "Some tests failed."
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   114
  exit 1
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   115
else 
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   116
  echo "Passed"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   117
  exit 0
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   118
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   119