Skip to content

Commit

Permalink
Backport 0bb5ae645165b97527ecccf02308df6072c363d8
Browse files Browse the repository at this point in the history
  • Loading branch information
amosshi committed Aug 22, 2024
1 parent 8dbd677 commit fbd9046
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @bug 8054029
* @requires (os.family == "linux")
* @summary FileChannel.size() should be equal to RandomAccessFile.size() and > 0 for block devs on Linux
* @library /test/lib
*/

import java.io.RandomAccessFile;
Expand All @@ -36,6 +37,7 @@

import static java.nio.file.StandardOpenOption.*;

import jtreg.SkippedException;

public class BlockDeviceSize {
private static final List<String> BLK_FNAMES = List.of("/dev/sda1", "/dev/nvme0n1", "/dev/xvda1") ;
Expand All @@ -61,7 +63,7 @@ public static void main(String[] args) throws Throwable {
System.err.println("File " + blkFname + " not found." +
" Skipping test");
} catch (AccessDeniedException ade) {
throw new RuntimeException("Access to " + blkFname + " is denied."
throw new SkippedException("Access to " + blkFname + " is denied."
+ " Run test as root.", ade);

}
Expand Down

0 comments on commit fbd9046

Please # to comment.