8036006: [TESTBUG] sun/tools/native2ascii/NativeErrors.java fails: Process exit code was 0, but error was expected
Ignore read-only test if file is not read-only. This will happen when test is run as root. Reviewed-by: sla, dholmes
This commit is contained in:
parent
56dcda05d3
commit
2e06869b6f
@ -73,7 +73,14 @@ public class NativeErrors {
|
||||
throw new Error("Output file cannot be made read only: " + path2);
|
||||
}
|
||||
f2.deleteOnExit();
|
||||
checkResult(executeCmd(path1, path2), "err.cannot.write");
|
||||
if ( f2.canWrite() ) {
|
||||
String msg = "Output file is still writable. " +
|
||||
"Probably because test is run as root. Read-only test skipped.";
|
||||
System.out.println(msg);
|
||||
} else {
|
||||
// Test write to a read-only file.
|
||||
checkResult(executeCmd(path1, path2), "err.cannot.write");
|
||||
}
|
||||
}
|
||||
|
||||
private static String executeCmd(String... toolArgs) throws Throwable {
|
||||
|
Loading…
x
Reference in New Issue
Block a user