mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-22 21:05:23 +00:00
Refactors test/fixtures as per OpenSearch naming (#370)
Signed-off-by: Himanshu Setia <setiah@amazon.com>
This commit is contained in:
parent
bd4972c808
commit
b5e00e1e58
4
test/fixtures/azure-fixture/build.gradle
vendored
4
test/fixtures/azure-fixture/build.gradle
vendored
@ -16,8 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
apply plugin: 'elasticsearch.java'
|
||||
apply plugin: 'elasticsearch.test.fixtures'
|
||||
apply plugin: 'opensearch.java'
|
||||
apply plugin: 'opensearch.test.fixtures'
|
||||
|
||||
description = 'Fixture for Azure external service'
|
||||
test.enabled = false
|
||||
|
4
test/fixtures/gcs-fixture/build.gradle
vendored
4
test/fixtures/gcs-fixture/build.gradle
vendored
@ -16,8 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
apply plugin: 'elasticsearch.java'
|
||||
apply plugin: 'elasticsearch.test.fixtures'
|
||||
apply plugin: 'opensearch.java'
|
||||
apply plugin: 'opensearch.test.fixtures'
|
||||
|
||||
description = 'Fixture for Google Cloud Storage service'
|
||||
test.enabled = false
|
||||
|
2
test/fixtures/hdfs-fixture/build.gradle
vendored
2
test/fixtures/hdfs-fixture/build.gradle
vendored
@ -17,7 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
apply plugin: 'elasticsearch.java'
|
||||
apply plugin: 'opensearch.java'
|
||||
|
||||
dependencies {
|
||||
api "org.apache.hadoop:hadoop-minicluster:2.8.5"
|
||||
|
@ -119,7 +119,7 @@ public class MiniHDFS {
|
||||
MiniDFSCluster dfs = builder.build();
|
||||
|
||||
// Configure contents of the filesystem
|
||||
org.apache.hadoop.fs.Path esUserPath = new org.apache.hadoop.fs.Path("/user/elasticsearch");
|
||||
org.apache.hadoop.fs.Path opensearchUserPath = new org.apache.hadoop.fs.Path("/user/opensearch");
|
||||
|
||||
FileSystem fs;
|
||||
if (haEnabled) {
|
||||
@ -130,12 +130,12 @@ public class MiniHDFS {
|
||||
}
|
||||
|
||||
try {
|
||||
// Set the elasticsearch user directory up
|
||||
fs.mkdirs(esUserPath);
|
||||
// Set the opensearch user directory up
|
||||
fs.mkdirs(opensearchUserPath);
|
||||
if (UserGroupInformation.isSecurityEnabled()) {
|
||||
List<AclEntry> acls = new ArrayList<>();
|
||||
acls.add(new AclEntry.Builder().setType(AclEntryType.USER).setName("elasticsearch").setPermission(FsAction.ALL).build());
|
||||
fs.modifyAclEntries(esUserPath, acls);
|
||||
acls.add(new AclEntry.Builder().setType(AclEntryType.USER).setName("opensearch").setPermission(FsAction.ALL).build());
|
||||
fs.modifyAclEntries(opensearchUserPath, acls);
|
||||
}
|
||||
|
||||
// Install a pre-existing repository into HDFS
|
||||
@ -150,7 +150,7 @@ public class MiniHDFS {
|
||||
|
||||
fs.copyFromLocalFile(true, true,
|
||||
new org.apache.hadoop.fs.Path(tempDirectory.resolve(directoryName).toAbsolutePath().toUri()),
|
||||
esUserPath.suffix("/existing/" + directoryName)
|
||||
opensearchUserPath.suffix("/existing/" + directoryName)
|
||||
);
|
||||
|
||||
FileUtils.deleteDirectory(tempDirectory.toFile());
|
||||
|
2
test/fixtures/krb5kdc-fixture/build.gradle
vendored
2
test/fixtures/krb5kdc-fixture/build.gradle
vendored
@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
apply plugin: 'elasticsearch.test.fixtures'
|
||||
apply plugin: 'opensearch.test.fixtures'
|
||||
|
||||
List<String> services = ["peppa", "hdfs"]
|
||||
|
||||
|
@ -2,10 +2,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
addprinc.sh "elasticsearch"
|
||||
addprinc.sh "hdfs/hdfs.build.elastic.co"
|
||||
addprinc.sh "opensearch"
|
||||
#TODO(OpenSearch): fix username
|
||||
addprinc.sh "hdfs/hdfs.build.opensearch.co"
|
||||
|
||||
# Use this as a signal that setup is complete
|
||||
python3 -m http.server 4444 &
|
||||
|
||||
sleep infinity
|
||||
sleep infinity
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
addprinc.sh elasticsearch
|
||||
addprinc.sh opensearch
|
||||
addprinc.sh HTTP/localhost
|
||||
addprinc.sh peppa
|
||||
addprinc.sh george dino
|
||||
@ -10,4 +10,4 @@ addprinc.sh george dino
|
||||
# Use this as a signal that setup is complete
|
||||
python3 -m http.server 4444 &
|
||||
|
||||
sleep infinity
|
||||
sleep infinity
|
||||
|
2
test/fixtures/minio-fixture/build.gradle
vendored
2
test/fixtures/minio-fixture/build.gradle
vendored
@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
apply plugin: 'elasticsearch.test.fixtures'
|
||||
apply plugin: 'opensearch.test.fixtures'
|
||||
|
||||
description = 'Fixture for MinIO Storage service'
|
||||
|
||||
|
@ -17,13 +17,14 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
//TODO(OpenSearch): Remove later if not needed.
|
||||
description = """\
|
||||
Launches versions of Elasticsearch prior to 5.0 for testing.
|
||||
These need special handling because they do not support writing
|
||||
a "ports" file with the port on which Elasticsearch is running.
|
||||
"""
|
||||
|
||||
apply plugin: 'elasticsearch.java'
|
||||
apply plugin: 'opensearch.java'
|
||||
test.enabled = false
|
||||
|
||||
dependencies {
|
@ -37,13 +37,13 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Starts a version of Elasticsearch that has been unzipped into an empty directory,
|
||||
* Starts a version of OpenSearch that has been unzipped into an empty directory,
|
||||
* instructing it to ask the OS for an unused port, grepping the logs for the port
|
||||
* it actually got, and writing a {@code ports} file with the port. This is only
|
||||
* required for versions of Elasticsearch before 5.0 because they do not support
|
||||
* required for versions of OpenSearch before 5.0 because they do not support
|
||||
* writing a "ports" file.
|
||||
*/
|
||||
public class OldElasticsearch {
|
||||
public class OldOpenSearch {
|
||||
public static void main(String[] args) throws IOException {
|
||||
Path baseDir = Paths.get(args[0]);
|
||||
Path unzipDir = Paths.get(args[1]);
|
||||
@ -65,22 +65,22 @@ public class OldElasticsearch {
|
||||
|
||||
Iterator<Path> children = Files.list(unzipDir).iterator();
|
||||
if (false == children.hasNext()) {
|
||||
System.err.println("expected the es directory to contain a single child directory but contained none.");
|
||||
System.err.println("expected the opensearch directory to contain a single child directory but contained none.");
|
||||
System.exit(1);
|
||||
}
|
||||
Path esDir = children.next();
|
||||
Path opensearchDir= children.next();
|
||||
if (children.hasNext()) {
|
||||
System.err.println("expected the es directory to contains a single child directory but contained [" + esDir + "] and ["
|
||||
System.err.println("expected the opensearch directory to contains a single child directory but contained [" + opensearchDir+ "] and ["
|
||||
+ children.next() + "].");
|
||||
System.exit(1);
|
||||
}
|
||||
if (false == Files.isDirectory(esDir)) {
|
||||
System.err.println("expected the es directory to contains a single child directory but contained a single child file.");
|
||||
if (false == Files.isDirectory(opensearchDir)) {
|
||||
System.err.println("expected the opensearch directory to contains a single child directory but contained a single child file.");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
Path bin = esDir.resolve("bin").resolve("elasticsearch" + (Constants.WINDOWS ? ".bat" : ""));
|
||||
Path config = esDir.resolve("config").resolve("elasticsearch.yml");
|
||||
Path bin = opensearchDir.resolve("bin").resolve("opensearch" + (Constants.WINDOWS ? ".bat" : ""));
|
||||
Path config = opensearchDir.resolve("config").resolve("opensearch.yml");
|
||||
|
||||
Files.write(config, Arrays.asList("http.port: 0", "transport.tcp.port: 0", "network.host: 127.0.0.1"), StandardCharsets.UTF_8);
|
||||
|
4
test/fixtures/s3-fixture/build.gradle
vendored
4
test/fixtures/s3-fixture/build.gradle
vendored
@ -16,8 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
apply plugin: 'elasticsearch.java'
|
||||
apply plugin: 'elasticsearch.test.fixtures'
|
||||
apply plugin: 'opensearch.java'
|
||||
apply plugin: 'opensearch.test.fixtures'
|
||||
|
||||
description = 'Fixture for S3 Storage service'
|
||||
test.enabled = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user