From b7d5692a0ce031c96cc398fbda808fbbdbcad8b9 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Wed, 18 Oct 2023 10:49:52 -0700 Subject: [PATCH] Improve test avoidance This commit fixes a number of instances where we've broken test avoidance due to dynamic or changing inputs that should be ignored. Common instances are things like absolute paths or test fixture addresses that contain changing ports. --- plugins/discovery-ec2/build.gradle | 4 ++-- plugins/repository-hdfs/build.gradle | 4 ++-- .../qa/downgrade-to-basic-license/build.gradle | 6 +++--- x-pack/plugin/ccr/qa/multi-cluster/build.gradle | 7 ++++--- .../ccr/qa/non-compliant-license/build.gradle | 5 +++-- x-pack/plugin/ccr/qa/restart/build.gradle | 3 ++- x-pack/plugin/ccr/qa/security/build.gradle | 3 ++- .../qa/multi-cluster-with-security/build.gradle | 3 ++- x-pack/plugin/ilm/qa/multi-cluster/build.gradle | 13 +++++++------ x-pack/plugin/ilm/qa/multi-node/build.gradle | 5 +++-- .../build.gradle | 3 ++- .../searchable-snapshots/qa/rest/build.gradle | 6 ++++-- .../searchable-snapshots/qa/url/build.gradle | 4 ++-- x-pack/plugin/slm/qa/multi-node/build.gradle | 5 +++-- .../snapshot-based-recoveries/qa/fs/build.gradle | 6 ++++-- .../qa/license-enforcing/build.gradle | 4 ++-- .../snapshot-repo-test-kit/qa/rest/build.gradle | 6 ++++-- .../multi-cluster-with-security/build.gradle | 3 ++- .../build.gradle | 3 ++- .../vector-tile/qa/multi-cluster/build.gradle | 4 ++-- x-pack/qa/kerberos-tests/build.gradle | 15 ++++++++++----- .../legacy-with-basic-license/build.gradle | 5 +++-- .../legacy-with-full-license/build.gradle | 5 +++-- .../legacy-with-restricted-trust/build.gradle | 5 +++-- x-pack/qa/repository-old-versions/build.gradle | 5 +++-- x-pack/qa/saml-idp-tests/build.gradle | 6 ++++++ 26 files changed, 85 insertions(+), 53 deletions(-) diff --git a/plugins/discovery-ec2/build.gradle b/plugins/discovery-ec2/build.gradle index b21f6224c9fc2..5107bb9051bd1 100644 --- a/plugins/discovery-ec2/build.gradle +++ b/plugins/discovery-ec2/build.gradle @@ -95,9 +95,9 @@ tasks.named("test").configure { // this is needed to manipulate com.amazonaws.sdk.ec2MetadataServiceEndpointOverride system property // it is better rather disable security manager at all with `systemProperty 'tests.security.manager', 'false'` if (BuildParams.inFipsJvm){ - systemProperty 'java.security.policy', "=file://${buildDir}/tmp/java.policy" + nonInputProperties.systemProperty 'java.security.policy', "=file://${buildDir}/tmp/java.policy" } else { - systemProperty 'java.security.policy', "file://${buildDir}/tmp/java.policy" + nonInputProperties.systemProperty 'java.security.policy', "file://${buildDir}/tmp/java.policy" } } diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index 78809a170fbbd..cd9849710818f 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -281,7 +281,7 @@ tasks.withType(RestIntegTestTask).configureEach { testTask -> if (disabledIntegTestTaskNames.contains(name) == false) { nonInputProperties.systemProperty "test.krb5.principal.es", "elasticsearch@${realm}" nonInputProperties.systemProperty "test.krb5.principal.hdfs", "hdfs/hdfs.build.elastic.co@${realm}" - jvmArgs "-Djava.security.krb5.conf=${project.configurations.krb5Config.getSingleFile().getPath()}" + nonInputProperties.systemProperty "Djava.security.krb5.conf", "${project.configurations.krb5Config.getSingleFile().getPath()}" nonInputProperties.systemProperty( "test.krb5.keytab.hdfs", new File(project.configurations.krb5Keytabs.singleFile, "hdfs_hdfs.build.elastic.co.keytab").getPath() @@ -291,7 +291,7 @@ tasks.withType(RestIntegTestTask).configureEach { testTask -> testClusters.matching { it.name == testTask.name }.configureEach { if (testTask.name.contains("Secure")) { - systemProperty "java.security.krb5.conf", configurations.krb5Config.singleFile.getPath() + systemProperty "java.security.krb5.conf", configurations.krb5Config.singleFile.getPath(), IGNORE_VALUE extraConfigFile( "repository-hdfs/krb5.keytab", new File(project.configurations.krb5Keytabs.singleFile, "elasticsearch.keytab"), diff --git a/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle b/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle index 3eaf6f267a545..da39d221f92f1 100644 --- a/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle +++ b/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle @@ -1,5 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' @@ -23,8 +24,7 @@ def followCluster = testClusters.register("follow-cluster") { setting 'xpack.license.self_generated.type', 'trial' setting 'xpack.security.enabled', 'true' user username: 'admin', password: 'admin-password', role: 'superuser' - setting 'cluster.remote.leader_cluster.seeds', { "\"${leaderCluster.get().getAllTransportPortURI().join(",")}\"" - } + setting 'cluster.remote.leader_cluster.seeds', { "\"${leaderCluster.get().getAllTransportPortURI().join(",")}\"" }, IGNORE_VALUE } tasks.register("leader-cluster", RestIntegTestTask) { @@ -51,8 +51,8 @@ tasks.register("writeJavaPolicy") { tasks.register("follow-cluster", RestIntegTestTask) { dependsOn 'writeJavaPolicy', "leader-cluster" useCluster leaderCluster - systemProperty 'java.security.policy', "file://${policyFile}" systemProperty 'tests.target_cluster', 'follow' + nonInputProperties.systemProperty 'java.security.policy', "file://${policyFile}" nonInputProperties.systemProperty 'tests.leader_host', leaderCluster.map(c -> c.allHttpSocketURI.get(0)) nonInputProperties.systemProperty 'log', followCluster.map(c -> c.getFirstNode().getServerLog()) } diff --git a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle index 31cdf04f6dc94..2475a56aa87aa 100644 --- a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle @@ -1,6 +1,7 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' @@ -25,7 +26,7 @@ def middleCluster = testClusters.register('middle-cluster') { setting 'xpack.security.enabled', 'true' user username: 'admin', password: 'admin-password', role: 'superuser' setting 'cluster.remote.leader_cluster.seeds', - { "\"${leaderCluster.get().getAllTransportPortURI().join(",")}\"" } + { "\"${leaderCluster.get().getAllTransportPortURI().join(",")}\"" }, IGNORE_VALUE } tasks.register("leader-cluster", RestIntegTestTask) { @@ -60,9 +61,9 @@ testClusters.matching {it.name == "follow-cluster" }.configureEach { setting 'xpack.security.enabled', 'true' user username: 'admin', password: 'admin-password', role: 'superuser' setting 'cluster.remote.leader_cluster.seeds', - { "\"${leaderCluster.get().getAllTransportPortURI().join(",")}\"" } + { "\"${leaderCluster.get().getAllTransportPortURI().join(",")}\"" }, IGNORE_VALUE setting 'cluster.remote.middle_cluster.seeds', - { "\"${middleCluster.get().getAllTransportPortURI().join(",")}\"" } + { "\"${middleCluster.get().getAllTransportPortURI().join(",")}\"" }, IGNORE_VALUE } diff --git a/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle b/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle index 67465bc782ad9..7661ea08b057d 100644 --- a/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle +++ b/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle @@ -1,4 +1,5 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' @@ -21,7 +22,7 @@ def followerCluster = testClusters.register('follow-cluster') { setting 'xpack.security.enabled', 'true' user username: 'admin', password: 'admin-password', role: 'superuser' setting 'cluster.remote.leader_cluster.seeds', - { "\"${leaderCluster.get().getAllTransportPortURI().join(",")}\"" } + { "\"${leaderCluster.get().getAllTransportPortURI().join(",")}\"" }, IGNORE_VALUE } tasks.register('leader-cluster', RestIntegTestTask) { @@ -36,4 +37,4 @@ tasks.register('follow-cluster', RestIntegTestTask) { nonInputProperties.systemProperty 'tests.leader_host', followerCluster.map(c -> c.allHttpSocketURI.get(0)) } -tasks.named("check").configure { dependsOn "follow-cluster" } \ No newline at end of file +tasks.named("check").configure { dependsOn "follow-cluster" } diff --git a/x-pack/plugin/ccr/qa/restart/build.gradle b/x-pack/plugin/ccr/qa/restart/build.gradle index d354cd911f2f8..47d37801e2dcf 100644 --- a/x-pack/plugin/ccr/qa/restart/build.gradle +++ b/x-pack/plugin/ccr/qa/restart/build.gradle @@ -1,5 +1,6 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' @@ -22,7 +23,7 @@ def followCluster = testClusters.register('follow-cluster') { setting 'xpack.security.enabled', 'true' user username: 'admin', password: 'admin-password', role: 'superuser' setting 'cluster.remote.leader_cluster.seeds', - { "\"${leaderCluster.get().getAllTransportPortURI().get(0)}\"" } + { "\"${leaderCluster.get().getAllTransportPortURI().get(0)}\"" }, IGNORE_VALUE nameCustomization = { 'follow' } } diff --git a/x-pack/plugin/ccr/qa/security/build.gradle b/x-pack/plugin/ccr/qa/security/build.gradle index ff4a4f857fe32..5515aefeaa091 100644 --- a/x-pack/plugin/ccr/qa/security/build.gradle +++ b/x-pack/plugin/ccr/qa/security/build.gradle @@ -1,4 +1,5 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' @@ -22,7 +23,7 @@ testClusters.register('follow-cluster') { testDistribution = 'DEFAULT' setting 'cluster.remote.leader_cluster.seeds', { "\"${leadCluster.get().getAllTransportPortURI().join(",")}\"" - } + }, IGNORE_VALUE setting 'xpack.license.self_generated.type', 'trial' setting 'xpack.security.enabled', 'true' setting 'xpack.monitoring.collection.enabled', 'false' // will be enabled by tests diff --git a/x-pack/plugin/eql/qa/multi-cluster-with-security/build.gradle b/x-pack/plugin/eql/qa/multi-cluster-with-security/build.gradle index 5fc247693c453..47a405517a309 100644 --- a/x-pack/plugin/eql/qa/multi-cluster-with-security/build.gradle +++ b/x-pack/plugin/eql/qa/multi-cluster-with-security/build.gradle @@ -1,4 +1,5 @@ import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.legacy-java-rest-test' @@ -24,7 +25,7 @@ def integTestClusterReg = testClusters.register('javaRestTest') { setting 'xpack.watcher.enabled', 'false' setting 'cluster.remote.my_remote_cluster.seeds', { remoteClusterReg.get().getAllTransportPortURI().collect { "\"$it\"" }.toString() - } + }, IGNORE_VALUE setting 'cluster.remote.connections_per_cluster', "1" setting 'xpack.security.enabled', 'true' setting 'xpack.security.autoconfiguration.enabled', 'false' diff --git a/x-pack/plugin/ilm/qa/multi-cluster/build.gradle b/x-pack/plugin/ilm/qa/multi-cluster/build.gradle index a1a2a5129e3f7..111496669afe3 100644 --- a/x-pack/plugin/ilm/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-cluster/build.gradle @@ -1,5 +1,6 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask import org.elasticsearch.gradle.internal.info.BuildParams +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' @@ -16,12 +17,12 @@ tasks.register('leader-cluster', RestIntegTestTask) { mustRunAfter("precommit") systemProperty 'tests.target_cluster', 'leader' /* To support taking index snapshots, we have to set path.repo setting */ - systemProperty 'tests.path.repo', repoDir.absolutePath + nonInputProperties.systemProperty 'tests.path.repo', repoDir.absolutePath } testClusters.matching { it.name == 'leader-cluster' }.configureEach { testDistribution = 'DEFAULT' - setting 'path.repo', repoDir.absolutePath + setting 'path.repo', repoDir.absolutePath, IGNORE_VALUE setting 'xpack.ccr.enabled', 'true' setting 'xpack.security.enabled', 'false' setting 'xpack.watcher.enabled', 'false' @@ -39,12 +40,12 @@ tasks.register('follow-cluster', RestIntegTestTask) { nonInputProperties.systemProperty 'tests.leader_remote_cluster_seed', "${-> testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}" /* To support taking index snapshots, we have to set path.repo setting */ - systemProperty 'tests.path.repo', repoDir.absolutePath + nonInputProperties.systemProperty 'tests.path.repo', repoDir.absolutePath } testClusters.matching{ it.name == 'follow-cluster' }.configureEach { testDistribution = 'DEFAULT' - setting 'path.repo', repoDir.absolutePath + setting 'path.repo', repoDir.absolutePath, IGNORE_VALUE setting 'xpack.ccr.enabled', 'true' setting 'xpack.security.enabled', 'false' setting 'xpack.watcher.enabled', 'false' @@ -52,11 +53,11 @@ testClusters.matching{ it.name == 'follow-cluster' }.configureEach { setting 'xpack.license.self_generated.type', 'trial' setting 'indices.lifecycle.poll_interval', '1000ms' setting 'cluster.remote.leader_cluster.seeds', - { "\"${testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}\"" } + { "\"${testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}\"" }, IGNORE_VALUE } tasks.named("check").configure { dependsOn 'follow-cluster' } // Security is explicitly disabled for follow-cluster and leader-cluster, do not run these in FIPS mode tasks.withType(Test).configureEach { enabled = BuildParams.inFipsJvm == false -} \ No newline at end of file +} diff --git a/x-pack/plugin/ilm/qa/multi-node/build.gradle b/x-pack/plugin/ilm/qa/multi-node/build.gradle index 523bf5d04ae4f..ef20d57d83f59 100644 --- a/x-pack/plugin/ilm/qa/multi-node/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-node/build.gradle @@ -1,4 +1,5 @@ import org.elasticsearch.gradle.internal.info.BuildParams +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.legacy-java-rest-test' @@ -12,14 +13,14 @@ File repoDir = file("$buildDir/testclusters/repo") tasks.named("javaRestTest").configure { /* To support taking index snapshots, we have to set path.repo setting */ - systemProperty 'tests.path.repo', repoDir + nonInputProperties.systemProperty 'tests.path.repo', repoDir } testClusters.configureEach { testDistribution = 'DEFAULT' numberOfNodes = 4 - setting 'path.repo', repoDir.absolutePath + setting 'path.repo', repoDir.absolutePath, IGNORE_VALUE setting 'xpack.searchable.snapshot.shared_cache.size', '16MB' setting 'xpack.searchable.snapshot.shared_cache.region_size', '256KB' setting 'xpack.security.enabled', 'false' diff --git a/x-pack/plugin/ml/qa/multi-cluster-tests-with-security/build.gradle b/x-pack/plugin/ml/qa/multi-cluster-tests-with-security/build.gradle index 368aab4615fc7..1cc37f5c4ffc0 100644 --- a/x-pack/plugin/ml/qa/multi-cluster-tests-with-security/build.gradle +++ b/x-pack/plugin/ml/qa/multi-cluster-tests-with-security/build.gradle @@ -1,6 +1,7 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.VersionProperties +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' @@ -39,7 +40,7 @@ testClusters.register('mixed-cluster') { setting 'xpack.license.self_generated.type', 'trial' setting 'cluster.remote.my_remote_cluster.seeds', { remoteCluster.get().getAllTransportPortURI().collect { "\"$it\"" }.toString() - } + }, IGNORE_VALUE setting 'cluster.remote.connections_per_cluster', "1" user username: "test_user", password: "x-pack-test-password" diff --git a/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle b/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle index b8c0127d0586a..595d05e05b410 100644 --- a/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle @@ -1,3 +1,5 @@ +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE + apply plugin: 'elasticsearch.legacy-java-rest-test' apply plugin: 'elasticsearch.legacy-yaml-rest-test' apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test' @@ -15,12 +17,12 @@ restResources { } tasks.withType(Test).configureEach { - systemProperty 'tests.path.repo', repoDir + nonInputProperties.systemProperty 'tests.path.repo', repoDir } testClusters.configureEach { testDistribution = 'DEFAULT' - setting 'path.repo', repoDir.absolutePath + setting 'path.repo', repoDir.absolutePath, IGNORE_VALUE setting 'xpack.license.self_generated.type', 'trial' setting 'xpack.searchable.snapshot.shared_cache.size', '16MB' diff --git a/x-pack/plugin/searchable-snapshots/qa/url/build.gradle b/x-pack/plugin/searchable-snapshots/qa/url/build.gradle index 160eb8d28cbcc..12fc0873958e1 100644 --- a/x-pack/plugin/searchable-snapshots/qa/url/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/url/build.gradle @@ -29,13 +29,13 @@ File repositoryDir = fixture.fsRepositoryDir as File tasks.named("javaRestTest").configure { dependsOn fixture.getTasks().named("postProcessFixture") - systemProperty 'test.url.fs.repo.dir', repositoryDir.absolutePath + nonInputProperties.systemProperty 'test.url.fs.repo.dir', repositoryDir.absolutePath nonInputProperties.systemProperty 'test.url.http', "${-> fixtureAddress('nginx-fixture')}" } testClusters.matching { it.name == "javaRestTest" }.configureEach { testDistribution = 'DEFAULT' - setting 'path.repo', repositoryDir.absolutePath + setting 'path.repo', repositoryDir.absolutePath, IGNORE_VALUE setting 'repositories.url.allowed_urls', { "${-> fixtureAddress('nginx-fixture')}" }, IGNORE_VALUE setting 'xpack.license.self_generated.type', 'trial' diff --git a/x-pack/plugin/slm/qa/multi-node/build.gradle b/x-pack/plugin/slm/qa/multi-node/build.gradle index 999f6e6a79c7c..b02fe7cd44fbd 100644 --- a/x-pack/plugin/slm/qa/multi-node/build.gradle +++ b/x-pack/plugin/slm/qa/multi-node/build.gradle @@ -1,4 +1,5 @@ import org.elasticsearch.gradle.internal.info.BuildParams +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.legacy-java-rest-test' @@ -12,14 +13,14 @@ File repoDir = file("$buildDir/testclusters/repo") tasks.named("javaRestTest").configure { /* To support taking index snapshots, we have to set path.repo setting */ - systemProperty 'tests.path.repo', repoDir + nonInputProperties.systemProperty 'tests.path.repo', repoDir } testClusters.configureEach { testDistribution = 'DEFAULT' numberOfNodes = 4 - setting 'path.repo', repoDir.absolutePath + setting 'path.repo', repoDir.absolutePath, IGNORE_VALUE setting 'xpack.searchable.snapshot.shared_cache.size', '16MB' setting 'xpack.searchable.snapshot.shared_cache.region_size', '256KB' setting 'xpack.security.enabled', 'false' diff --git a/x-pack/plugin/snapshot-based-recoveries/qa/fs/build.gradle b/x-pack/plugin/snapshot-based-recoveries/qa/fs/build.gradle index 0c0c1930f8601..d116a2d11e22d 100644 --- a/x-pack/plugin/snapshot-based-recoveries/qa/fs/build.gradle +++ b/x-pack/plugin/snapshot-based-recoveries/qa/fs/build.gradle @@ -6,6 +6,8 @@ * Side Public License, v 1. */ +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE + apply plugin: 'elasticsearch.legacy-java-rest-test' apply plugin: 'elasticsearch.rest-resources' @@ -25,7 +27,7 @@ tasks.withType(Test).configureEach { doFirst { delete(repoDir) } - systemProperty 'tests.path.repo', repoDir + nonInputProperties.systemProperty 'tests.path.repo', repoDir } testClusters.matching { it.name == "javaRestTest" }.configureEach { @@ -33,6 +35,6 @@ testClusters.matching { it.name == "javaRestTest" }.configureEach { numberOfNodes = 3 setting 'xpack.license.self_generated.type', 'trial' - setting 'path.repo', repoDir.absolutePath + setting 'path.repo', repoDir.absolutePath, IGNORE_VALUE setting 'xpack.security.enabled', 'false' } diff --git a/x-pack/plugin/snapshot-based-recoveries/qa/license-enforcing/build.gradle b/x-pack/plugin/snapshot-based-recoveries/qa/license-enforcing/build.gradle index 1c9a877507791..3a95cfe3bc791 100644 --- a/x-pack/plugin/snapshot-based-recoveries/qa/license-enforcing/build.gradle +++ b/x-pack/plugin/snapshot-based-recoveries/qa/license-enforcing/build.gradle @@ -27,7 +27,7 @@ tasks.withType(Test).configureEach { doFirst { delete(repoDir) } - systemProperty 'tests.path.repo', repoDir + nonInputPrperties.systemProperty 'tests.path.repo', repoDir } testClusters.matching { it.name == "javaRestTest" }.configureEach { @@ -37,6 +37,6 @@ testClusters.matching { it.name == "javaRestTest" }.configureEach { // This project tests that enterprise licensing is enforced, // therefore we use a basic license setting 'xpack.license.self_generated.type', 'basic' - setting 'path.repo', repoDir.absolutePath + setting 'path.repo', repoDir.absolutePath, IGNORE_VALUE setting 'xpack.security.enabled', 'false' } diff --git a/x-pack/plugin/snapshot-repo-test-kit/qa/rest/build.gradle b/x-pack/plugin/snapshot-repo-test-kit/qa/rest/build.gradle index 6b32e11ef81d4..17df249b08cf6 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/qa/rest/build.gradle +++ b/x-pack/plugin/snapshot-repo-test-kit/qa/rest/build.gradle @@ -1,3 +1,5 @@ +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE + apply plugin: 'elasticsearch.legacy-yaml-rest-test' apply plugin: 'elasticsearch.rest-resources' @@ -9,12 +11,12 @@ dependencies { final File repoDir = file("$buildDir/testclusters/repo") tasks.named("yamlRestTest").configure { - systemProperty 'tests.path.repo', repoDir + nonInputProperties.systemProperty 'tests.path.repo', repoDir } testClusters.matching { it.name == "yamlRestTest" }.configureEach { testDistribution = 'DEFAULT' - setting 'path.repo', repoDir.absolutePath + setting 'path.repo', repoDir.absolutePath, IGNORE_VALUE setting 'xpack.security.enabled', 'false' } diff --git a/x-pack/plugin/sql/qa/server/multi-cluster-with-security/build.gradle b/x-pack/plugin/sql/qa/server/multi-cluster-with-security/build.gradle index b56d8ff211990..b42ae29e257f0 100644 --- a/x-pack/plugin/sql/qa/server/multi-cluster-with-security/build.gradle +++ b/x-pack/plugin/sql/qa/server/multi-cluster-with-security/build.gradle @@ -1,4 +1,5 @@ import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.legacy-java-rest-test' @@ -25,7 +26,7 @@ def javaRestTestClusterReg = testClusters.register('javaRestTest') { setting 'xpack.watcher.enabled', 'false' setting 'cluster.remote.my_remote_cluster.seeds', { remoteClusterReg.get().getAllTransportPortURI().collect { "\"$it\"" }.toString() - } + }, IGNORE_VALUE setting 'cluster.remote.connections_per_cluster', "1" setting 'xpack.security.enabled', 'true' setting 'xpack.license.self_generated.type', 'trial' diff --git a/x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle b/x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle index 7c0eaf1450567..ef34db62e5e03 100644 --- a/x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle +++ b/x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle @@ -1,6 +1,7 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.VersionProperties +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' @@ -43,7 +44,7 @@ testClusters.register('mixed-cluster') { setting 'xpack.license.self_generated.type', 'trial' setting 'cluster.remote.my_remote_cluster.seeds', { remoteCluster.get().getAllTransportPortURI().collect { "\"$it\"" }.toString() - } + }, IGNORE_VALUE setting 'cluster.remote.connections_per_cluster', "1" user username: "test_user", password: "x-pack-test-password" diff --git a/x-pack/plugin/vector-tile/qa/multi-cluster/build.gradle b/x-pack/plugin/vector-tile/qa/multi-cluster/build.gradle index ea20c8eacd172..30b032c1cae1a 100644 --- a/x-pack/plugin/vector-tile/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/vector-tile/qa/multi-cluster/build.gradle @@ -6,7 +6,7 @@ */ import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask - +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.legacy-java-rest-test' dependencies { @@ -27,7 +27,7 @@ def localCluster = testClusters.register('local') { setting 'xpack.security.enabled', 'true' user username: 'admin', password: 'admin-password', role: 'superuser' setting 'cluster.remote.other.seeds', - { "\"${remoteCluster.get().getAllTransportPortURI().join(",")}\"" } + { "\"${remoteCluster.get().getAllTransportPortURI().join(",")}\"" }, IGNORE_VALUE } diff --git a/x-pack/qa/kerberos-tests/build.gradle b/x-pack/qa/kerberos-tests/build.gradle index 30fac49096679..62d6f0a1e34b8 100644 --- a/x-pack/qa/kerberos-tests/build.gradle +++ b/x-pack/qa/kerberos-tests/build.gradle @@ -12,6 +12,13 @@ dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('security')))) } +normalization { + runtimeClasspath { + ignore 'krb5.conf' + ignore '*.keytab' + } +} + tasks.register("copyKeytabToGeneratedResources", Copy) { from project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("peppa", "peppa.keytab") into "$buildDir/generated-resources/keytabs" @@ -28,6 +35,7 @@ tasks.register("copyConfToGeneratedResources", Copy) { String realm = "BUILD.ELASTIC.CO" tasks.named("javaRestTest").configure { + dependsOn "copyKeytabToGeneratedResources", "copyConfToGeneratedResources" usesDefaultDistribution() Path peppaKeytab = Paths.get("${project.buildDir}", "generated-resources", "keytabs", "peppa.keytab") Path krb5Conf = Paths.get("${project.buildDir}", "generated-resources", "conf", "krb5.conf") @@ -35,12 +43,9 @@ tasks.named("javaRestTest").configure { nonInputProperties.systemProperty 'test.userkt.keytab', "${peppaKeytab}" nonInputProperties.systemProperty 'test.userpwd', "george@${realm}" nonInputProperties.systemProperty 'test.krb5.conf', "${krb5Conf}" + nonInputProperties.systemProperty 'java.security.krb5.conf', "${krb5Conf}" systemProperty 'test.userpwd.password', "dino_but_longer_than_14_chars" - jvmArgs([ - "-Djava.security.krb5.conf=${krb5Conf}", - "-Dsun.security.krb5.debug=true" - ]) - dependsOn "copyKeytabToGeneratedResources", "copyConfToGeneratedResources" + systemProperty 'sun.security.krb5.debug', true classpath += files("$buildDir/generated-resources/keytabs") classpath += files("$buildDir/generated-resources/conf") } diff --git a/x-pack/qa/multi-cluster-search-security/legacy-with-basic-license/build.gradle b/x-pack/qa/multi-cluster-search-security/legacy-with-basic-license/build.gradle index f9d60181fc815..cce18a4bd1579 100644 --- a/x-pack/qa/multi-cluster-search-security/legacy-with-basic-license/build.gradle +++ b/x-pack/qa/multi-cluster-search-security/legacy-with-basic-license/build.gradle @@ -1,5 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-resources' @@ -40,11 +41,11 @@ def queryingCluster = testClusters.register('querying-cluster') { setting 'cluster.remote.my_remote_cluster.mode', 'proxy' setting 'cluster.remote.my_remote_cluster.proxy_address', { "\"${fulfillingCluster.get().getAllTransportPortURI().get(0)}\"" - } + }, IGNORE_VALUE } else { setting 'cluster.remote.my_remote_cluster.seeds', { fulfillingCluster.get().getAllTransportPortURI().collect { "\"$it\"" }.toString() - } + }, IGNORE_VALUE } } diff --git a/x-pack/qa/multi-cluster-search-security/legacy-with-full-license/build.gradle b/x-pack/qa/multi-cluster-search-security/legacy-with-full-license/build.gradle index 35b7a981fca36..69c0e8b20c2c4 100644 --- a/x-pack/qa/multi-cluster-search-security/legacy-with-full-license/build.gradle +++ b/x-pack/qa/multi-cluster-search-security/legacy-with-full-license/build.gradle @@ -1,5 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-resources' @@ -40,11 +41,11 @@ def queryingCluster = testClusters.register('querying-cluster') { setting 'cluster.remote.my_remote_cluster.mode', 'proxy' setting 'cluster.remote.my_remote_cluster.proxy_address', { "\"${fulfillingCluster.get().getAllTransportPortURI().get(0)}\"" - } + }, IGNORE_VALUE } else { setting 'cluster.remote.my_remote_cluster.seeds', { fulfillingCluster.get().getAllTransportPortURI().collect { "\"$it\"" }.toString() - } + }, IGNORE_VALUE } } diff --git a/x-pack/qa/multi-cluster-search-security/legacy-with-restricted-trust/build.gradle b/x-pack/qa/multi-cluster-search-security/legacy-with-restricted-trust/build.gradle index 810895abe1e86..1164aa240ee22 100644 --- a/x-pack/qa/multi-cluster-search-security/legacy-with-restricted-trust/build.gradle +++ b/x-pack/qa/multi-cluster-search-security/legacy-with-restricted-trust/build.gradle @@ -1,5 +1,6 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-resources' @@ -63,11 +64,11 @@ def queryingCluster = testClusters.register('querying-cluster') { setting 'cluster.remote.my_remote_cluster.mode', 'proxy' setting 'cluster.remote.my_remote_cluster.proxy_address', { "\"${fulfillingCluster.get().getAllTransportPortURI().get(0)}\"" - } + }, IGNORE_VALUE } else { setting 'cluster.remote.my_remote_cluster.seeds', { fulfillingCluster.get().getAllTransportPortURI().collect { "\"$it\"" }.toString() - } + }, IGNORE_VALUE } } diff --git a/x-pack/qa/repository-old-versions/build.gradle b/x-pack/qa/repository-old-versions/build.gradle index da8802e452c43..3c55aa8aa4663 100644 --- a/x-pack/qa/repository-old-versions/build.gradle +++ b/x-pack/qa/repository-old-versions/build.gradle @@ -13,6 +13,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.AntFixture import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask import org.elasticsearch.gradle.transform.UnzipTransform +import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.jdk-download' apply plugin: 'elasticsearch.internal-testclusters' @@ -86,7 +87,7 @@ if (OS.current() == OS.WINDOWS) { numberOfNodes = 2 versions = [project.version, project.version] // to test full cluster restart - setting 'path.repo', repoLocation + setting 'path.repo', repoLocation, IGNORE_VALUE setting 'xpack.license.self_generated.type', 'trial' setting 'xpack.security.enabled', 'true' @@ -151,7 +152,7 @@ if (OS.current() == OS.WINDOWS) { } tasks.matching { it.name.startsWith("javaRestTest") && it.name.endsWith(versionNoDots) }.configureEach { - it.systemProperty "tests.repo.location", repoLocation + it.nonInputProperties.systemProperty "tests.repo.location", repoLocation it.systemProperty "tests.es.version", version.toString() /* Use a closure on the string to delay evaluation until right before we diff --git a/x-pack/qa/saml-idp-tests/build.gradle b/x-pack/qa/saml-idp-tests/build.gradle index c2dffe2470b84..6027a421b62f2 100644 --- a/x-pack/qa/saml-idp-tests/build.gradle +++ b/x-pack/qa/saml-idp-tests/build.gradle @@ -31,6 +31,12 @@ tasks.register("copyIdpFiles", Sync) { } } +normalization { + runtimeClasspath { + ignore 'idp-metadata.xml' + } +} + tasks.named("javaRestTest").configure { usesDefaultDistribution() classpath += files(tasks.named("copyIdpFiles"))