RFR: 8036006 [TESTBUG] sun/tools/native2ascii/NativeErrors.java: Process exit code was 0, but error was expected

Mattias Tobiasson mattias.tobiasson at oracle.com
Mon Jun 2 12:11:16 UTC 2014


Hi,
Could someone please review this test fix?

The test tries to write to a read-only file and expects an error.
The test will fail if it is run as root, because root is allowed to write to read-only files.

The fix is to check if the file is really read-only with function java.io.File.canWrite().
If we are root then canWrite() will return true and the read-only part of the test is skipped.

webrev: http://cr.openjdk.java.net/~ykantser/8036006/webrev.00/
bug: https://bugs.openjdk.java.net/browse/JDK-8036006

Mattias



More information about the serviceability-dev mailing list