提交 f9b9c950 编写于 作者: M mtobiass

8036006: [TESTBUG] sun/tools/native2ascii/NativeErrors.java fails: Process...

8036006: [TESTBUG] sun/tools/native2ascii/NativeErrors.java fails: Process exit code was 0, but error was expected.
Summary: Ignore read-only test if file is not read-only. This will happen when test is run as root.
Reviewed-by: sla, dholmes
上级 d46e69c0
......@@ -75,7 +75,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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册