Skip to content

Commit

Permalink
authselect: adding authselect current, enable-feature and disable-fea…
Browse files Browse the repository at this point in the history
…ture methods
  • Loading branch information
Dan Lavu committed Aug 18, 2023
1 parent f5acb58 commit b5570e6
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion sssd_test_framework/utils/authselect.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def select(self, profile: str, features: list[str] = []) -> None:
"""
Select an authselect profile.
:param profile: Autheselect profile name.
:param profile: Authselect profile name.
:type profile: str
:param features: Authselect features to enable, defaults to []
:type features: list[str], optional
Expand All @@ -61,3 +61,29 @@ def select(self, profile: str, features: list[str] = []) -> None:
backup = [f"--backup={self.__backup}"]

self.host.ssh.exec(["authselect", "select", profile, *features, "--force", *backup])

def current(self) -> str:
"""
List current Authselect configuration.
:return: Authselect configuration
:rtype: str
"""
result = self.host.ssh.exec(["authselect", "current"]).stdout

return result

def disable_feature(self, features: list[str]) -> None:
"""
Disable Authselect feature.
:param features: Authselect features to enable
:type: list[str], required
"""
self.host.ssh.exec(["authselect", "disable-feature", *features])

def enable_feature(self, features: list[str]) -> None:
"""
Enable Authselect feature.
:param features: Authselect features to enable
:type: list[str], required
"""
self.host.ssh.exec(["authselect", "enable-feature", *features])

0 comments on commit b5570e6

Please sign in to comment.