-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run some REST tests against a cluster running in docker containers #39515
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
36ad7e7
Run REST tests against a cluster running on docker
alpar-t 0962587
Add missing dependency
alpar-t cf69ae3
Add x-pack tests, export logs
alpar-t 0244955
Fix repo tests
alpar-t 02278b6
Fix deprecation warnings
alpar-t 012e88a
Fix task dependencies
alpar-t 76f8ead
Merge remote-tracking branch 'origin/master' into docker-rest-test-38053
alpar-t ef0e33a
PR review
alpar-t ef8bbb8
PR review
alpar-t df7c5fb
Merge remote-tracking branch 'origin/master' into docker-rest-test-38053
alpar-t 48eba36
Add distribution as input property
alpar-t 5f6b3f8
Replace the full test run with a minimal check
alpar-t aa95613
Merge remote-tracking branch 'origin/master' into docker-rest-test-38053
alpar-t d6fa767
Merge remote-tracking branch 'origin/master' into docker-rest-test-38053
alpar-t d86c25d
PR review
alpar-t 39b2597
Merge remote-tracking branch 'origin/master' into docker-rest-test-38053
alpar-t 6794c14
Merge remote-tracking branch 'origin/master' into docker-rest-test-38053
alpar-t 8d50f21
Merge remote-tracking branch 'origin/master' into docker-rest-test-38053
alpar-t 4b785b8
Migrate to Gradle Test task
alpar-t c0cac7b
Merge remote-tracking branch 'origin/master' into docker-rest-test-38053
alpar-t File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,133 @@ | ||
# Only used for testing the docker images | ||
version: '3' | ||
services: | ||
elasticsearch-default: | ||
elasticsearch-default-1: | ||
image: elasticsearch:test | ||
environment: | ||
- node.name=elasticsearch-default-1 | ||
- cluster.initial_master_nodes=elasticsearch-default-1,elasticsearch-default-2 | ||
- discovery.seed_hosts=elasticsearch-default-2:9300 | ||
- cluster.name=elasticsearch-default | ||
- discovery.type=single-node | ||
- bootstrap.memory_lock=true | ||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" | ||
- path.repo=/tmp/es-repo | ||
- node.attr.testattr=test | ||
- cluster.routing.allocation.disk.watermark.low=1b | ||
- cluster.routing.allocation.disk.watermark.high=1b | ||
- cluster.routing.allocation.disk.watermark.flood_stage=1b | ||
- script.max_compilations_rate=2048/1m | ||
- node.store.allow_mmap=false | ||
- xpack.security.enabled=true | ||
- xpack.security.transport.ssl.enabled=true | ||
- xpack.security.http.ssl.enabled=true | ||
- xpack.security.authc.token.enabled=true | ||
- xpack.security.audit.enabled=true | ||
- xpack.security.authc.realms.file.file1.order=0 | ||
- xpack.security.authc.realms.native.native1.order=1 | ||
- xpack.security.transport.ssl.keystore.path=/usr/share/elasticsearch/config/testnode.jks | ||
- xpack.security.http.ssl.keystore.path=/usr/share/elasticsearch/config/testnode.jks | ||
- xpack.http.ssl.verification_mode=certificate | ||
- xpack.security.transport.ssl.verification_mode=certificate | ||
- xpack.license.self_generated.type=trial | ||
volumes: | ||
- ./build/repo:/tmp/es-repo | ||
- ./build/certs/testnode.jks:/usr/share/elasticsearch/config/testnode.jks | ||
- ./build/logs/default-1:/usr/share/elasticsearch/logs | ||
- ./docker-test-entrypoint.sh:/docker-test-entrypoint.sh | ||
ports: | ||
- "9200" | ||
elasticsearch-oss: | ||
image: elasticsearch-oss:test | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
entrypoint: /docker-test-entrypoint.sh | ||
elasticsearch-default-2: | ||
image: elasticsearch:test | ||
environment: | ||
- node.name=elasticsearch-default-2 | ||
- cluster.initial_master_nodes=elasticsearch-default-1,elasticsearch-default-2 | ||
- discovery.seed_hosts=elasticsearch-default-1:9300 | ||
- cluster.name=elasticsearch-default | ||
- bootstrap.memory_lock=true | ||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" | ||
- path.repo=/tmp/es-repo | ||
- node.attr.testattr=test | ||
- cluster.routing.allocation.disk.watermark.low=1b | ||
- cluster.routing.allocation.disk.watermark.high=1b | ||
- cluster.routing.allocation.disk.watermark.flood_stage=1b | ||
- script.max_compilations_rate=2048/1m | ||
- node.store.allow_mmap=false | ||
- xpack.security.enabled=true | ||
- xpack.security.transport.ssl.enabled=true | ||
- xpack.security.http.ssl.enabled=true | ||
- xpack.security.authc.token.enabled=true | ||
- xpack.security.audit.enabled=true | ||
- xpack.security.authc.realms.file.file1.order=0 | ||
- xpack.security.authc.realms.native.native1.order=1 | ||
- xpack.security.transport.ssl.keystore.path=/usr/share/elasticsearch/config/testnode.jks | ||
- xpack.security.http.ssl.keystore.path=/usr/share/elasticsearch/config/testnode.jks | ||
- xpack.http.ssl.verification_mode=certificate | ||
- xpack.security.transport.ssl.verification_mode=certificate | ||
- xpack.license.self_generated.type=trial | ||
volumes: | ||
- ./build/repo:/tmp/es-repo | ||
- ./build/certs/testnode.jks:/usr/share/elasticsearch/config/testnode.jks | ||
- ./build/logs/default-2:/usr/share/elasticsearch/logs | ||
- ./docker-test-entrypoint.sh:/docker-test-entrypoint.sh | ||
ports: | ||
- "9200" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
entrypoint: /docker-test-entrypoint.sh | ||
elasticsearch-oss-1: | ||
image: elasticsearch:test | ||
environment: | ||
- node.name=elasticsearch-oss-1 | ||
- cluster.initial_master_nodes=elasticsearch-oss-1,elasticsearch-oss-2 | ||
- discovery.seed_hosts=elasticsearch-oss-2:9300 | ||
- cluster.name=elasticsearch-oss | ||
- bootstrap.memory_lock=true | ||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" | ||
- path.repo=/tmp/es-repo | ||
- node.attr.testattr=test | ||
- cluster.routing.allocation.disk.watermark.low=1b | ||
- cluster.routing.allocation.disk.watermark.high=1b | ||
- cluster.routing.allocation.disk.watermark.flood_stage=1b | ||
- script.max_compilations_rate=2048/1m | ||
- node.store.allow_mmap=false | ||
volumes: | ||
- ./build/oss-repo:/tmp/es-repo | ||
- ./build/logs/oss-1:/usr/share/elasticsearch/logs | ||
ports: | ||
- "9200" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
elasticsearch-oss-2: | ||
image: elasticsearch:test | ||
environment: | ||
- node.name=elasticsearch-oss-2 | ||
- cluster.initial_master_nodes=elasticsearch-oss-1,elasticsearch-oss-2 | ||
- discovery.seed_hosts=elasticsearch-oss-1:9300 | ||
- cluster.name=elasticsearch-oss | ||
- discovery.type=single-node | ||
- bootstrap.memory_lock=true | ||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" | ||
- path.repo=/tmp/es-repo | ||
- node.attr.testattr=test | ||
- cluster.routing.allocation.disk.watermark.low=1b | ||
- cluster.routing.allocation.disk.watermark.high=1b | ||
- cluster.routing.allocation.disk.watermark.flood_stage=1b | ||
- script.max_compilations_rate=2048/1m | ||
- node.store.allow_mmap=false | ||
volumes: | ||
- ./build/oss-repo:/tmp/es-repo | ||
- ./build/logs/oss-2:/usr/share/elasticsearch/logs | ||
ports: | ||
- "9200" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
cd /usr/share/elasticsearch/bin/ | ||
./elasticsearch-users useradd x_pack_rest_user -p x-pack-test-password -r superuser || true | ||
echo "testnode" > /tmp/password | ||
cat /tmp/password | ./elasticsearch-keystore add -x -f -v 'xpack.security.transport.ssl.keystore.secure_password' | ||
cat /tmp/password | ./elasticsearch-keystore add -x -f -v 'xpack.security.http.ssl.keystore.secure_password' | ||
/usr/local/bin/docker-entrypoint.sh | tee > /usr/share/elasticsearch/logs/console.log |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do these with docker exec instead of modifying the entry point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not. The test fixtures are transparent w.r.t the technology used to implement them. In general there's nothing docker specific in the build scripts, and the plugin disables everything that can't run if docker is not available. I would like to keep this and thus avoid using docker exec.
Maybe this is a generic enough use-case to add env vars for creating a super-user when bringing up the container if these are present ?