Commit graph

981 commits

Author SHA1 Message Date
Rene Groeschke
8ce680ff4a
Mute SamlAuthenticationIT on 7.17 branch (#106993) 2024-04-02 14:51:40 +02:00
Albert Zaharovits
0df52c8f67
Netty4 HTTP authn enhancements (#92220) (#96703)
This is a backport of multiple work items related to authentication enhancements for HTTP,
which were originally merged in the 8.8 - 8.9 releases.
Hence, the HTTP (only the netty4-based implementation (default), not the NIO one) authentication
implementation gets a throughput boost (especially for requests failing authn).

Relates to: ES-6188 #92220 #95112
2023-08-23 18:52:38 +03:00
Iraklis Psaroudakis
86ce723b84
Mute test testWatcherWithApiKey (#93618) (#93620)
Relates #84700
2023-02-09 04:31:13 -05:00
Mark Vieira
18a5be3c30
[7.17] Convert full cluster restart tests to new rest testing framework (#93422) (#93432)
* Convert full cluster restart tests to new rest testing framework (#93422)

# Conflicts:
#	qa/full-cluster-restart/build.gradle
#	qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/FullClusterRestartIT.java
#	qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.java
#	qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/QueryBuilderBWCIT.java
#	x-pack/plugin/shutdown/qa/full-cluster-restart/build.gradle
#	x-pack/plugin/shutdown/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/build.gradle
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/FullClusterRestartSettingsUpgradeIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MLModelDeploymentFullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MlConfigIndexMappingsFullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MlHiddenIndicesFullClusterRestartIT.java
#	x-pack/qa/full-cluster-restart/src/javaRestTest/resources/system_key

* Fixes

* Fix warning failures

* Fix heap dump path

* More fixes

* Fix test cluster security setup on Windows

* Use relative path for script execution

* More, more fixes

* Fix warning error

* More fixes

* Fix security warning
2023-02-02 17:58:30 -05:00
Mark Vieira
9e1ec97dcf
[7.17] Migrate core rest tests with security to new testing framework (#92575) (#92686)
* Migrate core rest tests with security to new testing framework (#92575)

# Conflicts:
#	x-pack/qa/core-rest-tests-with-security/build.gradle

* Fixes

* More fixes

* More fixes

* More more fixes
2023-01-04 19:17:57 -05:00
Mark Vieira
0f28d1fcd4
[7.17] Add support for addition configuration files to test clusters framework (#92579) (#92603)
* Add support for addition configuration files to test clusters framework (#92579)

This adds the ability to supply arbitrary files to the config directory
of cluster nodes. Typically, this is used for security use cases, such
as providing for SSL certificates and trust stores.

This commit adds a few other features to enable more testing ues cases
as well, such as the ability to restart a cluster, as well as explicit
ordering of test cases withing a test class. This is needed for test
suites that need to execute some tests, restart the cluster, then
execute more in a particular order.
# Conflicts:
#	test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/LocalClusterHandle.java
#	x-pack/plugin/security/qa/basic-enable-security/build.gradle
#	x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/java/org/elasticsearch/xpack/security/EnableSecurityOnBasicLicenseIT.java
#	x-pack/qa/multi-node/src/javaRestTest/java/org/elasticsearch/multi_node/GlobalCheckpointSyncActionIT.java

* Fix static initialization of random value

* Remove unused imports

* Spotless
2022-12-29 15:02:07 -05:00
Mark Vieira
47c6fd34da
[7.17] Add JUnit rule based integration test cluster orchestration framework… (#92517)
This commit adds a new test framework for configuring and orchestrating
test clusters for both Java and YAML REST testing. This will eventually
replace the existing "test-clusters" Gradle plugin and the build-time
cluster orchestration.
2022-12-22 17:48:07 -08:00
Jake Landis
bc80880951
Support SAN/dnsName for restricted trust (#91946) (#91978)
This commit extends the TLS restricted trust model to allow reading from
alternative fields from the X509 certificate. Prior to this commit the only
supported (hard coded) value that could be used with restricted trust
is the SAN/otherName/CN value. This commit introduces support to read
from other fields from the X509 certificate. This commit also introduces
support to read from SAN/dnsName if configured. Any fields read from the
certificate will be used to match against the restricted trust file and if any
of the values match to the restricted trust file, then restricted trust is allowed.
Only if none of the values match then the restricted trust denied.

SAN/otherName/CN is the default, and SAN/dnsName can be used in addition
or in place of SAN/otherName/CN. The possible configuration values are:
```
 *.trust_restrictions.x509_fields: ["subjectAltName.otherName.commonName", "subjectAltName.dnsName"]
```
To help support testing, all of the existing certificates have been updated
to include a SAN/dnsName that matches the SAN/otherName/CN. This
allows the tests to randomize which field(s) are used to match for restricted trust.
This also has the side effect of making this commit larger than expected in
terms of lines of change. A readme has been included with copy-able commands
to recreate the certificates as needed.

Additionally, a CCS REST test has been introduced that uses the restricted trust.
To support this new CCS REST test the private keys for the test certificates are also
included in this commit as well as the gradle configuration needed to share those
certificates across projects.
2022-11-28 13:41:41 -06:00
Mark Vieira
f4dcf5a045
Don't start docker fixtures when resolving test runtime classpath (#91476) (#91513)
We have some test runtime resources that are generated by our Docker
based test fixtures. These resources are then placed on the runtime
test classpath to be used by the test classes themselves. The problem
here is that any build that attempts to resolve the test runtime
classpath will then trigger the starting of these Docker fixtures, which
is quite expensive. Some of our precommit checks, like forbidden apis
and third-party audit tasks do this.

This commit decouples this a bit and removes the implicit dependency
replacing it with an explicit one on the test task itself. It's slightly
less idomatic Gradle, but it's a worthwhile optimization.
2022-11-10 12:44:32 -05:00
Jake Landis
72f37bc763
Fix hacky ephemeral port config for SAML tests (#91301) (#91368)
This commit re-implements how the SAML tests configure their ephemeral ports.
The prior implementation had 2 tasks competing over files in the output directory
resulting in some odd behavior w.r.t. when the task was up to date or was not.
The change here removes the unnecessary task and leverages a lazy map with
the expand option to lazily populate the port mapping.
# Conflicts:
#	x-pack/qa/saml-idp-tests/build.gradle
2022-11-07 15:14:07 -05:00
Jake Landis
b12e3c96bd
Build shibboleth-idp for testing purposes (#91216) (#91293)
We currently use unicon/shibboleth-idp:3.4.2 to help test our SAML integration.
That container is no longer actively supported and does not support
ARM architectures.

This commit is a partial clone from Unicon/shibboleth-idp-dockerized 3.4.3.

Changes from upstream include:

    Use openjdk:11.0.16-jre as the base image for support for ARM architectures
    Handle missing keystore download from Jetty
    Fix URL paths for artifacts to download

Changes to this repository include:

    Copied required Jetty configuration files from upstream project
    Updates to docker compose
    Placed the missing keystore Jetty downloads in a separate location (jetty-custom)

The final result is a bit messy. Mixing cloned files with custom files and mixing
Jetty and IDP concerns. However, it is not much messier than prior and now
that we control building the image we can more easily upgrade shibboleth IDP
The upgrade to the latest version is fairly involved and as such we will need to
deviate more from the clone which should allow some additional clean up.

part of: #71378
related: #91144
supersedes: #89674
2022-11-03 15:37:33 -04:00
Jake Landis
728c6710d6
update c2id/c2id-server-demo docker image to support ARM (#91144) (#91292)
This commit updates the c2id docker image to the latest released version.
This commit also introduces a multi-stage build with the openjdk image that
supports ARM architectures. So our oidc tests now supports multiple archtectures.

related: #89526
part of: #71378
2022-11-03 15:32:02 -04:00
Slobodan Adamović
6a0b194ab2
Make hostname resolution for loopback address more robust. (#89788) (#89898)
Implemented a fall-back to `localhost` when FQDN for
loopback address (`127.0.0.1`) cannot be resolved.
This can happen if test platform's DNS resolution
is not properly configured.

Closes #89324
2022-09-08 17:05:13 +09:30
Jake Landis
1fbe8fed6c
[7.17] Update OIDC test fixture (#89526) (#89556)
This commit updates the OIDC test fixture to use the latest demo docker image
from https://connect2id.com.  As part of this change some of the docker image demo 
login has changed from prior versions and the test code is updated accordingly. 

fixes #89477
reverts #89478 / e949dff.
2022-08-23 12:44:10 -05:00
Mark Vieira
e22e64e345
Disable openid connect tests due to missing fixture (#89478) (#89479)
Relates to https://github.com/elastic/elasticsearch/issues/89477. For
now just disable these tests since they are guaranteed to fail.
2022-08-19 08:02:26 +09:30
Rene Groeschke
62294616df
[7.17] Rework testing conventions gradle plugin (#87213) (#88422)
Backports the following commits to 7.17:
 - Rework testing conventions gradle plugin (#87213)
2022-07-12 10:58:40 +02:00
Mark Vieira
51b1f1dcf0 Fix test conventions when skipping ML upgrade tests (#87516)
(cherry picked from commit 8a68649020)
2022-06-08 12:29:22 -07:00
Mark Vieira
d764a01edc
[7.17] Skip ML tests on later glibc for incompatible BWC versions (#87487)
* Skip ML tests on later glibc for incompatible BWC versions

* More flexible version parsing

* Use relaxed mode for parsing glibc version

* Missed a spot

* spotless
2022-06-07 19:13:05 -04:00
Rene Groeschke
91537609b6
[7.17] Remove elasticsearch.rest-test gradle plugin (#85491) (#87025)
Backports the following commits to 7.17:
 - Remove elasticsearch.rest-test gradle plugin (#85491)
2022-05-23 13:58:00 +02:00
Seth Michael Larson
79878662c5
Revert "Enable HLRC compatibility mode by default (#86517)" (#86873)
This reverts commit 0cb5108942.
2022-05-17 18:06:52 -05:00
Sylvain Wallez
0cb5108942
Enable HLRC compatibility mode by default (#86517) 2022-05-12 19:00:54 +02:00
Rene Groeschke
aebe6a0197
[7.17] Port xpack plugins projects away from elasticsearch rest test gradle plugin (#86562)
This deprecates the elasticsearch.rest-test plugin and elasticsearch.standalone-rest-test and ports
all usages of them in x-pack/plugins. Other usages will be removed in a few upcoming PRs to not have one >300file PR

When all usages have been addressed we're going to remove those gradle plugins from the codebase.

This PR is a subset of #85491 which got just too big to handle IMO
2022-05-10 11:25:14 +02:00
William Brafford
fdb2c8fac4
Validate index format agreement for system index descriptors (#85173) (#85290)
* Validate index format agreement for system index descriptors (#85173)

* Validate index format for system indices
* Add bwc test for watcher meta version issue
* Update docs/changelog/85173.yaml

* Add include_type_name warning handler for bwc tests
2022-03-23 16:21:39 -04:00
Mark Vieira
690e1dbf7a
Remove usages of elasticsearch.build plugin in non-production projects (#84961) (#84964)
(cherry picked from commit dc3d3b5e12)
2022-03-15 09:55:44 -07:00
Przemko Robakowski
4ebc5e345f
Fix GeoIpDownloader startup during rolling upgrade (#84000) (#84031)
If rolling upgrade was used from version prior GeoIPv2 (<`7.14`) then
geoip downloader wouldn't be started so no new databases were
downloaded. This is especially troubling in `8.x` as we no longer
provide default databases inside ES so after upgrade no geoip enrichment
can take place until downloader is started with workaround (setting
`ingest.geoip.downloader.enabled` to `false` and `true` again). This is
because logic that was used to lower number of requests / cluster update
listeners at the startup was too optimistic about order of actions / who
can be elected master at what time.  This change fixes that and also
cleans up logs when there are some ignorable errors and adds debug
logging on start and stop of the task to ease up troubleshooting. It
also adds rolling upgrade test to make sure the fix works.
2022-02-16 09:17:26 -05:00
Przemyslaw Gomulka
8d10cfebed
[7.17] Convert 'id' and '_id' values in REST API tests to strings #82681 (#83772)
Follow-up from #77144 (comment) with converting id/_id to always be strings instead of integers. This makes the type value in the Elasticsearch specification be only string instead of string | number.

this change was generated using following command on ubuntu
find . -type f -name "*.yml" -print0 | xargs -0 sed -i -r 's/([^a-zA-Z0-9_\.]id|[^a-zA-Z0-9_]_id):(\s)([0-9]+)/\1:\2"\3"/g'
relates #82681
2022-02-10 13:52:36 +01:00
Andrei Dan
54b74604f0
Revert "Mute watcher rolling upgrade yaml tests (#81935) (#81974)" (#82431)
This reverts commit bdada637cf.
2022-01-11 16:31:42 +00:00
Andrei Dan
72a5f72a08
Do not remove legacy watcher templates in 7.x (#82167)
Some previous 7.x release validate that these legacy templates exist in
the cluster (the validation executes on non-master nodes too). This can
cause the rolling upgrade test (particulary the ones that do not upgrade
the entire cluster ie. mixed cluster scenarios) to hang waiting for
watcher to be started, however it will never start because of the
legacy templates validation failing.

This is not a problem per se for "real life" rolling upgrades as this does not
block the rolling upgrades, nor does it raise any errors, it will
however stop watcher on the nodes that detect it (until the said nodes are
upgraded, at which point watcher is started).
2022-01-11 14:31:12 +00:00
Jake Landis
c0c633a6ad
[7.17] Fix Watcher testWatcherWithApiKey (#82136) (#82231) 2022-01-04 15:51:00 -06:00
Martijn van Groningen
bbd08e2fc9
Mute watcher rolling upgrade yaml tests (#81935)
Relates to #81110
2021-12-21 08:58:12 +01:00
Martijn van Groningen
87c6c2557d
Mute WatcherRestartIT#testWatcherRestart(...) (#81881)
Relates to #79895
2021-12-17 17:33:36 +01:00
David Roberts
0d403365bd
[7.16] [ML] Model snapshot upgrade needs a stats endpoint (#81706)
* [7.16] [ML] Model snapshot upgrade needs a stats endpoint

Previously the ML model snapshot upgrade endpoint did not
provide a way to reliably monitor progress. This could lead
to the upgrade assistant UI thinking that a model snapshot
upgrade had finished when it actually hadn't.

This change adds a new "stats" API that allows external
interested parties to find out the status of each model
snapshot upgrade and which node (if any) each is running on.

Backport of #81641

* Fixing compilation
2021-12-14 04:50:07 -05:00
Hendrik Muhs
f4b71278ad
[Transform] Repair TransformSurvivesUpgradeIT for 7.16->7.16/17 upgrade (#81571)
don't check for audit template after 7.16

fixes #79230
2021-12-09 10:06:26 +01:00
Andrei Dan
6371c2f6e9
Fix WatcherRestartIT (#80986) (#80995)
This removes the unnecessary watcher start call in the test to reduce
the possibility of flakiness. The call is not needed as the Watcher
plugin is active and it will install (and upgrade/remove) the templates
regardless if watcher is started.
2021-11-24 09:46:36 -05:00
Andrei Dan
b544968b23
Remove obsolete typed legacy index templates (#80949)
This removes a few legacy index templates that were superseeded by
equivalent component templates or updated index templates.

(cherry picked from commit dace65b69a)
Signed-off-by: Andrei Dan <andrei.dan@elastic.co>

# Conflicts:
#	x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/WatcherRestartIT.java
2021-11-23 16:29:44 +00:00
David Roberts
9d99587ffe
[ML] ML legacy index templates that are no longer needed should be deleted (#80874)
We no longer need any ML legacy index templates, as we've switched to
either composable index templates or system indices. All the ML legacy
templates we've created over the years should be deleted, as they're
just confusing clutter within the cluster now.
2021-11-19 16:31:54 +00:00
Martijn van Groningen
86a057169d
Add debug logging to SchedulerEngine. (#80592) (#80670) 2021-11-11 16:37:29 +01:00
Benjamin Trent
387f565e9f
[7.16] [ML] add trained model inference bwc tests (#80618) (#80661)
* [ML] add trained model inference bwc tests (#80618)

This adds rolling upgrade tests that:

Build a classification and regression model through data frame analytics
Make sure pipelines + stats work in the old cluster
Verify through the rolling upgrade process that pipelines + stats still work

* fixing compilation
2021-11-11 09:25:43 -05:00
Hendrik Muhs
20d20b99c5
[7.16] [Transform] Fix issue if upgrade runs right after a rolling cluster upgrade (#80579) (#80602)
* [Transform] Fix issue if upgrade runs right after a rolling cluster upgrade (#80579)

do not fail a running transform if upgrader rewrites state inbetween

fixes #80073

* reactivate test
2021-11-10 10:34:45 -05:00
Ioannis Kakavas
52ad3f973a
[7.16] Unmute Kerberos integ tests (#80538) (#80543)
We used to default enctypes to des3-cbc-sha1-kd but with JDK17, weak
encryption types are disabled by default. This caused our Kerberos
integration tests to fail with an `sun.security.krb5.KrbException: no
supported default etypes for default_tkt_enctypes` exception. We have
since changed our default encryption type to aes256-cts-hmac-sha1-96 in
#78703 and we can unmute these tests now.
2021-11-09 21:37:28 +02:00
Armin Braun
20dd4790a5
Fix Searchable Snapshot Bwc Tests Data Tier Setting for 7.12 (#80288)
We're enforcing constraints on the tier setting now that were not enforced
in 7.12. Newer version masters will not work correctly with defaults send
by 7.12 so we force a tier setting for frozen tier indices in this test.

closes #79786
closes #79541
2021-11-04 07:17:12 +01:00
Yang Wang
99d6a93da9 [Test mute] AwaitsFix #80073 2021-11-04 11:23:54 +11:00
Hendrik Muhs
27241b89a1
[7.16][Transform] add rolling upgrade tests for upgrade endpoint (#79721) (#80013)
* [Transform] add rolling upgrade tests for upgrade endpoint (#79721)

add rolling upgrade tests for upgrade endpoint

* always use the transform endpoint prefix

* remove mixed cluster check, because the endpoint does not exist < 7.16
2021-10-28 10:52:45 -04:00
Ryan Ernst
9336cfd931
Convert uses of mockito Matchers to ArgumentMatchers (#79852) (#79964)
Matchers is deprecated in Mockito, in favor of the newer
ArgumentMatchers class. In fact, internally Matchers just extends
ArgumentMatchers as all the methods there were moved. This commit
changes all imports of org.mockito.Matchers to
org.mockito.ArgumentMatchers.
2021-10-27 18:13:26 -07:00
Mark Vieira
bcfbf00074 Reformat Elasticsearch source 2021-10-27 15:23:15 -07:00
Lukas Wegmann
2606e77f0c
fix checkstyle violations introduced in #79790 (#79791) 2021-10-26 11:48:41 +02:00
Lukas Wegmann
d5fb890556
mute failing rolling-upgrade tests (#79790)
see #79786
2021-10-26 10:52:20 +02:00
Lee Hinman
08214dcf84
Add deprecation headers to HLRC classes (#79754) (#79763)
This commit adds the @Deprecated annotation and Javadoc to HLRC classes.
# Conflicts:
#	client/rest-high-level/qa/ssl-enabled/src/javaRestTest/java/org/elasticsearch/client/documentation/EnrollmentDocumentationIT.java
#	client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/EnrichDocumentationIT.java
#	qa/ccs-rolling-upgrade-remote-cluster/src/test/java/org/elasticsearch/upgrades/SearchStatesIT.java
#	x-pack/qa/reindex-tests-with-security/src/test/java/org/elasticsearch/xpack/security/ReindexWithSecurityIT.java
#	x-pack/qa/security-example-spi-extension/src/javaRestTest/java/org/elasticsearch/example/role/CustomRolesProviderIT.java
#	x-pack/qa/smoke-test-plugins-ssl/src/test/java/org/elasticsearch/smoketest/SmokeTestMonitoringWithSecurityIT.java
2021-10-25 19:12:52 -04:00
Albert Zaharovits
b0a5cdfb07
TEST Ensure password 14 chars length on Kerberos FIPS tests (#79496) (#79510) 2021-10-19 16:01:41 -04:00
Yang Wang
74ba6fbd79
Preserve request headers in a mixed version cluster (#79412) (#79439)
When rewriting authentication for requests crossing nodes of different
versions, we now preserve all request headers except the authentication
one which needs to be rewritten. Previously all other request headers
were dropped and it caused issue like an operator user not being
recognised on the remote node. Other now preserved headers include audit
and system index access. This new behaviour is more correct because we
would never drop these headers if the nodes are on the same version.

Resolves: #79354

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-10-19 07:17:13 -04:00