Commit graph

82 commits

Author SHA1 Message Date
Mark Vieira
d1c98f39fd
Validate that test cluster BWC nodes use the default distribution (#106559) (#106565)
We have instances where BWC tests configure old ES version nodes with
the integTest distribution. This isn't a valid configuration, and while
we in reality resolve the default distribution artifact, we have other
configuration logic that behaves differently based on whether the
integTest distro was _requested_. Specifically, what to set ES_JAVA_HOME
to. This bug resulted in us attempting to run old nodes using the
current bundled JDK version, which may be incompatible with that older
version of Elasticsearch.

Closes #104858
2024-03-20 12:55:47 -04:00
Mark Vieira
e516f8c06d
Fix issue when installing multiple test cluster plugins (#105516) (#105519) 2024-02-14 16:11:36 -05:00
Dmitry Cherniachenko
263ea5e987
Replace generic HashSet / HashMap with more efficient EnumSet / EnumMap (#105238) 2024-02-08 13:43:14 +00:00
Albert Zaharovits
f8ff5ecdc8
Grant SocketPermission in FIPS ITs to the FIPS JSSE implementation lib (#104465)
Grants the SocketPermission "*", "connect" permission to the
bouncy castle JSSE implementation lib, when running ITs under
FIPS-configured JVMs.
Note that the plugin's permissions e.g.
x-pack/plugin/ml-package-loader/src/main/plugin-metadata/plugin-security.policy
are still checked and enforced.
This new permission is required because the BC lib hooks into
the JVM when opening any TLS connection, under the stacktrace
of the plugin's AccessController.doPrivileged (so the lib's permissions
are checked first, before the doPrivileged call on the stack).

Relates #100923
Fixes #104414
2024-01-18 22:41:19 +02:00
Jake Landis
7311ab1785
Prefer new test cluster framework for new FIPS setting (#104287)
https://github.com/elastic/elasticsearch/pull/103483 introduced a new
setting for FIPS only.  Due to the way FIPS is configured with the elder
gradle test cluster framework this setting was getting applied to elder
clusters in BWC tests that did not have the settting causing test
failures. 

The new test framework has better semantics for version specific
configuration.  This commit updates applies the new setting via the new
framework with a  version specific condition. 

Adding this setting to the test clusters is a simple way to test the
setting (which will cause errors if the required providers are not found
in the cluster).  The pseudo test does not care which framework is used
for configuration.  Also, using the new framework allows to remove some
hacky configuration previously needed to handle some elder test cluster
configuration that used elder versions. 

Fixes: https://github.com/elastic/elasticsearch/issues/104234
2024-01-12 12:20:01 -05:00
Mark Vieira
142d4df606
Simplify handling of runtime java for tests clusters (#104232) 2024-01-10 14:37:38 -08:00
Aurélien FOUCRET
133008bfc5
[LTR] Enable by default on stateful only (#103333) 2023-12-14 13:45:41 +01:00
Nikolaj Volgushev
9d56e88ca4
Internal REST tests can update keystore file (#103133)
This PR adds the ability to update secure setting storage in internal
REST tests during test execution. This is useful when testing the
end-to-end flow of reloading secure settings via the [Nodes reload
secure settings
API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-reload-secure-settings.html).
Previously, re-applying secure settings was only possible with a full
test cluster restart.
2023-12-11 08:09:04 -05:00
Aurélien FOUCRET
be98a4697e
[LTR] Update the feature name from "learn to rank" to "learning to rank". (#102938) 2023-12-05 07:53:49 +01:00
Aurélien FOUCRET
bba08fc97c
Renaming inference rescorer feature flag to learn to rank. (#102883) 2023-12-04 15:31:02 +01:00
Rene Groeschke
c11315d0d7
repository-s3 yamlRestTests to new cluster test framework (#102353)
- Replace docker-compose based s3-fixture usages to use plain java
- Support lazy evaluated system properties for local cluster definitions
- Make it work with configuration cache enabled
- Port Minio fixture usage to leverage test container testing library.
2023-11-22 10:08:58 +01:00
Jake Landis
17a46a6e9f
upgrade bouncy castle jars (#100923)
This commit upgrades the Bouncy Castle jars. Bouncy Castle is used for 
some internal build concners as well as a comnand line application. 
Most notably Bouncy Castle is also used as the FIPs certified JCE/JSEE provider 
we use to test our ability to use a FIPs compliant crypto provider. 

The following changes here are a result of the upgraded Bouncy Castle jars:
* TLSv1.3 is now supported when running in FIPs mode 
* RSA PKCS#1 v1.5 is no longer allowed in FIPS mode
* Triple DES (3DES) is no longer allowed in FIPS mode
* Minor updates the security manager configuration used to test FIPs (to read permissions from the security provider)
* Minor adjustments to tests to accommodate the above changes. 
* Minor adjustments to the gradle build to accommodate new dependencies 

Note - update to the documentation will come in a later commit.
2023-11-21 11:14:41 -06:00
James Baiera
6fa7f60073
Add ability to create a data stream failure store (#99134)
Adds the ability to configure a data stream to create a new kind of backing index called a failure store which will eventually be used to store error information when ingest pipelines fail to ingest a document or when a document fails to be parsed correctly by the configured mapping on the data stream.
2023-11-15 15:32:51 -05:00
Mark Vieira
af47300567
Support "shared" test clusters (#101089)
This commit introduces the concept of shared tests clusters using the
new JUnit testing framework. Unlike normal test clusters which are
exclusive to each test suite (class), shared clusters persist across
test suites to be reused. This can be useful for test projects with a
large number of test suites that can all use a single cluster, and the
overhead of creating these clusters is the dominating factor.
2023-11-02 11:27:12 -07:00
William Brafford
8e6e0e59ea
Make some classes final to avoid suppressing "this-escape" warning (#101699)
* Avoid "this-escape" by making classes final

The "this-escape" compiler warning is intended to alert
developers to potential bugs in object initialization due to
subclassing. This class of bugs cannot occur when a class is
final. Here, we take cases where a class has no implementations
but generates a "this-escape" warning, and we make those
classes final rather than suppressing the compiler warning.
This makes the remaining suppressions more meaningful, since
they now indicate places where we may want to look for
initialization bugs.

In a few cases, making a class final meant changing some of its
protected fields and methods to private or default
accessibility.

Some classes with no implementations are mocked in testing.
Since making those classes final would involve non-trivial
rewrites of tests, I've left them alone.

* Spotless, remove redundant modifiers, clean up "protected" usage

* Revert a few more mocked classes
2023-11-02 08:34:02 -04:00
Armin Braun
b7eafce32c
Make some practically static methods static (#97565)
Another round of automated fixes to this, marking things that can be
made static as static. Saves some JIT cycles but also turns some lambdas
from capturing to non-capturing and makes the "utilityness" of some
classes visible.
2023-10-06 23:37:07 +02:00
Mark Vieira
350720e972
Fix system property value for inference rescorer tests feature flag (#100366)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-10-06 11:46:54 +02:00
Mark Vieira
8916c3dd9f
Support debugging integration tests with multiple test clusters (#100304)
Add support for passing `--debug-server-jvm` to tests that declare
multiple test clusters. This is common in tests for things like remote
cluster security, CCS, CCR, etc.

The convention for port numbers and debug settings is the same. The JVM
is expected to attach to an existing debugger in listen mode, starting
at port 5007 and incrementing from there.

Closes #94175
2023-10-04 18:54:41 -04:00
Mark Vieira
8f591b24e6
Convert core xpack rest tests to new test framework (#100301) 2023-10-04 15:06:27 -07:00
Tim Vernum
d411acecbc
Suppress this-escape warning for JDK21 (#99848)
Adds @SuppressWarnings("this-escape") to all necessary places to that
Elasticsearch can compile with -Werror on JDK21

No investigation has been done to determine whether any of the cases
are a potential source of errors - we have simply suppressed all
existing occurrences.

Resolves: #99845
2023-09-25 18:30:21 +10:00
Mark Vieira
7be3d2c191
Increase flexibility of test cluster execution environments (#99437) 2023-09-13 11:18:40 -07:00
Tim Vernum
0a74a2fbaa
[test] Create subdir in config dir if required (#99218)
This commit updates the local cluster factory so that extra config files
(see `LocalSpecBuilder.configFile`) can be placed into subdirectories of
the config dir. This is needed when creating files for the
`FileSettingsService` - these k8s managed files are required to be in an
`"operator/"` directory within the general configuration directory.
2023-09-06 21:23:57 -04:00
Tim Vernum
0931d1e675
Add QA Rest Test for audit logging (#98923)
This adds an integration test for audit logging functionality
2023-08-28 21:47:02 -04:00
Mark Vieira
6258b1880d
Remove final modifier from Version class to allow for subclassing (#98748)
We need to be able to extend `Version` for certain bespoke testing
use-cases.
2023-08-22 13:43:00 -04:00
Andrei Dan
01ed7de99f
GA the data stream lifecycle (#98644)
This makes the data stream lifecycle generally available. This will allow
data streams to take advantage of a native simplified and resilient
lifecycle implementation.
2023-08-21 17:28:54 +01:00
Yang Wang
d0f64941f0
Remove RCS 2.0 feature flag for beta release (#98307)
This PR removes the RCS 2.0 feature flag so that it is ready for beta
release.
2023-08-14 08:33:37 +10:00
Mark Vieira
67a3573806
Simplify extending cluster handle implementations (#98363) 2023-08-10 13:00:59 -07:00
Mark Vieira
a6ca1e7492
Add forcibly argument to test cluster stop node method (#98336)
(cherry picked from commit 2975f3379d)
2023-08-10 11:22:51 -07:00
Mark Vieira
5206587cfe
Revert "Add forcibly argument to test cluster stop node method (#98336)"
This reverts commit 2975f3379d.
2023-08-09 15:14:12 -07:00
Mark Vieira
2975f3379d
Add forcibly argument to test cluster stop node method (#98336) 2023-08-09 15:13:10 -07:00
Mark Vieira
ecb187c984
Forcibly terminate test cluster nodes at the end of tests (#98335) 2023-08-09 14:07:21 -07:00
Tim Vernum
6fa5c61cf2
Support operator users in LocalClusterSpec (#97340)
This adds a new parameter to LocalClusterSpecBuilder.user(..) to
indicate whether the user should be an operator or not.

Users added with the simplified user(username, password) method are
operators (and have the "_es_test_root" role).
2023-08-09 02:38:58 -04:00
Yang Wang
9c07f1df6f
RCS2 - Fix remote nodes collection for scroll (#98186)
For RCS 2.0, we added a RemoteClusterNodesAction (#93893) for collecting
remote cluster server nodes. This action is used in two places: 1.
Collecting nodes that can be directly connected in sniff mode 2. In the
method RemoteClusterService#collectNodes

However, in the 2nd use case, we should collect all ndoes from the
remote cluster instead of just those nodes that have remote cluster
server enabled. This is because the method is used in the context of
search instead of building connection. A remote node can be *not*
directly accessible but still hosts searchable data. Search requests
should be sent to all the data nodes and *not* limited to just the
server nodes.

This PR fixes this issue by augmenting RemoteClusterNodesAction to
support retrieving either server nodes or all nodes. The caller can
decide which set of nodes are of interest depending on the context.
2023-08-08 01:02:40 -04:00
David Turner
da389b465a
Improve testclusters shutdown logging (#98253)
Today the logging when shutting down a node does not indicate to which
node it pertains. This commit adds a little more detail to aid with
debugging.
2023-08-07 18:14:03 +01:00
Carlos Delgado
375991d974
Remove synonyms feature flag and related classes (#97962) 2023-07-26 18:13:06 +02:00
Tim Vernum
58906f9fc8
[testcluster] Fix merging of JVM args (#97776)
Ensure that there is always a space between different components when building ES_JAVA_OPTS
2023-07-25 11:22:43 +10:00
Mark Vieira
6b6a85534b
Add API for accessing node logs in test clusters framework (#97701) 2023-07-14 12:19:03 -07:00
Mayya Sharipova
321110ef52
Add synonyms feature for test clusters (#97658)
Fix for #97334 where incorrect feature name was provided.


Correct more instances of synonyms_feature_flag_enabled for synonyms_api_feature_flag_enabled


Closes #96641, #97177
2023-07-13 11:34:25 -04:00
Kathleen DeRusso
1365b0df61
Enable Query Rules as technical preview (#97466)
Co-authored-by: Carlos Delgado <6339205+carlosdelest@users.noreply.github.com>
2023-07-12 16:04:59 -04:00
Ryan Ernst
4cf4be4033
Expose pid in new test clusters (#97590)
Sometimes it is necessary for an integ test to poke at the Java process
of Elasticsearch. This commit makes a node's pid available through
ClusterHandle.
2023-07-11 16:52:12 -04:00
Ryan Ernst
6e5ee5b782
Allow test clusters to specify additional jvm arguments (#97584)
Somet special tests like die-with-dignity need to pass additional jvm
arguments (exit on OOM). This commit adds a new jvmArg to the cluster
spec for the new test clusters infra.
2023-07-11 10:01:16 -07:00
Stuart Tettemer
44ce64c35f
Stop invidual nodes and get node names in test clusters (#97402)
Adds
`public String getName(int index)`
`public void stopNode(int index)`

To the cluster handle.
2023-07-05 13:16:32 -05:00
Mary Gouseti
a432313ff3
Data stream lifecycle class names (#97381) 2023-07-05 12:28:32 +03:00
Yang Wang
18f326ad3c
[Test] RCS migration for Transform and CCR jobs (#96725)
This PRs adds migration tests for transform and CCR jobs from using RCS
1.0 to 2.0 then back to 1.0 again. It is not intended to cover all
possible scenarios, but rather a proof to show migration is possible in
at least some cases.

Note the migration strategy here is to update remote cluster settings in
place, i.e. reuse the same cluster alias and change its definition.
Restart is required because a node needs to the cross-cluster API key
form the keystore.
2023-06-19 19:56:22 -04:00
Kathleen DeRusso
008a9fc46d
Add Put Query Ruleset API call (#96812) 2023-06-15 10:37:18 -04:00
Mark Vieira
ed7e1ea657
Add method for registering a SettingsProvider for keystore settings (#96679)
Add a method to `LocalClusterBuilder` for providing a `SettingsProvider`
for secure keystore settings in test clusters.
2023-06-07 19:52:25 -04:00
Ievgen Degtiarenko
af15c058bf
Fix a typo in LocalClusterSpec (#96576)
Fix a typo in LocalClusterSpec to use actual parameter instead of hard coded value.
2023-06-06 08:27:01 +02:00
Carlos Delgado
39b7b5eb56
Synonym Mgmnt API: PUT request (#95895) 2023-05-31 10:48:56 +02:00
Mark Vieira
9502d39c96
Refactor GCS test fixture to remove docker dependency (#94755) 2023-05-17 11:05:26 -07:00
Mark Vieira
6ace408239
Refactor BWC handling to support more flexible testing scenarios (#95803) 2023-05-03 13:43:39 -07:00