Repository navigation
tests: collapse su/ssh parametrization in test_gpo.py - #9401
Conversation
|
At a quick glance: make the assert messages mention su/ssh to make possible error more clear. Group the asserts together the same way as the steps describing them:
assert ssh(user1), "user1 was blocked on ssh!" |
There was a problem hiding this comment.
Mostly LGTM, just make sure to align order of asserts to steps and distinguish error message for ssh and su asserts. (see inline)
Different suggestion: If the steps+results are duplicated like this:
- deny ssh
- allow ssh
- deny su
- allow su
Then can the code be put in loop over method:
for method in ["ssh", "su"]:
assert method(allow), "Failed {method}!"
assert method(deny), "Allowed {method}!"
fb0d038 to
e03a58b
Compare
|
I added the auth mechanism to the error messages, but I think I'm skipping the loop; it's not saving a lot of lines except for a few tests. |
e03a58b to
b9b6db7
Compare
Drop parametrization of su and ssh and calls in the gpo tests. The setup and teardown in AD is costly. This is the same approach Jakub used in PR SSSD#9045 shaving 20 minutes on runtime. AI: Claude Sonnet 5 Co-authored-by: Cursor <cursoragent@cursor.com> Reviewed-by: Jakub Vávra <jvavra@redhat.com>
b9b6db7 to
90ed8ae
Compare
Drop parametrization of su and ssh and calls in the gpo tests. The setup and teardown in AD is costly. This is the same approach Jakub used in PR #9045 shaving 20 minutes on runtime.
AI: Claude Sonnet 5