Skip to content

make testing better mimic reality for securitymanager#10965

Merged
rmuir merged 5 commits intoelastic:masterfrom
rmuir:lockdown4
May 5, 2015
Merged

make testing better mimic reality for securitymanager#10965
rmuir merged 5 commits intoelastic:masterfrom
rmuir:lockdown4

Conversation

@rmuir
Copy link
Copy Markdown
Contributor

@rmuir rmuir commented May 4, 2015

The two things are not the same today: so in tests we should use the same technique, and install policy etc the same way. But today tests do things differently than bin/elasticsearch, like use a java.security.policy system property. And this hides bugs!

Once its fixed to work the same way, we see the bugs, the java.io.tmpdir sysprop substitution does not work (#10925 this is some chicken/egg problem in the jvm). We don't use this method and instead dynamically generate it just like other paths in environment.

Second, today things like SSL are not going to work at all. That is because we don't have any grants for system permissions for jdk codesources (but when you set a sysprop, like tests were doing, it sucks in default files).

Finally, this has the advantage that now tests too, don't depend on the environment, like policy configurations on the machine that someone may have changed.

@s1monw
Copy link
Copy Markdown
Contributor

s1monw commented May 4, 2015

good catch rob! LGTM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

] -> } after java.home?

@rmuir
Copy link
Copy Markdown
Contributor Author

rmuir commented May 4, 2015

@rjernst @s1monw i pushed a new commit: rmuir@072b902

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can the 2 tests calling this with false just override java.io.tmpdir for the test? then no need for a new boolean?

@s1monw
Copy link
Copy Markdown
Contributor

s1monw commented May 4, 2015

still LGTM

@rjernst
Copy link
Copy Markdown
Member

rjernst commented May 4, 2015

LGTM, I pushed a change to remove the flag for adding tmp dir permissions.

rmuir added a commit that referenced this pull request May 5, 2015
make testing better mimic reality for securitymanager
@rmuir rmuir merged commit d62771a into elastic:master May 5, 2015
@rmuir
Copy link
Copy Markdown
Contributor Author

rmuir commented May 5, 2015

Thanks for that test improvement @rjernst

@s1monw s1monw deleted the lockdown4 branch May 5, 2015 16:09
@clintongormley clintongormley added the >test Issues or PRs that are addressing/adding tests label Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>test Issues or PRs that are addressing/adding tests v2.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants