-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-30042 Test AuthUtil.loginClient with existing Kerberos login #8002
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: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,13 +133,14 @@ public void testLoginWithUserKeytabAndPrincipal() throws Exception { | |
| } | ||
|
|
||
| @Test | ||
| public void testAuthUtilLogin() throws Exception { | ||
| public void testAuthUtilLoginWithExistingLoginUser() throws Exception { | ||
| String clientKeytab = getClientKeytabForTesting(); | ||
| String clientPrincipal = getClientPrincipalForTesting(); | ||
| Configuration conf = getSecuredConfiguration(); | ||
| conf.set(AuthUtil.HBASE_CLIENT_KEYTAB_FILE, clientKeytab); | ||
| conf.set(AuthUtil.HBASE_CLIENT_KERBEROS_PRINCIPAL, clientPrincipal); | ||
| UserGroupInformation.setConfiguration(conf); | ||
| UserGroupInformation.loginUserFromKeytab(clientPrincipal, clientKeytab); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, this issue has been bothering me for a while, and I can confirm this makes the test pass. However, if we do this, we no longer test if |
||
|
|
||
| User user = AuthUtil.loginClient(conf); | ||
| assertTrue(user.isLoginFromKeytab()); | ||
|
|
||
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.
Let's update this test to only cover the case where a Kerberos user is already logged in.