forked from opensearch-project/sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCrossClusterTestBase.java
More file actions
45 lines (38 loc) · 1.52 KB
/
Copy pathCrossClusterTestBase.java
File metadata and controls
45 lines (38 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
package org.opensearch.sql.security;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_ACCOUNT;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_BANK;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DOG;
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_TIME_DATA;
import org.opensearch.sql.ppl.PPLIntegTestCase;
public class CrossClusterTestBase extends PPLIntegTestCase {
static {
// find a remote cluster
String[] clusterNames = System.getProperty("cluster.names").split(",");
var remote = "remoteCluster";
for (var cluster : clusterNames) {
if (cluster.startsWith("remote")) {
remote = cluster;
break;
}
}
REMOTE_CLUSTER = remote;
}
public static final String REMOTE_CLUSTER;
protected static final String TEST_INDEX_BANK_REMOTE = REMOTE_CLUSTER + ":" + TEST_INDEX_BANK;
protected static final String TEST_INDEX_DOG_REMOTE = REMOTE_CLUSTER + ":" + TEST_INDEX_DOG;
protected static final String TEST_INDEX_DOG_MATCH_ALL_REMOTE =
MATCH_ALL_REMOTE_CLUSTER + ":" + TEST_INDEX_DOG;
protected static final String TEST_INDEX_ACCOUNT_REMOTE =
REMOTE_CLUSTER + ":" + TEST_INDEX_ACCOUNT;
protected static final String TEST_INDEX_TIME_DATA_REMOTE =
REMOTE_CLUSTER + ":" + TEST_INDEX_TIME_DATA;
@Override
protected void init() throws Exception {
super.init();
configureMultiClusters(REMOTE_CLUSTER);
}
}