Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Conversation

dai-chen
Copy link
Member

@dai-chen dai-chen commented Sep 28, 2020

Issue #, if available:

Description of changes: Comparison test for new engine doesn't support testing against ODFE cluster with security plugin enabled. The following changes are made to fix this:

  1. Pass https, user and password parameter value to SQL JDBC driver to support security plugin.
  2. Change CorrectnessTestBase to inherit from ODFERestTestCase.
  3. Change wipeAllIndices to wipeAllODFEIndices to avoid permission issue: SQLIntegTestCase already have this fix in legacy module, however it's missing in the cloned RestIntegTestCase.

Testing:

Run ODFE 1.10.1 docker with security plugin enabled:

# Run docker with security plugin against OD version
# https://github.com/opendistro-for-elasticsearch/opendistro-build/blob/master/.github/scripts/setup_runners_service.sh#L122
➜ echo "FROM opendistroforelasticsearch/opendistroforelasticsearch:1.10.1" >> Dockerfile
➜ echo "RUN echo ''  >> /usr/share/elasticsearch/config/elasticsearch.yml" >> Dockerfile
➜ echo "RUN echo \"path.repo: [\\\"/usr/share/elasticsearch\\\"]\" >> /usr/share/elasticsearch/config/elasticsearch.yml" >> Dockerfile
➜ echo "RUN echo \"script.context.field.max_compilations_rate: 1000/1m\" >> /usr/share/elasticsearch/config/elasticsearch.yml" >> Dockerfile

➜ docker build -t odfe-http:security -f Dockerfile .
Sending build context to Docker daemon  2.048kB
Step 1/4 : FROM opendistroforelasticsearch/opendistroforelasticsearch:1.10.1
 ---> b3e80722f0c5
Step 2/4 : RUN echo ''  >> /usr/share/elasticsearch/config/elasticsearch.yml
 ---> Running in 0240221db08c
Removing intermediate container 0240221db08c
 ---> 4c4e94ead724
Step 3/4 : RUN echo "path.repo: [\"/usr/share/elasticsearch\"]" >> /usr/share/elasticsearch/config/elasticsearch.yml
 ---> Running in 09ed4624d11b
Removing intermediate container 09ed4624d11b
 ---> 7e0945ada901
Step 4/4 : RUN echo "script.context.field.max_compilations_rate: 1000/1m" >> /usr/share/elasticsearch/config/elasticsearch.yml
 ---> Running in 65b17fe267fe
Removing intermediate container 65b17fe267fe
 ---> b7121fdbc2ed
Successfully built b7121fdbc2ed
Successfully tagged odfe-http:security

➜ docker run -d -p 9200:9200 -d -p 9600:9600 -e "discovery.type=single-node" --name Test-Docker-1.10.1 odfe-http:security
0f7dbc8eef669323031966b37d508574b0624b27737babfaf3de437c19040656

Run integration test against the remote docker:

./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=es-integrationtest -Dtests.class="*SQLCorrectnessIT" -Dhttps=true -Duser=admin -Dpassword=admin

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dai-chen dai-chen added SQL infra A change to infrastructure, testing, CI/CD, pipelines, etc. labels Sep 28, 2020
@dai-chen dai-chen self-assigned this Sep 28, 2020
@dai-chen dai-chen marked this pull request as ready for review September 28, 2020 21:24
Copy link
Contributor

@penghuo penghuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change.

@dai-chen dai-chen changed the title Support security plugin Support security plugin in comparison test Sep 28, 2020
@dai-chen dai-chen merged commit 29bf660 into opendistro-for-elasticsearch:develop Sep 28, 2020
joshuali925 pushed a commit that referenced this pull request Sep 28, 2020
* Support security plugin

* Wipe index permission issue
@dai-chen dai-chen deleted the support-security-plugin-in-new-engine-integ-test branch September 28, 2020 22:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
infra A change to infrastructure, testing, CI/CD, pipelines, etc. SQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants