ZipSlip test fails on Mac OS 09/106209/2
authorNeil Derraugh <neil.derraugh@yoppworks.com>
Fri, 17 Apr 2020 17:35:30 +0000 (13:35 -0400)
committerOfir Sonsino <ofir.sonsino@intl.att.com>
Sun, 19 Apr 2020 07:24:10 +0000 (07:24 +0000)
Mac OS has a symlink in the tmp dir that gets created in the test for
ZipSlip.  Using real paths prevents the test test from failing by using
actual paths instead of a potentially different symlinked path to the
canonical path.

Issue-ID: SDC-2887
Signed-off-by: neil.derraugh <neil.derraugh@yoppworks.com>
Change-Id: Iafb0a84f6ab68276c5782c1ef716c59435aa72f5

common-app-api/src/test/java/org/openecomp/sdc/common/zip/ZipUtilsTest.java

index d5fb3dc..bfd1046 100644 (file)
@@ -113,8 +113,8 @@ public class ZipUtilsTest {
 
     @Test
     public void testUnzipAndZip() throws IOException, ZipException {
-        final Path unzipTempPath = Files.createTempDirectory("testUnzip");
-        final Path zipTempPath = Files.createTempDirectory("testZip");
+        final Path unzipTempPath = Files.createTempDirectory("testUnzip").toRealPath();
+        final Path zipTempPath = Files.createTempDirectory("testZip").toRealPath();
         final Path testZipPath;
         try {
             try {