Skip to content

Commit

Permalink
ipa: do not attempt to kinit if features are already detected
Browse files Browse the repository at this point in the history
kinit was run every time this property was accessed. This caused
"Calling exit but enter was not called" exception in pytest-mh
under special conditions:

- a test fails in a way that leaves IPA inoperable
- IPA restore does not work
- new test has `builtwith` marker that access IPA.features

In this case kinit was called, failed and exepction was thrown.
pytest-mh then skipped setup but attempted to teardown
  • Loading branch information
pbrezina committed Nov 1, 2024
1 parent 5b872da commit 7bcb65e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sssd_test_framework/hosts/ipa.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ def features(self) -> dict[str, bool]:
"""
Features supported by the host.
"""
self.kinit()

if self._features is not None:
return self._features

self.logger.info(f"Detecting features on {self.hostname}")
self.kinit()

result = self.conn.run(
"""
Expand Down

0 comments on commit 7bcb65e

Please sign in to comment.