Skip to content

Commit

Permalink
Add open options settings for test configs
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaDemianenko committed Dec 1, 2021
1 parent 34cd62c commit 885682d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/test/java/com/neo4j/docker/neo4jserver/TestMounting.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -268,7 +273,7 @@ void canMountAllTheThings_namedVolumes(boolean asCurrentUser) throws Exception
{
container.withCreateContainerCmdModifier(
(Consumer<CreateContainerCmd>) 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"),
Expand Down
6 changes: 5 additions & 1 deletion src/test/resources/confs/EnterpriseOnlyNotOverwritten.conf
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
causal_clustering.transaction_advertised_address=localhost:6060
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
6 changes: 5 additions & 1 deletion src/test/resources/confs/EnvVarsOverride.conf
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
dbms.memory.pagecache.size=1000m
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
5 changes: 4 additions & 1 deletion src/test/resources/confs/ExtendedConf.conf
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
dbms.logs.http.rotation.keep_number=$(expr 2 * 10)
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
5 changes: 5 additions & 0 deletions src/test/resources/confs/MountConf.conf
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion src/test/resources/confs/ReadConf.conf
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
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

0 comments on commit 885682d

Please sign in to comment.