Skip to content

Commit d0837b2

Browse files
krishnavemaspoore1
authored andcommitted
Add Certificate Authority functionality for AD
1 parent a2c7122 commit d0837b2

6 files changed

Lines changed: 754 additions & 23 deletions

File tree

sssd_test_framework/hosts/ad.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,12 @@ def restore(self, backup_data: Any | None) -> None:
307307
}}
308308
}}
309309
310+
# Clean up certificate directories
311+
if (Test-Path "C:\pki") {{
312+
Write-Host "Cleaning up certificate directories in C:\pki"
313+
Remove-Item "C:\pki" -Recurse -Force -ErrorAction SilentlyContinue
314+
}}
315+
310316
# If we got here, make sure we exit with 0
311317
Exit 0
312318
""",

sssd_test_framework/misc/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,16 @@ def get_attr(data: dict[str, Any], key: str, default: Any | None = None) -> Any
333333
return default
334334
return value[0] if len(value) == 1 else value
335335
return value
336+
337+
338+
def attrs_ad_parse(output: str) -> dict[str, list[str]]:
339+
"""
340+
Parse AD object output into dictionary.
341+
342+
:param output: PowerShell AD object output.
343+
:type output: str
344+
:returns: Dictionary of AD object attributes.
345+
:rtype: dict[str, list[str]]
346+
"""
347+
lines = [line.strip() for line in (output or "").splitlines() if line.strip()]
348+
return attrs_parse(lines)

0 commit comments

Comments
 (0)