Skip to content

Commit

Permalink
LRQA-54230 Add cross cluster replication smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
Linda Sui authored and brianchandotcom committed Feb 26, 2020
1 parent 6ff3279 commit 72baa64
Showing 1 changed file with 110 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,116 @@ definition {
locator1 = "Search#SIMILAR_RESULTS_LINK_TITLE");
}

@priority = "5"
test CrossClusterReplicationSmoke {
property osgi.app.includes = "portal-search-elasticsearch-cross-cluster-replication,portal-search-elasticsearch7";
property osgi.module.configuration.file.names = "com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConnectionConfiguration-default_ccr.config:com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration.config";
property osgi.module.configurations = "connectionId="ccr"${line.separator}networkHostAddresses=["http://localhost:9202"]:blacklistBundleSymbolicNames="com.liferay.portal.mobile.device.detection.fiftyonedegrees.api,com.liferay.portal.mobile.device.detection.fiftyonedegrees.enterprise,com.liferay.portal.mobile.device.detection.fiftyonedegrees.enterprise.test.data,com.liferay.portal.mobile.device.detection.fiftyonedegrees,com.liferay.portal.search.elasticsearch6.impl,com.liferay.portal.search.elasticsearch6.spi,com.liferay.portal.search.elasticsearch6.api,com.liferay.portal.search.elasticsearch6.xpack.security.impl,com.liferay.portal.search.elasticsearch6.xpack.monitoring.web"";
property remote.elasticsearch.enabled = "true";
property remote.elasticsearch.ccr.enabled = "true";
property test.name.skip.portal.instance = "Elasticsearch7EE#CrossClusterReplicationSmoke";

JSONDocument.addFile(
dmDocumentDescription = "DM Description",
dmDocumentTitle = "DM Title 1",
groupName = "Guest");

AntCommand(
locator1 = "build-test-elasticsearch7.xml",
value1 = "replicate-indices");

ProductMenu.gotoPortlet(
category = "Configuration",
panel = "Control Panel",
portlet = "System Settings");

SystemSettings.gotoConfiguration(
configurationCategory = "Search",
configurationName = "Cross-Cluster Replication",
configurationScope = "System Scope");

SystemSettings.configureCrossClusterReplication(ccrLocalClusterConnectionID = "ccr");

ProductMenu.gotoPortlet(
category = "Configuration",
panel = "Control Panel",
portlet = "Search");

AssertTextEquals(
locator1 = "Portlet#HEADER",
value1 = "Search");

var searchClientInfo = selenium.getText("//div[contains(@class,'alert alert-info')]//strong[3]");

if (contains("${searchClientInfo}", "Remote Cluster = LiferayElasticsearchCluster") && contains("searchClientInfo", "Local Cluster = LiferayElasticsearchClusterTwo")) {
fail("There should be two search engines.");
}

Navigator.openURL();

SearchPortlets.searchEmbedded(searchTerm = "DM");

SearchResultPortlet.viewSearchResults(
searchAssetTitle = "DM Title 1",
searchAssetType = "Document");

AntCommand(
locator1 = "build-test-elasticsearch7.xml",
value1 = "stop-elasticsearch");

ProductMenu.gotoPortlet(
category = "Configuration",
panel = "Control Panel",
portlet = "Search");

AssertTextEquals(
locator1 = "Portlet#HEADER",
value1 = "Search");

var searchClientInfo = selenium.getText("//div[contains(@class,'alert alert-info')]//strong[3]");

if (contains("${searchClientInfo}", "Remote Cluster = (Error: java.net.ConnectException") && contains("searchClientInfo", "Local Cluster = LiferayElasticsearchClusterTwo")) {
fail("Remote cluster does not be stopped.");
}

Navigator.openURL();

SearchPortlets.searchEmbedded(searchTerm = "DM");

SearchResultPortlet.viewSearchResults(
searchAssetTitle = "DM Title 1",
searchAssetType = "Document");

AntCommand(
locator1 = "build-test-elasticsearch7.xml",
value1 = "start-elasticsearch-node -Dremote.elasticsearch.cluster.size=1");

AntCommand(
locator1 = "build-test-elasticsearch7.xml",
value1 = "stop-follower-elasticsearch");

ProductMenu.gotoPortlet(
category = "Configuration",
panel = "Control Panel",
portlet = "Search");

AssertTextEquals(
locator1 = "Portlet#HEADER",
value1 = "Search");

var searchClientInfo = selenium.getText("//div[contains(@class,'alert alert-info')]//strong[3]");

if (contains("${searchClientInfo}", "Remote Cluster = LiferayElasticsearchCluster") && contains("searchClientInfo", "Local Cluster = (Error: java.net.ConnectException")) {
fail("Local Cluster does not be stopped");
}

Navigator.openURL();

SearchPortlets.searchEmbedded(searchTerm = "DM");

SearchResultPortlet.viewSearchResultNotPresent(searchTerm = "DM");
}

test HotDeployLearningToRankApp {
property hot.deploy.osgi.app.includes = "portal-search-learning-to-rank";
property test.assert.warning.exceptions = "true";
Expand Down

0 comments on commit 72baa64

Please sign in to comment.