Skip to content
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

Simplify PAM service tests #35

Merged
merged 2 commits into from
Sep 15, 2023
Merged

Simplify PAM service tests #35

merged 2 commits into from
Sep 15, 2023

Conversation

didrocks
Copy link
Member

Before introducing the cache in PAM service, let’s simplify the tests even more.

@didrocks didrocks requested a review from a team as a code owner September 14, 2023 15:37
@didrocks
Copy link
Member Author

I didn’t introduce some factoring in:

client := newPamClient(t)

			switch tc.sessionID {
			case "invalid-session":
			case "-":
				tc.sessionID = ""
			default:
				id := startSession(t, client, tc.username)
				if tc.sessionID == "" {
					tc.sessionID = id
				}
			}

simply because it’s used 4 times on the 8 newPAMClient calls, so it seems the amount of wrapper on wrapp will be harder to follow that the real gain of it.

This test ensure that we can successfully initialize a PAM service.
The no broker is actually no valid session ID. Simplify the tests to
only have one element to set that behaviour.
Use then a switch function which is more natural.
Copy link
Member

@denisonbarbosa denisonbarbosa left a comment

Choose a reason for hiding this comment

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

LGTM!

@didrocks didrocks merged commit a25eeb4 into main Sep 15, 2023
3 checks passed
@didrocks didrocks deleted the simplify-tests branch September 15, 2023 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants