Skip to content

Keystone User: Mutability tests for enabled and passwordRef fields#731

Merged
mandre merged 1 commit intok-orc:mainfrom
dlaw4608:user_unit_tests
Apr 2, 2026
Merged

Keystone User: Mutability tests for enabled and passwordRef fields#731
mandre merged 1 commit intok-orc:mainfrom
dlaw4608:user_unit_tests

Conversation

@dlaw4608
Copy link
Copy Markdown
Contributor

@dlaw4608 dlaw4608 commented Apr 1, 2026

Closes #730
TestHandleEnableUpdate

  • Compares desired state (K8s) vs actual state (openstack)

TestReconcilePassword

  • Uses mock openstack client and fake k8s client to verify the functions reconciliation logic that passwordReconcile reads passwords from secrets correctly, only calls UpdateUser when actually needed and tracks what password was last applied

@github-actions github-actions bot added the semver:patch No API change label Apr 1, 2026
@dlaw4608 dlaw4608 changed the title Keystone User: Mutability tests for User Controllers enabled and passwordRef fields Keystone User: Mutability tests for enabled and passwordRef fields Apr 1, 2026
@dlaw4608 dlaw4608 marked this pull request as ready for review April 1, 2026 09:14
}
}

func TestHandleEnableUpdate(t *testing.T) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit, the field is called enabled, the function is called handleEnabledUpdate, so the function should be called TestHandleEnabledUpdate for consistency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oof fixed it there thanks @mandre

TestHandleEnableUpdate
- Compares desired state (K8s) vs actual state (openstack)

TestReconcilePassword
- Uses mock openstack client and fake k8s client to verify the functions reconciliation logic
that passwordReconcile reads passwords from secrets correctly, only calls UpdateUser when actually needed
and tracks what password was last applied

Signed-off-by: Daniel Lawton <dlawton@redhat.com>
@mandre mandre added this pull request to the merge queue Apr 2, 2026
Merged via the queue into k-orc:main with commit be5257f Apr 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:patch No API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keystone User Controller: Adding Unit testing for mutable fields (PasswordRef and Enabled)

2 participants