Skip to content
Permalink
Browse files

[JENKINS-38696] - huson.remoting.UtilTest#mkdirs() should not try cre…

…ating global paths on Windows.

On Windows you CAN create such directories.
But it does not mean we should try it even in tests.

Ideally the test needs to be rewritten or removed at all.
  • Loading branch information...
oleg-nenashev committed Nov 13, 2017
1 parent 239f635 commit f2388146eacf5261cce311463294dac6681bdb24
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/test/java/hudson/remoting/UtilTest.java
@@ -161,13 +161,15 @@ public void mkdirs() throws IOException {
assertTrue(file.exists());
assertTrue(file.isFile());

// Fail to create aloud
try {
File forbidden = new File("/proc/nonono");
Util.mkdirs(forbidden);
fail();
} catch (IOException ex) {
// Expected
// Fail to create aloud, do not try on Windows
if (!Launcher.isWindows()) {
try {
File forbidden = new File("/proc/nonono");
Util.mkdirs(forbidden);
fail("The directory has been created when it should not: " + forbidden);
} catch (IOException ex) {
// Expected
}
}
}
}

0 comments on commit f238814

Please sign in to comment.
You can’t perform that action at this time.