-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Entitle com.unboundid.ldap.listener as test package #130706
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
base: main
Are you sure you want to change the base?
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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.
Did you consider simply adding com.unboundid.ldap.listener
to the existing list?
} | ||
return false; | ||
idx = -idx - 2; // candidate package (insertion point - 1) | ||
return idx >= 0 && idx < entitledTestPackages.length && packageName.startsWith(entitledTestPackages[idx]); |
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.
This could probably use a unit test, given the opportunity for off-by-one errors.
It inherits an existing bug where org.example.pack
will be viewed as a prefix of org.example.package
even though the two packages are unrelated. We somewhat got away with this before because it was a fixed set of packages known not to have this problem, but now that the API can add them dynamically, it becomes a possibility.
(We've overdue for writing a proper string prefix trie. 😅)
Also, I think our experience with FileAccessTree
shows that this will fail for looking up org.example.foo
if the array already contains org.example
and org.example.bar
. In this case, the binary search will land on org.example.bar
which is not a prefix. In FileAccessTree
we deal with this by removing entries that have a prefix already in the list.
if (TestEntitlementBootstrap.isEnabledForTest()) { | ||
TestEntitlementBootstrap.setActive(false == withoutEntitlements); | ||
TestEntitlementBootstrap.setTriviallyAllowingTestCode(false == withEntitlementsOnTestCode); | ||
if (entitledPackages != null) { | ||
assert withEntitlementsOnTestCode == false : "Cannot use @WithEntitlementsOnTestCode together with @EntitledTestPackages"; |
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.
Why is this?
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.
these contradict each other
Also I think we're still backporting to 8.19? |
I did, but this (aka having to entitle more test packages) has come up multiple times now and in this case the required package is highly specific, so I'd rather extend the list of packages for specific tests only. |
This removes
inbound_network
from x-pack core and instead configurescom.unboundid.ldap.listener
as test package for LDAP and related test cases that start an LDAP server listening for requests.Relates to ES-12128