Skip to content

Commit 6ccff7f

Browse files
author
Amos Shi
committed
8332248: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java failed with RuntimeException
Backport-of: 0bb5ae645165b97527ecccf02308df6072c363d8
1 parent e5800b8 commit 6ccff7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* @bug 8054029
2626
* @requires (os.family == "linux")
2727
* @summary FileChannel.size() should be equal to RandomAccessFile.size() and > 0 for block devs on Linux
28+
* @library /test/lib
2829
*/
2930

3031
import java.io.RandomAccessFile;
@@ -36,6 +37,7 @@
3637

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

40+
import jtreg.SkippedException;
3941

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

6769
}

0 commit comments

Comments
 (0)