7076644: TEST_BUG: test/java/io/File/Basic.java fails with cygwin
Reviewed-by: alanb
Contributed-by: Eric Wang <yiming.wang@oracle.com>
--- a/jdk/test/ProblemList.txt Tue Jul 31 06:14:28 2012 -0700
+++ b/jdk/test/ProblemList.txt Tue Aug 07 12:47:45 2012 +0100
@@ -228,9 +228,6 @@
# 6962637
java/io/File/MaxPathLength.java windows-all
-# 7076644
-java/io/File/Basic.java windows-all
-
# 7145435 - Test needs AWT window server, does not work headless
java/io/Serializable/resolveClass/deserializeButton/run.sh macosx-all
--- a/jdk/test/java/io/File/basic.sh Tue Jul 31 06:14:28 2012 -0700
+++ b/jdk/test/java/io/File/basic.sh Tue Aug 07 12:47:45 2012 +0100
@@ -33,7 +33,16 @@
rm -rf x.Basic.*
rm -f x.Basic.non
printf "%s" "xyzzyN" > x.Basic.rw
-touch x.Basic.ro; chmod ugo-w x.Basic.ro
+touch x.Basic.ro
+OS=`uname -s`
+case "$OS" in
+ Windows_* | CYGWIN*)
+ attrib +R x.Basic.ro
+ ;;
+ *)
+ chmod ugo-w x.Basic.ro
+ ;;
+esac
mkdir x.Basic.dir
if $TESTJAVA/bin/java $* -classpath "$TESTCLASSES" Basic; then
[ -f x.Basic.rw ] && (echo "x.Basic.rw not deleted"; exit 1)