Skip to content

Commit

Permalink
Rename files under qa folder (#212)
Browse files Browse the repository at this point in the history
* Rename directory elasticsearch to opensearch
Rename EvilElasticsearchCliTests EvilOpenSearchCliTests

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename org.elasticsearch to org.opensearch

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename waitForElasticsearch to waitForOpenSearch

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename OpensearchNode to OpenSearchNode

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename "elasticsearch.version" to "opensearch.version"

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearchVersionString to opensearchVersionString

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch.yml to opensearch.yml

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename runElasticsearchTests to runOpenSearchTests

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearchVersion to opensearchVersion

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch to opensearch in gradle files

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename ElasticsearchAssertions to OpenSearchAssertions

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename folder share/elasticsearch to share/opensearch

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch to opensearch

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch-service-x64 to opensearch-service-x64

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch-service.bat to opensearch-service.bat

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename Elasticsearch to Opensearch
Rename elasticsearch to opensearch

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename ELASTIC_PASSWORD_FILE to OPENSEARCH_PASSWORD_FILE

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename ELASTICSEARCH_PASSWORD to OPENSEARCH_PASSWORD
Rename elasticsearch to opensearch

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch to opensearch

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch.log to opensearch.log

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename es-repo to opensearch-repo

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename ESTestCase to OpenSearchTestCase

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename ESRestTestCase to OpenSearchRestTestCase

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch to opensearch
Rename "Starts ElasticSearch" to "Starts OpenSearch"

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename ESElasticsearchCliTestCase to BaseOpenSearchCliTestCase

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename "elasticsearch:test" to "opensearch:test"

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename test91ElasticsearchShardCliPackaging to test91OpenSearchShardCliPackaging

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch.toString to opensearch.toString

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename elasticsearch.pid to opensearch.pid

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename "Opensearch" to "OpenSearch"
Rename "elasticsearch" to "opensearch"

Signed-off-by: Harold Wang <harowang@amazon.com>

* Rename Elasticsearch to OpenSearch
Remove unecessary dot after opensearch.

Signed-off-by: Harold Wang <harowang@amazon.com>
  • Loading branch information
harold-wang authored and nknize committed Mar 22, 2021
1 parent cf46c39 commit a011c15
Show file tree
Hide file tree
Showing 155 changed files with 637 additions and 637 deletions.
4 changes: 2 additions & 2 deletions qa/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.elasticsearch.gradle.test.RestIntegTestTask
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
import org.opensearch.gradle.test.RestIntegTestTask
import org.opensearch.gradle.testclusters.TestClustersPlugin

subprojects { Project subproj ->
subproj.tasks.withType(RestIntegTestTask) {
Expand Down
8 changes: 4 additions & 4 deletions qa/ccs-unavailable-clusters/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
apply plugin: 'elasticsearch.testclusters'
apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
apply plugin: 'elasticsearch.test-with-dependencies'
apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.standalone-rest-test'
apply plugin: 'opensearch.rest-test'
apply plugin: 'opensearch.test-with-dependencies'

dependencies {
testImplementation project(":client:rest-high-level")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import org.opensearch.common.xcontent.json.JsonXContent;
import org.opensearch.search.aggregations.InternalAggregations;
import org.opensearch.search.internal.InternalSearchResponse;
import org.opensearch.test.rest.ESRestTestCase;
import org.opensearch.test.rest.OpenSearchRestTestCase;
import org.opensearch.test.transport.MockTransportService;
import org.opensearch.threadpool.TestThreadPool;
import org.opensearch.threadpool.ThreadPool;
Expand All @@ -71,7 +71,7 @@

import static org.hamcrest.CoreMatchers.containsString;

public class CrossClusterSearchUnavailableClusterIT extends ESRestTestCase {
public class CrossClusterSearchUnavailableClusterIT extends OpenSearchRestTestCase {

private static RestHighLevelClient restHighLevelClient;

Expand Down
10 changes: 5 additions & 5 deletions qa/die-with-dignity/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import org.elasticsearch.gradle.info.BuildParams
import org.elasticsearch.gradle.util.GradleUtils
import org.opensearch.gradle.info.BuildParams
import org.opensearch.gradle.util.GradleUtils

apply plugin: 'elasticsearch.java-rest-test'
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'opensearch.java-rest-test'
apply plugin: 'opensearch.esplugin'

esplugin {
description 'Die with dignity plugin'
classname 'org.elasticsearch.DieWithDignityPlugin'
classname 'org.opensearch.DieWithDignityPlugin'
}

// let the javaRestTest see the classpath of main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.opensearch.client.Request;
import org.opensearch.common.io.PathUtils;
import org.opensearch.common.settings.Settings;
import org.opensearch.test.rest.ESRestTestCase;
import org.opensearch.test.rest.OpenSearchRestTestCase;

import java.io.BufferedReader;
import java.io.IOException;
Expand All @@ -36,14 +36,14 @@
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;

public class DieWithDignityIT extends ESRestTestCase {
public class DieWithDignityIT extends OpenSearchRestTestCase {
public void testDieWithDignity() throws Exception {
expectThrows(
IOException.class,
() -> client().performRequest(new Request("GET", "/_die_with_dignity"))
);

// the Elasticsearch process should die and disappear from the output of jps
// the OpenSearch process should die and disappear from the output of jps
assertBusy(() -> {
final String jpsPath = PathUtils.get(System.getProperty("runtime.java.home"), "bin/jps").toString();
final Process process = new ProcessBuilder().command(jpsPath, "-v").start();
Expand All @@ -57,7 +57,7 @@ public void testDieWithDignity() throws Exception {
}
});

// parse the logs and ensure that Elasticsearch died with the expected cause
// parse the logs and ensure that OpenSearch died with the expected cause
final List<String> lines = Files.readAllLines(PathUtils.get(System.getProperty("log")));

final Iterator<String> it = lines.iterator();
Expand All @@ -69,7 +69,7 @@ public void testDieWithDignity() throws Exception {
final String line = it.next();
if (line.matches(".*ERROR.*o\\.e\\.ExceptionsHelper.*javaRestTest-0.*fatal error.*")) {
fatalError = true;
} else if (line.matches(".*ERROR.*o\\.e\\.b\\.ElasticsearchUncaughtExceptionHandler.*javaRestTest-0.*"
} else if (line.matches(".*ERROR.*o\\.e\\.b\\.OpenSearchUncaughtExceptionHandler.*javaRestTest-0.*"
+ "fatal error in thread \\[Thread-\\d+\\], exiting.*")) {
fatalErrorInThreadExiting = true;
assertTrue(it.hasNext());
Expand Down Expand Up @@ -114,7 +114,7 @@ protected final Settings restClientSettings() {
// increase the timeout here to 90 seconds to handle long waits for a green
// cluster health. the waits for green need to be longer than a minute to
// account for delayed shards
.put(ESRestTestCase.CLIENT_SOCKET_TIMEOUT, "1s")
.put(OpenSearchRestTestCase.CLIENT_SOCKET_TIMEOUT, "1s")
.build();
}

Expand Down
4 changes: 2 additions & 2 deletions qa/evil-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
* threads, etc.
*/

apply plugin: 'elasticsearch.testclusters'
apply plugin: 'elasticsearch.standalone-test'
apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.standalone-test'

dependencies {
testImplementation 'com.google.jimfs:jimfs:1.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.opensearch.bootstrap;

import org.opensearch.common.SuppressForbidden;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

import java.io.FilePermission;
import java.net.SocketPermission;
Expand All @@ -37,7 +37,7 @@
* Unit tests for ESPolicy: these cannot run with security manager,
* we don't allow messing with the policy
*/
public class ESPolicyUnitTests extends ESTestCase {
public class ESPolicyUnitTests extends OpenSearchTestCase {
/**
* Test policy with null codesource.
* <p>
Expand Down Expand Up @@ -86,11 +86,11 @@ public void testListen() {
public void testDataPathPermissionIsChecked() {
assumeTrue("test cannot run with security manager", System.getSecurityManager() == null);
final PermissionCollection dataPathPermission = new Permissions();
dataPathPermission.add(new FilePermission("/home/elasticsearch/data/-", "read"));
dataPathPermission.add(new FilePermission("/home/opensearch/data/-", "read"));
final ESPolicy policy = new ESPolicy(Collections.emptyMap(), new Permissions(), Collections.emptyMap(), true, dataPathPermission);
assertTrue(
policy.implies(
new ProtectionDomain(new CodeSource(null, (Certificate[]) null), new Permissions()),
new FilePermission("/home/elasticsearch/data/index/file.si", "read")));
new FilePermission("/home/opensearch/data/index/file.si", "read")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.apache.lucene.util.Constants;
import org.opensearch.common.io.PathUtils;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -31,7 +31,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;

public class EvilJNANativesTests extends ESTestCase {
public class EvilJNANativesTests extends OpenSearchTestCase {

public void testSetMaximumNumberOfThreads() throws IOException {
if (Constants.LINUX) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasSize;

public class EvilElasticsearchCliTests extends ESElasticsearchCliTestCase {
public class EvilOpenSearchCliTests extends BaseOpenSearchCliTestCase {

@SuppressForbidden(reason = "manipulates system properties for testing")
public void testPathHome() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.env.Environment;
import org.opensearch.env.TestEnvironment;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

import java.io.FilePermission;
import java.io.IOException;
Expand All @@ -39,7 +39,7 @@
import static org.hamcrest.Matchers.hasToString;

@SuppressForbidden(reason = "modifies system properties and attempts to create symbolic links intentionally")
public class EvilSecurityTests extends ESTestCase {
public class EvilSecurityTests extends OpenSearchTestCase {

/** test generated permissions */
public void testGeneratedPermissions() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
package org.opensearch.bootstrap;

import org.apache.lucene.util.Constants;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

/** Simple tests system call filter is working. */
public class SystemCallFilterTests extends ESTestCase {
public class SystemCallFilterTests extends OpenSearchTestCase {

/** command to try to run in tests */
static final String EXECUTABLE = Constants.WINDOWS ? "calc" : "ls";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.opensearch.cli;

import joptsimple.OptionSet;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;
Expand All @@ -29,7 +29,7 @@
import static org.hamcrest.Matchers.emptyString;
import static org.hamcrest.Matchers.is;

public class EvilCommandTests extends ESTestCase {
public class EvilCommandTests extends OpenSearchTestCase {

public void testCommandShutdownHook() throws Exception {
final AtomicBoolean closed = new AtomicBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
import org.apache.lucene.util.TestRuleRestoreSystemProperties;
import org.opensearch.common.SuppressForbidden;
import org.opensearch.env.Environment;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;
import org.junit.Rule;
import org.junit.rules.TestRule;

import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasToString;

public class EvilEnvironmentAwareCommandTests extends ESTestCase {
public class EvilEnvironmentAwareCommandTests extends OpenSearchTestCase {

@Rule
public TestRule restoreSystemProperties = new TestRuleRestoreSystemProperties("es.path.conf");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

import org.opensearch.common.SuppressForbidden;
import org.opensearch.common.settings.Settings;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

public class EvilSystemPropertyTests extends ESTestCase {
public class EvilSystemPropertyTests extends OpenSearchTestCase {

@SuppressForbidden(reason = "manipulates system properties for testing")
public void testMaxNumShards() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import org.opensearch.common.SuppressForbidden;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

import static org.hamcrest.Matchers.equalTo;

public class EvilSystemPropertyTests extends ESTestCase {
public class EvilSystemPropertyTests extends OpenSearchTestCase {

@SuppressForbidden(reason = "manipulates system properties for testing")
public void testDisableSearchAllocationAwareness() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.opensearch.cli.UserException;
import org.opensearch.common.settings.Settings;
import org.opensearch.env.Environment;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -42,7 +42,7 @@
import static org.hamcrest.Matchers.hasToString;
import static org.hamcrest.Matchers.notNullValue;

public class EvilLoggerConfigurationTests extends ESTestCase {
public class EvilLoggerConfigurationTests extends OpenSearchTestCase {

@Override
public void setUp() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.opensearch.common.util.concurrent.ThreadContext;
import org.opensearch.env.Environment;
import org.opensearch.node.Node;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.test.hamcrest.RegexMatcher;

import java.io.IOException;
Expand All @@ -64,7 +64,7 @@
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.Matchers.startsWith;

public class EvilLoggerTests extends ESTestCase {
public class EvilLoggerTests extends OpenSearchTestCase {

@Override
public void setUp() throws Exception {
Expand Down Expand Up @@ -211,7 +211,7 @@ public void testDeprecatedSettings() throws IOException, UserException {
deprecationEvents.get(0),
DEPRECATION,
"org.opensearch.common.logging.DeprecationLogger\\$DeprecationLoggerBuilder.withDeprecation",
"\\[deprecated.foo\\] setting was deprecated in Elasticsearch and will be removed in a future release! " +
"\\[deprecated.foo\\] setting was deprecated in OpenSearch and will be removed in a future release! " +
"See the breaking changes documentation for the next major version.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.lucene.util.LuceneTestCase;
import org.opensearch.cli.ExitCodes;
import org.opensearch.cli.UserException;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

import java.nio.file.AccessDeniedException;
import java.nio.file.Files;
Expand All @@ -38,7 +38,7 @@
import static org.hamcrest.Matchers.instanceOf;

@LuceneTestCase.SuppressFileSystems("ExtrasFS")
public class EvilKeyStoreWrapperTests extends ESTestCase {
public class EvilKeyStoreWrapperTests extends OpenSearchTestCase {

public void testWritePermissions() throws Exception {
assumeFalse("requires POSIX file permissions", Constants.WINDOWS);
Expand All @@ -53,8 +53,8 @@ public void testWritePermissions() throws Exception {
final UserException e = expectThrows(UserException.class, () -> wrapper.save(configDir, new char[0]));
final String expected = String.format(
Locale.ROOT,
"unable to create temporary keystore at [%s], write permissions required for [%s] or run [elasticsearch-keystore upgrade]",
configDir.resolve("elasticsearch.keystore.tmp"),
"unable to create temporary keystore at [%s], write permissions required for [%s] or run [opensearch-keystore upgrade]",
configDir.resolve("opensearch.keystore.tmp"),
configDir);
assertThat(e, hasToString(containsString(expected)));
assertThat(e.exitCode, equalTo(ExitCodes.CONFIG));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.opensearch.common.io.PathUtils;
import org.opensearch.common.settings.Settings;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.test.PosixPermissionsResetter;
import org.junit.BeforeClass;

Expand All @@ -32,7 +32,7 @@
import java.util.Arrays;
import java.util.HashSet;

public class NodeEnvironmentEvilTests extends ESTestCase {
public class NodeEnvironmentEvilTests extends OpenSearchTestCase {

private static boolean isPosix;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.apache.lucene.util.Constants;
import org.opensearch.common.io.PathUtils;
import org.opensearch.test.ESTestCase;
import org.opensearch.test.OpenSearchTestCase;

import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -32,7 +32,7 @@

import static org.hamcrest.Matchers.equalTo;

public class EvilOsProbeTests extends ESTestCase {
public class EvilOsProbeTests extends OpenSearchTestCase {

public void testOsPrettyName() throws IOException {
final OsInfo osInfo = OsProbe.getInstance().osInfo(randomLongBetween(1, 100), randomIntBetween(1, 8));
Expand Down
Loading

0 comments on commit a011c15

Please sign in to comment.