-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-3178. Add unit tests for OMGetDelegationToken Request and Response #770
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
Conversation
|
@hanishakoneru since you created the task for this change, may I ask you to review? |
hanishakoneru
left a comment
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.
Thank you @cxorm for working on this. Overall LGTM. Just a minor comment.
@bharatviswa504 do you wanna take a quick look as you worked on the DelegationTokenRequests?
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.
Do we need to set the secretManager again? OzoneManager.getDelegationTokenMgr is going to return the same object again.
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.
Thank you @hanishakoneru for the review.
Yes, we don't need secretManager here.
Updated.
816fceb to
f7b5341
Compare
|
LGTM. +1 pending CI. |
|
Rebase latest master-branch(#839) and trigger github-actions. |
|
Thanks @cxorm for working on this. I will merge this PR. |
|
Thanks @hanishakoneru for the merge. |
What changes were proposed in this pull request?
Proposed change.
Part for testing
OMGetDelegationTokenRequestIn
OMGetDelegationTokenRequest#preExecute, if theToken<OzoneTokenIdentifier> tokenis notnull, we setUpdateGetDelegationTokenRequestwithrenewIntervaland we setGetDelegationTokenResponsewith response. So the UT test these items.If the
Token<OzoneTokenIdentifier> tokenisnull, we do not setGetDelegationTokenResponsewith response and UT verified it.In
OMGetDelegationTokenRequest#validateAndUpdateCache, if the token is notnull, we will getOMClientResponsewith non "-1" renewTime and UT verified it.The UT also tests
validateAndUpdateCachewithToken<OzoneTokenIdentifier>that causes Exception.Part for testing
OMGetDelegationTokenResponseThe UT in this part tests functionality of
addToDBBatch.Create base classes
TestOMDelegationTokenResponseandTestOMDelegationTokenRequestfor later used bycancelTokenandrenewToken.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-3178
How was this patch tested?
Add UTs including
TestOMGetDelegationTokenRequestTestOMGetDelegationTokenResponse