Skip to content

Commit

Permalink
8309138: Fix container tests for jdks with symlinked conf dir
Browse files Browse the repository at this point in the history
Reviewed-by: phh, sgehwolf
Backport-of: c1bb926f4d5eaf49777f93b9f8788db243bba83b
SendaoYan authored and jerboaa committed Aug 21, 2024
1 parent 4fe22e8 commit 933c78e
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -30,12 +30,14 @@
import java.nio.file.FileVisitResult;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.FileVisitOption;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.StandardCopyOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.EnumSet;

import com.oracle.java.testlibrary.Utils;
import com.oracle.java.testlibrary.Container;
@@ -144,7 +146,7 @@ private static boolean isDockerEngineAvailableCheck() throws Exception {

// Copy JDK-under-test tree to the docker build directory.
// This step is required for building a docker image.
Files.walkFileTree(jdkSrcDir, new CopyFileVisitor(jdkSrcDir, jdkDstDir));
Files.walkFileTree(jdkSrcDir, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new CopyFileVisitor(jdkSrcDir, jdkDstDir));
buildDockerImage(imageName, Paths.get(Utils.TEST_SRC, dockerfile), buildDir);
}

4 changes: 3 additions & 1 deletion test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java
Original file line number Diff line number Diff line change
@@ -30,12 +30,14 @@
import java.nio.file.FileVisitResult;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.FileVisitOption;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.StandardCopyOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.EnumSet;
import jdk.test.lib.Container;
import jdk.test.lib.Utils;
import jdk.test.lib.process.OutputAnalyzer;
@@ -145,7 +147,7 @@ private static boolean isDockerEngineAvailableCheck() throws Exception {

// Copy JDK-under-test tree to the docker build directory.
// This step is required for building a docker image.
Files.walkFileTree(jdkSrcDir, new CopyFileVisitor(jdkSrcDir, jdkDstDir));
Files.walkFileTree(jdkSrcDir, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new CopyFileVisitor(jdkSrcDir, jdkDstDir));
buildDockerImage(imageName, Paths.get(Utils.TEST_SRC, dockerfile), buildDir);
}

1 comment on commit 933c78e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.