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

Support security plugin enabled testing in CI #182

Merged
merged 3 commits into from
Jun 30, 2020

Conversation

kaituo
Copy link
Member

@kaituo kaituo commented Jun 30, 2020

Issue #, if available:
#142

Description of changes:
This change is to support integration testing against remote security-enabled clustering in our CI. Currently, we only support the integration testing without a security plugin and have to remove the security plugin in CI.

The critical change is to create an https client with basic auth in ODFERestTestCase and let our rest test case inherit from ODFERestTestCase. With default security configuration, the password for the admin user is also “admin.” For ssl certification, we choose to disable it since it’s the default demo cert used here.

Testing done:

  • ran the scripts on CI workflow on Mac and tested it works.
  • gradle build still passes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This change is to support integration testing against remote security-enabled clustering in our CI. Currently, we only support the integration testing without a security plugin and have to remove the security plugin in CI.

The critical change is to create an https client with basic auth in ODFERestTestCase and let our rest test case inherit from ODFERestTestCase. With default security configuration, the password for the admin user is also “admin.” For ssl certification, we choose to disable it since it’s the default demo cert used here.

Testing done:
* ran the scripts on CI/CD workflow on Mac and tested it works.
* gradle build still passes.
if (isHttps) {
// currently only external cluster is supported for security enabled testing
if (!Optional.ofNullable(System.getProperty("tests.rest.cluster")).isPresent()) {
throw new RuntimeException("external cluster url should be provided for security enabled testing");
Copy link
Contributor

Choose a reason for hiding this comment

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

external might be confusing as in the CI we are actually using localhost. Maybe we can just say "cluster url should be provided for security enabled testing"

Copy link
Member Author

Choose a reason for hiding this comment

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

make sense. changed.

Copy link
Contributor

@yizheliu-amazon yizheliu-amazon left a comment

Choose a reason for hiding this comment

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

minor comment. looks good to me.

@kaituo kaituo merged commit b36d7fc into opendistro-for-elasticsearch:master Jun 30, 2020
yizheliu-amazon pushed a commit that referenced this pull request Aug 28, 2020
* Support security plugin enabled testing in CI

This change is to support integration testing against remote security-enabled clustering in our CI. Currently, we only support the integration testing without a security plugin and have to remove the security plugin in CI.

The critical change is to create an https client with basic auth in ODFERestTestCase and let our rest test case inherit from ODFERestTestCase. With default security configuration, the password for the admin user is also “admin.” For ssl certification, we choose to disable it since it’s the default demo cert used here.

Testing done:
* ran the scripts on CI/CD workflow on Mac and tested it works.
* gradle build still passes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants