diff --git a/sssd_test_framework/roles/ad.py b/sssd_test_framework/roles/ad.py index 41c06791..64f2c336 100644 --- a/sssd_test_framework/roles/ad.py +++ b/sssd_test_framework/roles/ad.py @@ -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 + """ + self.host.conn.run(rf""" + $ErrorActionPreference = "Stop" + Set-ADObject -Identity "{self.dn}" -Replace @{{gPCFileSysPath="{path}"}} + """) + + return self + class ADPasswordPolicy(GenericPasswordPolicy): """ diff --git a/sssd_test_framework/roles/generic.py b/sssd_test_framework/roles/generic.py index 3cdd9446..58c887c5 100644 --- a/sssd_test_framework/roles/generic.py +++ b/sssd_test_framework/roles/generic.py @@ -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): """ diff --git a/sssd_test_framework/roles/samba.py b/sssd_test_framework/roles/samba.py index 4995760f..55b2d538 100644 --- a/sssd_test_framework/roles/samba.py +++ b/sssd_test_framework/roles/samba.py @@ -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): """