File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 2525import org .testng .annotations .BeforeClass ;
2626import org .testng .annotations .DataProvider ;
2727import org .testng .annotations .Test ;
28+ import org .testng .SkipException ;
2829
2930import java .io .IOException ;
3031import java .net .URI ;
3536import java .nio .file .Path ;
3637import java .util .Iterator ;
3738import java .util .Map ;
39+ import jdk .test .lib .Platform ;
3840
3941import static java .nio .charset .StandardCharsets .UTF_8 ;
4042import static org .testng .Assert .assertEquals ;
4850 * @bug 8218875
4951 * @summary ZIP File System tests that leverage Files.newFileSystem
5052 * @modules jdk.zipfs
53+ * @library /test/lib
5154 * @compile NewFileSystemTests.java
5255 * @run testng NewFileSystemTests
5356 */
@@ -219,6 +222,9 @@ public void multiReleaseJarReadWriteSuccess() throws IOException {
219222 */
220223 @ Test
221224 public void readOnlyZipFileFailure () throws IOException {
225+ if (Platform .isRoot ()) {
226+ throw new SkipException ("Test skipped when executed by root user." );
227+ }
222228 // Underlying file is read-only.
223229 Path readOnlyZip = Utils .createJarFile ("read_only.zip" , Map .of ("file.txt" , "Hello World" ));
224230 // In theory this can fail, and we should avoid unwanted false-negatives.
You can’t perform that action at this time.
0 commit comments