Skip to content

Commit

Permalink
Merge pull request #220 from oleg-nenashev/tests/JENKINS-38696-remoti…
Browse files Browse the repository at this point in the history
…ng-Util-mkdirs

[JENKINS-38696] - huson.remoting.UtilTest#mkdirs() should not try creating global paths on Windows.
  • Loading branch information
oleg-nenashev committed Nov 15, 2017
2 parents 3813f30 + f238814 commit 40def98
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/test/java/hudson/remoting/UtilTest.java
Expand Up @@ -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 40def98

Please sign in to comment.