8222410: java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile hangs when "nc" does not accept "-U"
Reviewed-by: alanb
--- a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java Tue Apr 09 16:21:20 2019 +0100
+++ b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java Mon Apr 15 18:22:08 2019 +0200
@@ -61,6 +61,14 @@
return;
}
+ // Verify that 'nc' accepts '-U' for Unix domain sockets.
+ // Skip the test if it is not.
+ Process procHelp = Runtime.getRuntime().exec(CMD_BASE + " -h");
+ if (procHelp.waitFor() != 0) {
+ System.err.println("Netcat does not accept required options; skipping test.");
+ return;
+ }
+
// Create a new sub-directory of the nominal test directory in which
// 'nc' will create the socket file.
String testSubDir = System.getProperty("test.dir", ".")