Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions sssd_test_framework/roles/ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -2255,6 +2255,27 @@ def policy(self, logon_rights: dict[str, list[ADObject]], cfg: dict[str, Any] |

return self

def filesyspath(self, path: str) -> GPO:
"""
Overwrite the GPO's ``gPCFileSysPath`` attribute.

Implements :meth:`GenericGPO.filesyspath`.

Modifies the GPO 'gPCFileSysPath' attribute in LDAP.
This should not be used in any circumstance, added to verify a bug.

:param path: gPCFileSysPath value.
:type path: str
:return: Group policy object
:rtype: GPO
"""
Comment thread
jakub-vavra-cz marked this conversation as resolved.
self.host.conn.run(rf"""
$ErrorActionPreference = "Stop"
Set-ADObject -Identity "{self.dn}" -Replace @{{gPCFileSysPath="{path}"}}
""")
Comment thread
danlavu marked this conversation as resolved.

return self


class ADPasswordPolicy(GenericPasswordPolicy):
"""
Expand Down
15 changes: 15 additions & 0 deletions sssd_test_framework/roles/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,21 @@ def policy(self, logon_rights: dict[str, list[Any]], cfg: dict[str, Any] | None
"""
pass

@abstractmethod
def filesyspath(self, path: str) -> GenericGPO:
"""
Overwrite the GPO's ``gPCFileSysPath`` attribute.

Modifies the GPO 'gPCFileSysPath' attribute in LDAP.
This should not be used in any circumstance, added to verify a bug.

:param path: gPCFileSysPath value.
:type path: str
:return: Self.
:rtype: GenericGPO
"""
raise NotImplementedError()


class GenericPasswordPolicy(ABC, BaseObject):
"""
Expand Down
19 changes: 19 additions & 0 deletions sssd_test_framework/roles/samba.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,25 @@ def policy(self, logon_rights: dict[str, list[Any]], cfg: dict[str, Any] | None

return self

def filesyspath(self, path: str) -> SambaGPO:
"""
Overwrite the GPO's ``gPCFileSysPath`` attribute.

Implements :meth:`GenericGPO.filesyspath`.

Modifies the GPO 'gPCFileSysPath' attribute in LDAP.
This should not be used in any circumstance, added to verify a bug.

:param path: gPCFileSysPath value.
:type path: str
:return: Samba group policy object
:rtype: SambaGPO
"""
attrs: LDAPRecordAttributes = {"gPCFileSysPath": path}
self._modify(attrs)

return self


class SambaPasswordPolicy(GenericPasswordPolicy):
"""
Expand Down
Loading