From 885682dbc65eca36ab37e31917ff1949b736f371 Mon Sep 17 00:00:00 2001 From: MishaDemianenko <12656787+mishademianenko@users.noreply.github.com> Date: Wed, 1 Dec 2021 20:02:02 +0100 Subject: [PATCH] Add open options settings for test configs --- .../java/com/neo4j/docker/neo4jserver/TestMounting.java | 7 ++++++- src/test/resources/confs/EnterpriseOnlyNotOverwritten.conf | 6 +++++- src/test/resources/confs/EnvVarsOverride.conf | 6 +++++- src/test/resources/confs/ExtendedConf.conf | 5 ++++- src/test/resources/confs/MountConf.conf | 5 +++++ src/test/resources/confs/ReadConf.conf | 4 +++- 6 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 src/test/resources/confs/MountConf.conf diff --git a/src/test/java/com/neo4j/docker/neo4jserver/TestMounting.java b/src/test/java/com/neo4j/docker/neo4jserver/TestMounting.java index b1443e33..ca1feff2 100644 --- a/src/test/java/com/neo4j/docker/neo4jserver/TestMounting.java +++ b/src/test/java/com/neo4j/docker/neo4jserver/TestMounting.java @@ -22,7 +22,9 @@ import org.testcontainers.containers.wait.strategy.Wait; import java.io.IOException; +import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.time.Duration; import java.util.Random; import java.util.function.Consumer; @@ -240,6 +242,9 @@ void testCantWriteIfSecureEnabledAndNoPermissions_logs() throws IOException void canMountAllTheThings_fileMounts(boolean asCurrentUser) throws Exception { Path testOutputFolder = HostFileSystemOperations.createTempFolder( "mount-everything-" ); + Path confFile = Paths.get( "src", "test", "resources", "confs", "MountConf.conf" ); + Files.copy( confFile, testOutputFolder.resolve( "neo4j.conf" ) ); + try(GenericContainer container = setupBasicContainer( asCurrentUser, false )) { HostFileSystemOperations.createTempFolderAndMountAsVolume( container, "conf", "/conf", testOutputFolder ); @@ -268,7 +273,7 @@ void canMountAllTheThings_namedVolumes(boolean asCurrentUser) throws Exception { container.withCreateContainerCmdModifier( (Consumer) cmd -> cmd.getHostConfig().withBinds( - Bind.parse("conf-"+id+":/conf"), + // Bind.parse("conf-"+id+":/conf"), // todo we need a set of open options, ask Bind.parse("data-"+id+":/data"), Bind.parse("import-"+id+":/import"), Bind.parse("logs-"+id+":/logs"), diff --git a/src/test/resources/confs/EnterpriseOnlyNotOverwritten.conf b/src/test/resources/confs/EnterpriseOnlyNotOverwritten.conf index 36c4c925..8cbe3ac2 100644 --- a/src/test/resources/confs/EnterpriseOnlyNotOverwritten.conf +++ b/src/test/resources/confs/EnterpriseOnlyNotOverwritten.conf @@ -1 +1,5 @@ -causal_clustering.transaction_advertised_address=localhost:6060 \ No newline at end of file +causal_clustering.transaction_advertised_address=localhost:6060 + +dbms.jvm.additional=--add-opens=java.base/java.nio=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/java.io=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \ No newline at end of file diff --git a/src/test/resources/confs/EnvVarsOverride.conf b/src/test/resources/confs/EnvVarsOverride.conf index b7ec0f27..6a9fc8e9 100644 --- a/src/test/resources/confs/EnvVarsOverride.conf +++ b/src/test/resources/confs/EnvVarsOverride.conf @@ -1 +1,5 @@ -dbms.memory.pagecache.size=1000m \ No newline at end of file +dbms.memory.pagecache.size=1000m + +dbms.jvm.additional=--add-opens=java.base/java.nio=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/java.io=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \ No newline at end of file diff --git a/src/test/resources/confs/ExtendedConf.conf b/src/test/resources/confs/ExtendedConf.conf index 26c3e0c8..37d0acd8 100644 --- a/src/test/resources/confs/ExtendedConf.conf +++ b/src/test/resources/confs/ExtendedConf.conf @@ -1 +1,4 @@ -dbms.logs.http.rotation.keep_number=$(expr 2 * 10) \ No newline at end of file +dbms.logs.http.rotation.keep_number=$(expr 2 * 10) +dbms.jvm.additional=--add-opens=java.base/java.nio=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/java.io=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \ No newline at end of file diff --git a/src/test/resources/confs/MountConf.conf b/src/test/resources/confs/MountConf.conf new file mode 100644 index 00000000..c74fe6a2 --- /dev/null +++ b/src/test/resources/confs/MountConf.conf @@ -0,0 +1,5 @@ +dbms.memory.heap.max_size=512m + +dbms.jvm.additional=--add-opens=java.base/java.nio=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/java.io=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \ No newline at end of file diff --git a/src/test/resources/confs/ReadConf.conf b/src/test/resources/confs/ReadConf.conf index ee496162..23f12a86 100644 --- a/src/test/resources/confs/ReadConf.conf +++ b/src/test/resources/confs/ReadConf.conf @@ -1 +1,3 @@ -dbms.memory.heap.max_size=512m \ No newline at end of file +dbms.jvm.additional=--add-opens=java.base/java.nio=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/java.io=ALL-UNNAMED +dbms.jvm.additional=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \ No newline at end of file