From 205f2b430592842be4e8a18b04b69d7a440dcf7a Mon Sep 17 00:00:00 2001 From: Angie Zhang Date: Thu, 30 Mar 2023 14:20:26 -0700 Subject: [PATCH] Add bwcBundleTest back Signed-off-by: Angie Zhang --- build.gradle | 98 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 76 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 53c8884b3..596641661 100644 --- a/build.gradle +++ b/build.gradle @@ -608,6 +608,8 @@ task integTestRemote(type: RestIntegTestTask) { String bwcVersionShort = "2.5.0" String bwcVersion = bwcVersionShort + ".0" +Boolean bwcBundleTest = (project.findProperty('customDistributionDownloadType') != null && + project.properties['customDistributionDownloadType'] == "bundle"); String baseName = "indexmanagementBwcCluster" String bwcFilePath = "src/test/resources/bwc/" String bwc_js_resource_location = bwcFilePath + "job-scheduler/" + bwcVersion @@ -621,35 +623,87 @@ String bwc_js_download_url = 'https://ci.opensearch.org/ci/dbc/distribution-buil String bwc_im_download_url = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + bwcVersionShort + '/latest/linux/x64/tar/builds/' + 'opensearch/plugins/opensearch-index-management-' + bwcVersion + '.zip' -2.times { i -> +2.times {i -> testClusters { - "${baseName}$i" { + "${baseName}$i"{ testDistribution = "ARCHIVE" - versions = [bwcVersionShort, opensearch_version] numberOfNodes = 3 - plugin(provider(new Callable() { - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - return getPluginResource(bwc_js_resource_location, bwc_js_download_url) + if (bwcBundleTest) { + versions = [ + "1.3.2", bwcCurrentVersion + ] + nodes.each { node -> + node.extraConfigFile("kirk.pem", file("src/test/resources/security/kirk.pem")) + node.extraConfigFile("kirk-key.pem", file("src/test/resources/security/kirk-key.pem")) + node.extraConfigFile("esnode.pem", file("src/test/resources/security/esnode.pem")) + node.extraConfigFile("esnode-key.pem", file("src/test/resources/security/esnode-key.pem")) + node.extraConfigFile("root-ca.pem", file("src/test/resources/security/root-ca.pem")) + node.setting("plugins.security.disabled", + "true") + node.setting("plugins.security.ssl.transport.pemcert_filepath", + "esnode.pem") + node.setting("plugins.security.ssl.transport.pemkey_filepath", + "esnode-key.pem") + node.setting("plugins.security.ssl.transport.pemtrustedcas_filepath", + "root-ca.pem") + node.setting("plugins.security.ssl.transport.enforce_hostname_verification", + "false") + node.setting("plugins.security.ssl.http.enabled", + "true") + node.setting("plugins.security.ssl.http.pemcert_filepath", + "esnode.pem") + node.setting("plugins.security.ssl.http.pemkey_filepath", + "esnode-key.pem") + node.setting("plugins.security.ssl.http.pemtrustedcas_filepath", + "root-ca.pem") + node.setting("plugins.security.allow_unsafe_democertificates", + "true") + node.setting("plugins.security.allow_default_init_securityindex", + "true") + node.setting("plugins.security.authcz.admin_dn", + "\n - CN=kirk,OU=client,O=client,L=test,C=de") + node.setting("plugins.security.audit.type", + "internal_elasticsearch") + node.setting("plugins.security.enable_snapshot_restore_privilege", + "true") + node.setting("plugins.security.check_snapshot_restore_write_privileges", + "true") + node.setting("plugins.security.restapi.roles_enabled", + "[\"all_access\", \"security_rest_api_access\"]") + node.setting("plugins.security.system_indices.enabled", + "true") + } + } else { + versions = [ + "7.10.2", opensearch_version + ] + plugin(provider(new Callable(){ + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + return getPluginResource(bwc_js_resource_location, bwc_js_download_url) + } } } - } - })) - plugin(provider(new Callable() { - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - return getPluginResource(bwc_im_resource_location, bwc_im_download_url) + })) + + plugin(provider(new Callable(){ + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + return getPluginResource(bwc_im_resource_location, bwc_im_download_url) + } } } - } - })) - setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + })) + } + + setting 'path.repo', + "${buildDir}/cluster/shared/repo/${baseName}" setting 'http.content_type.required', 'true' } }