Properly handle the case where symlinks are supported, but
the user is not a windows administrator (can throw IOE in this case)
This commit is contained in:
parent
019a9410a3
commit
d1defef69d
|
@ -154,7 +154,7 @@ public class SecurityTests extends ElasticsearchTestCase {
|
||||||
Path linkExists = p.resolve("linkExists");
|
Path linkExists = p.resolve("linkExists");
|
||||||
try {
|
try {
|
||||||
Files.createSymbolicLink(linkExists, exists);
|
Files.createSymbolicLink(linkExists, exists);
|
||||||
} catch (UnsupportedOperationException e) {
|
} catch (UnsupportedOperationException | IOException e) {
|
||||||
assumeNoException("test requires filesystem that supports symbolic links", e);
|
assumeNoException("test requires filesystem that supports symbolic links", e);
|
||||||
}
|
}
|
||||||
Security.ensureDirectoryExists(linkExists);
|
Security.ensureDirectoryExists(linkExists);
|
||||||
|
@ -168,7 +168,7 @@ public class SecurityTests extends ElasticsearchTestCase {
|
||||||
Path brokenLink = p.resolve("brokenLink");
|
Path brokenLink = p.resolve("brokenLink");
|
||||||
try {
|
try {
|
||||||
Files.createSymbolicLink(brokenLink, p.resolve("nonexistent"));
|
Files.createSymbolicLink(brokenLink, p.resolve("nonexistent"));
|
||||||
} catch (UnsupportedOperationException e) {
|
} catch (UnsupportedOperationException | IOException e) {
|
||||||
assumeNoException("test requires filesystem that supports symbolic links", e);
|
assumeNoException("test requires filesystem that supports symbolic links", e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue