Skip to content

Commit 3e4c50d

Browse files
committed
test: update tt3 version
1 parent 53a2a07 commit 3e4c50d

File tree

6 files changed

+30
-28
lines changed

6 files changed

+30
-28
lines changed

tarantool-client/src/test/java/io/tarantool/client/integration/TarantoolCrudClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
@Testcontainers
9090
public class TarantoolCrudClientTest extends BaseTest {
9191

92-
public static final String SECRET_CLUSTER_COOKIE = "secret";
93-
public static final String ADMIN = "api_user";
92+
public static final String SECRET_CLUSTER_COOKIE = "secret-cluster-cookie";
93+
public static final String ADMIN = "admin";
9494
public static final int PERSON_COUNT = 1000;
9595
public static final Map<String, Object> OPTIONS =
9696
new HashMap<String, Object>() {

tarantool-client/src/test/java/io/tarantool/client/integration/TarantoolCrudClientWithRetryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ public static void setUp() throws Exception {
109109
TarantoolFactory.crud()
110110
.withHost(tt.getHost())
111111
.withPort(tt.getPort())
112-
.withUser("api_user")
113-
.withPassword("secret")
112+
.withUser("admin")
113+
.withPassword("secret-cluster-cookie")
114114
.build();
115115
}
116116
}

tarantool-shared-resources/vshard_cluster/config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
credentials:
22
users:
3-
api_user:
4-
password: 'secret'
3+
admin:
4+
password: 'secret-cluster-cookie'
55
roles: [ super ]
66
replicator:
77
password: 'secret'

testcontainers/src/main/java/org/testcontainers/containers/TarantoolCartridgeContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public class TarantoolCartridgeContainer extends GenericContainer<TarantoolCartr
2828

2929
protected static final String ROUTER_HOST = "localhost";
3030
protected static final int ROUTER_PORT = 3301;
31-
protected static final String CARTRIDGE_DEFAULT_USERNAME = "api_user";
32-
protected static final String CARTRIDGE_DEFAULT_PASSWORD = "secret";
31+
protected static final String CARTRIDGE_DEFAULT_USERNAME = "admin";
32+
protected static final String CARTRIDGE_DEFAULT_PASSWORD = "secret-cluster-cookie";
3333
protected static final String DOCKERFILE = "Dockerfile";
3434
protected static final int API_PORT = 8081;
3535
protected static final String VSHARD_BOOTSTRAP_COMMAND =

testcontainers/src/main/java/org/testcontainers/containers/VshardClusterContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class VshardClusterContainer extends GenericContainer<VshardClusterContai
3131

3232
protected static final String ROUTER_HOST = "localhost";
3333
protected static final int ROUTER_PORT = 3301;
34-
protected static final String VSHARD_CLUSTER_DEFAULT_USERNAME = "api_user";
35-
protected static final String VSHARD_CLUSTER_DEFAULT_PASSWORD = "secret";
34+
protected static final String VSHARD_CLUSTER_DEFAULT_USERNAME = "admin";
35+
protected static final String VSHARD_CLUSTER_DEFAULT_PASSWORD = "secret-cluster-cookie";
3636
protected static final String DOCKERFILE = "Dockerfile";
3737
protected static final String SCRIPT_RESOURCE_DIRECTORY = "";
3838
protected static final String INSTANCE_DIR = "/app";

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ public final class TarantoolContainerClientHelper {
6767
"Executed command \"%s\" with exit code %d, stderr: \"%s\", stdout: \"%s\"";
6868

6969
private static final String ECHO_COMMAND = "echo \"%s\" | tt connect %s:%s@%s:%d";
70-
private static final String COMMAND_TEMPLATE = "echo \" " +
71-
" print(require('yaml').encode( " +
72-
" {require('net.box').connect( " +
73-
" '%s:%d', " +
74-
" { user = '%s', password = '%s' } " +
75-
" ):eval('%s')}) " +
76-
" ); " +
77-
" os.exit(); " +
78-
"\" > container-tmp.lua &&" +
79-
" tarantool container-tmp.lua";
70+
private static final String COMMAND_TEMPLATE =
71+
"echo \" "
72+
+ " print(require('yaml').encode( "
73+
+ " {require('net.box').connect( "
74+
+ " '%s:%d', "
75+
+ " { user = '%s', password = '%s' } "
76+
+ " ):eval('%s')}) "
77+
+ " ); "
78+
+ " os.exit(); "
79+
+ "\" > container-tmp.lua &&"
80+
+ " tarantool container-tmp.lua";
8081
private static final String MTLS_COMMAND_TEMPLATE =
8182
"echo \" print(require('yaml').encode( {require('net.box').connect( {"
8283
+ " uri='%s:%d', params = { transport='ssl', ssl_key_file = '%s', ssl_cert_file = '%s'"
@@ -220,8 +221,9 @@ public static TarantoolContainer<?> createTarantoolContainer(Integer... exposedP
220221
.withNetwork(NETWORK)
221222
.waitingFor(
222223
new Tarantool3WaitStrategy("localhost", API_USER, CREDS.get(API_USER)))
223-
.withCreateContainerCmdModifier(cmd -> cmd.withUser("root"))
224-
.withPrivilegedMode(true);
224+
.withPrivilegedMode(true)
225+
.withCreateContainerCmdModifier(
226+
cmd -> cmd.withUser("root").withName("test-node"));
225227
default ->
226228
throw new RuntimeException(
227229
String.format("Unsupported Tarantool version, %s", TARANTOOL_VERSION));
@@ -357,8 +359,8 @@ public static Container.ExecResult executeCommand(
357359
COMMAND_TEMPLATE,
358360
container.getHost(),
359361
container.getInternalPort(),
360-
API_USER,
361-
CREDS.get(API_USER),
362+
container.getUsername(),
363+
container.getPassword(),
362364
command);
363365
} else if (sslContext.getKeyFile() != null && sslContext.getCertFile() != null) { // mTLS
364366
bashCommand =
@@ -368,17 +370,17 @@ public static Container.ExecResult executeCommand(
368370
container.getInternalPort(),
369371
sslContext.getKeyFile(),
370372
sslContext.getCertFile(),
371-
API_USER,
372-
CREDS.get(API_USER),
373+
container.getUsername(),
374+
container.getPassword(),
373375
command);
374376
} else { // SSL
375377
bashCommand =
376378
String.format(
377379
SSL_COMMAND_TEMPLATE,
378380
container.getHost(),
379381
container.getInternalPort(),
380-
API_USER,
381-
CREDS.get(API_USER),
382+
container.getUsername(),
383+
container.getPassword(),
382384
command);
383385
}
384386

0 commit comments

Comments
 (0)