Skip to content
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

Add explicit "roles.yml" support to testclusters #82137

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

tvernum
Copy link
Contributor

@tvernum tvernum commented Dec 30, 2021

Previously, within tests, the file "roles.yml" (that is used to define
security roles in a cluster) would need to be configured using
extraConfigFile. This is effective, but means that there can only be
a single source of security roles for the testcluster.

This change introduces an explicit "securityRoles" setting in
testclusters that will concatenate the provided files into a single
"roles.yml" in the config directory. This makes it possible for
testclusters itself to define standard roles as well as having each
test define additional roles it may need.

Relates: #81400

Previously, within tests, the file "roles.yml" (that is used to define
security roles in a cluster) would need to be configured using
`extraConfigFile`. This is effective, but means that there can only be
a single source of security roles for the testcluster.

This change introduces an explicit "securityRoles" setting in
testclusters that will concatenate the provided files into a single
"roles.yml" in the config directory. This makes it possible for
testclusters itself to define standard roles as well as having each
test define additional roles it may need.

Relates: elastic#81400
@tvernum tvernum added >test Issues or PRs that are addressing/adding tests :Delivery/Build Build or test infrastructure v8.0.0 v8.1.0 labels Dec 30, 2021
@tvernum tvernum requested a review from a team December 30, 2021 01:57
@elasticmachine elasticmachine added the Team:Delivery Meta label for Delivery team label Dec 30, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@tvernum
Copy link
Contributor Author

tvernum commented Dec 30, 2021

In #81400 we're changing the privileges of superuser so that is can no longer do some of the things that the test infrastructure needs (e.g. delete system indices between tests).
To overcome that we need the test code to introduce a new role that has those privileges. However, there was no easy way for ElasticsearchNode to install a roles.yml file if the test itself also had one.

I could put a hack into ElasticsearchNode to recognise an extraConfigFile named "roles.yml" and manipulate it to add the additional role, but it seemed like a better idea to push the config into a first class property instead.

I've only changed 1 QA test in this PR. Once it's approved I can go through and change all the other tests as well and then we can consider making it an error to set roles.yml as an extraConfigFile.

Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

Couple of comments but otherwise LGTM. Thanks, Tim.

@tvernum tvernum merged commit cb40354 into elastic:master Jan 5, 2022
tvernum added a commit to tvernum/elasticsearch that referenced this pull request Jan 5, 2022
Previously, within tests, the file "roles.yml" (that is used to define
security roles in a cluster) would need to be configured using
`extraConfigFile`. This is effective, but means that there can only be
a single source of security roles for the testcluster.

This change introduces an explicit "securityRoles" setting in
testclusters that will concatenate the provided files into a single
"roles.yml" in the config directory. This makes it possible for
testclusters itself to define standard roles as well as having each
test define additional roles it may need.

Relates: elastic#81400

Backport of: elastic#82137
elasticsearchmachine pushed a commit that referenced this pull request Jan 5, 2022
Previously, within tests, the file "roles.yml" (that is used to define
security roles in a cluster) would need to be configured using
`extraConfigFile`. This is effective, but means that there can only be
a single source of security roles for the testcluster.

This change introduces an explicit "securityRoles" setting in
testclusters that will concatenate the provided files into a single
"roles.yml" in the config directory. This makes it possible for
testclusters itself to define standard roles as well as having each
test define additional roles it may need.

Relates: #81400

Backport of: #82137
@mark-vieira
Copy link
Contributor

@tvernum can we backport this to 7.17 as well? We want to keep all long term support branches as similar as possible WRT to build infrastructure since it makes our lives considerably easier down the road.

tvernum added a commit to tvernum/elasticsearch that referenced this pull request Jan 6, 2022
Previously, within tests, the file "roles.yml" (that is used to define
security roles in a cluster) would need to be configured using
`extraConfigFile`. This is effective, but means that there can only be
a single source of security roles for the testcluster.

This change introduces an explicit "securityRoles" setting in
testclusters that will concatenate the provided files into a single
"roles.yml" in the config directory. This makes it possible for
testclusters itself to define standard roles as well as having each
test define additional roles it may need.

Relates: elastic#81400

Backport of: elastic#82137
elasticsearchmachine pushed a commit that referenced this pull request Jan 6, 2022
Previously, within tests, the file "roles.yml" (that is used to define
security roles in a cluster) would need to be configured using
`extraConfigFile`. This is effective, but means that there can only be
a single source of security roles for the testcluster.

This change introduces an explicit "securityRoles" setting in
testclusters that will concatenate the provided files into a single
"roles.yml" in the config directory. This makes it possible for
testclusters itself to define standard roles as well as having each
test define additional roles it may need.

Relates: #81400

Backport of: #82137
astefan pushed a commit to astefan/elasticsearch that referenced this pull request Jan 7, 2022
Previously, within tests, the file "roles.yml" (that is used to define
security roles in a cluster) would need to be configured using
`extraConfigFile`. This is effective, but means that there can only be
a single source of security roles for the testcluster.

This change introduces an explicit "securityRoles" setting in
testclusters that will concatenate the provided files into a single
"roles.yml" in the config directory. This makes it possible for
testclusters itself to define standard roles as well as having each
test define additional roles it may need.

Relates: elastic#81400
astefan pushed a commit to astefan/elasticsearch that referenced this pull request Jan 7, 2022
Previously, within tests, the file "roles.yml" (that is used to define
security roles in a cluster) would need to be configured using
`extraConfigFile`. This is effective, but means that there can only be
a single source of security roles for the testcluster.

This change introduces an explicit "securityRoles" setting in
testclusters that will concatenate the provided files into a single
"roles.yml" in the config directory. This makes it possible for
testclusters itself to define standard roles as well as having each
test define additional roles it may need.

Relates: elastic#81400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team >test Issues or PRs that are addressing/adding tests v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants