Skip to content

Commit 449e48c

Browse files
committed
test: update tt3 config
1 parent 65bdd5c commit 449e48c

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

tarantool-shared-resources/tarantool3/init.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ box.once('schema', function()
8585
password = 'password'
8686
})
8787

88-
box.schema.user.create('api_user', { password = 'secret', if_not_exists = true })
89-
box.schema.user.grant('api_user', 'read,write,execute', 'universe')
9088
box.schema.user.grant('user_a', 'read,write', 'space', 'space_a')
9189
box.schema.user.grant('user_a', 'execute', 'universe')
9290
box.schema.user.grant('user_b', 'read,write', 'space', 'space_b')

testcontainers/src/main/java/org/testcontainers/containers/tarantool/Tarantool3Container.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,21 @@ protected void configure() {
227227
withEnv("TT_CONFIG_ETCD_ENDPOINTS", joinEtcdAddresses(this.etcdAddresses));
228228
withEnv("TT_CONFIG_ETCD_PREFIX", this.etcdPrefix);
229229
}
230-
withCreateContainerCmdModifier(cmd -> cmd.withName(this.node).withUser("root"));
231230
withPrivilegedMode(true);
231+
withCreateContainerCmdModifier(
232+
cmd -> {
233+
cmd.withName(this.node).withUser("root");
234+
String originalEntrypoint = "tarantool";
235+
if (cmd.getEntrypoint() != null && cmd.getEntrypoint().length > 0) {
236+
originalEntrypoint = String.join(" ", cmd.getEntrypoint());
237+
}
238+
cmd.withEntrypoint(
239+
"sh",
240+
"-c",
241+
String.format(
242+
"chmod -R 777 %s 2>/dev/null || true && exec %s",
243+
TarantoolContainer.DEFAULT_DATA_DIR.toAbsolutePath(), originalEntrypoint));
244+
});
232245
this.configured = true;
233246
} catch (Exception e) {
234247
throw new ContainerLaunchException(e.getMessage(), e);

testcontainers/src/main/java/org/testcontainers/containers/utils/TarantoolContainerClientHelper.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,10 @@ public static TarantoolContainer<?> createTarantoolContainer(Integer... exposedP
219219
case 3 -> new Tarantool3Container(dockerImage, "test-node")
220220
.withConfigPath(createConfig(exposedPorts))
221221
.withNetwork(NETWORK)
222-
.waitingFor(new Tarantool3WaitStrategy(
223-
"localhost", API_USER, CREDS.get(API_USER)));
224-
222+
.waitingFor(
223+
new Tarantool3WaitStrategy("localhost", API_USER, CREDS.get(API_USER)))
224+
.withPrivilegedMode(true)
225+
.withCreateContainerCmdModifier(cmd -> cmd.withUser("root"));
225226
default -> throw new RuntimeException(
226227
String.format("Unsupported Tarantool version, %s", TARANTOOL_VERSION));
227228
};

0 commit comments

Comments
 (0)