changeset 6946:c5d7cbccfcd7

7152892: some jtreg tests fail with permission denied Reviewed-by: coffeys
author robm
date Thu, 13 Feb 2014 21:35:53 +0000
parents 3edb49b50486
children e1f33d3b7054 b387fbb83529
files test/java/lang/ClassLoader/Assert.sh test/java/rmi/registry/readTest/readTest.sh test/java/util/zip/ZipFile/ReadZip.java test/sun/net/www/protocol/jar/jarbug/run.sh
diffstat 4 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/lang/ClassLoader/Assert.sh	Wed Jul 03 11:35:06 2013 -0700
+++ b/test/java/lang/ClassLoader/Assert.sh	Thu Feb 13 21:35:53 2014 +0000
@@ -23,6 +23,21 @@
 
 #
 
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    FS="/"
+    CHMOD="${FS}bin${FS}chmod"
+    ;;
+  Windows* | CYGWIN* )
+    CHMOD="chmod"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -46,6 +61,7 @@
 cp ${TESTSRC}/Assert.java .
 cp -R ${TESTSRC}/package1 .
 cp -R ${TESTSRC}/package2 .
+${CHMOD} -R u+w *
 
 ${TESTJAVA}/bin/javac Assert.java 
 
--- a/test/java/rmi/registry/readTest/readTest.sh	Wed Jul 03 11:35:06 2013 -0700
+++ b/test/java/rmi/registry/readTest/readTest.sh	Thu Feb 13 21:35:53 2014 +0000
@@ -37,11 +37,13 @@
   SunOS | Linux | Darwin )
     PS=":"
     FS="/"
+    CHMOD="${FS}bin${FS}chmod"
     FILEURL="file:"
     ;;
   Windows* )
     PS=";"
     FS="\\"
+    CHMOD="chmod"
     FILEURL="file:/"
     if [ "$VER" -eq "5" ]; then
         ARGS="-Djdk.net.ephemeralPortRange.low=1024 -Djdk.net.ephemeralPortRange.high=65000"
@@ -51,6 +53,7 @@
   CYGWIN* )
     PS=";"
     FS="/"
+    CHMOD="chmod"
     FILEURL="file:/"
     if [ "${VER}" -eq "5" ]; then
         ARGS="-Djdk.net.ephemeralPortRange.low=1024 -Djdk.net.ephemeralPortRange.high=65000"
@@ -65,6 +68,7 @@
 
 TEST_CLASSPATH=.$PS${TESTCLASSPATH:-$TESTCLASSES}
 cp -r ${TESTSRC}${FS}* .
+${CHMOD} -R u+w *
 ${TESTJAVA}${FS}bin${FS}javac testPkg${FS}*java
 ${TESTJAVA}${FS}bin${FS}javac -cp $TEST_CLASSPATH readTest.java
 
--- a/test/java/util/zip/ZipFile/ReadZip.java	Wed Jul 03 11:35:06 2013 -0700
+++ b/test/java/util/zip/ZipFile/ReadZip.java	Thu Feb 13 21:35:53 2014 +0000
@@ -63,6 +63,8 @@
         Files.copy(Paths.get(System.getProperty("test.src", ""), "input.zip"),
                    newZip.toPath(), StandardCopyOption.REPLACE_EXISTING);
 
+        newZip.setWritable(true);
+
         // pad some bytes
         try (OutputStream os = Files.newOutputStream(newZip.toPath(),
                                                      StandardOpenOption.APPEND)) {
--- a/test/sun/net/www/protocol/jar/jarbug/run.sh	Wed Jul 03 11:35:06 2013 -0700
+++ b/test/sun/net/www/protocol/jar/jarbug/run.sh	Thu Feb 13 21:35:53 2014 +0000
@@ -34,14 +34,17 @@
   SunOS | Linux | Darwin )
     PS=":"
     FS="/"
+    CHMOD="${FS}bin${FS}chmod"
     ;;
   Windows* )
     PS=";"
     FS="\\"
+    CHMOD="chmod"
     ;;
   CYGWIN* )
     PS=";"
     FS="/"
+    CHMOD="chmod"
     #
     # javac does not like /cygdrive produced by `pwd`.
     #
@@ -59,6 +62,7 @@
 mkdir -p ${DEST}${FS}jar1
 cd ${TESTSRC}${FS}etc${FS}jar1
 cp -r . ${DEST}${FS}jar1
+${CHMOD} -R u+w ${DEST}${FS}jar1
 ${TESTJAVA}${FS}bin${FS}javac -d ${DEST}${FS}jar1 \
     ${TESTSRC}${FS}src${FS}jar1${FS}LoadResourceBundle.java
 ${TESTJAVA}${FS}bin${FS}javac -d ${DEST}${FS}jar1 \