Skip to content

Commit c727782

Browse files
shridhargadekarspoore1
authored andcommitted
Uniform admin user declaration
Declaring an administrative user across ad, ipa, samba hosts. This uniform declaration will help to use admin user intuitively in tests
1 parent 98f46e9 commit c727782

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

sssd_test_framework/hosts/ad.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def __init__(self, *args, **kwargs) -> None:
4343
self.adminpw: str = self.config.get("adminpw", "Secret123")
4444
"""Password of the Administrator user, defaults to ``Secret123``."""
4545

46+
self.adminuser: str = self.config.get("adminuser", "administrator")
47+
"""Administrator user, defaults to ``administrator``."""
48+
4649
# Additional client configuration
4750
self.client.setdefault("id_provider", "ad")
4851
self.client.setdefault("access_provider", "ad")

sssd_test_framework/hosts/ipa.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ def __init__(self, *args, **kwargs) -> None:
5151
self.adminpw: str = self.config.get("adminpw", "Secret123")
5252
"""Password of the admin user, defaults to ``Secret123``."""
5353

54+
self.adminuser: str = self.config.get("adminuser", "admin")
55+
"""Administrator user, defaults to ``admin``."""
56+
5457
self._features: dict[str, bool] | None = None
5558

5659
# Additional client configuration

sssd_test_framework/hosts/samba.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, *args, **kwargs) -> None:
3030

3131
self._features: dict[str, bool] | None = None
3232

33-
self.admin: str = self.config.get("username", "Administrator")
33+
self.adminuser: str = self.config.get("username", "Administrator")
3434
"""Username of the admin user, defaults to value of ``Administrator``."""
3535

3636
self.adminpw: str = self.config.get("adminpw", self.bindpw)

sssd_test_framework/roles/samba.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ def __init__(self, role: Samba, name: str) -> None:
937937
"""Group policy search base."""
938938

939939
# samba-tool gpo commands edit the database files directly and need to be authenticated.
940-
self.credentials: str = f" --username={self.role.host.admin} --password={self.role.host.adminpw}"
940+
self.credentials: str = f" --username={self.role.host.adminuser} --password={self.role.host.adminpw}"
941941
"""Credentials to manage GPOs."""
942942

943943
def add(self) -> SambaGPO:
@@ -986,7 +986,7 @@ def link(
986986
"Guid": (self.cli.option.POSITIONAL, self.cn),
987987
"enforce": (self.cli.option.SWITCH, enforced),
988988
"disable": (self.cli.option.SWITCH, disabled),
989-
"username": (self.cli.option.VALUE, self.role.host.admin),
989+
"username": (self.cli.option.VALUE, self.role.host.adminuser),
990990
"password": (self.cli.option.VALUE, self.role.host.adminpw),
991991
}
992992

0 commit comments

Comments
 (0)