Skip to content

Commit

Permalink
Add topology controller example
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-stephenson committed Feb 5, 2024
1 parent cb76173 commit 8017828
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sssd_test_framework/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
"KnownTopologyGroup",
]

class ExampleController(TopologyController):
# Override methods that you wish to use
def skip(self, client: ClientHost) -> str | None:
result = client.ssh.run("exit 1", raise_on_error=False)
if result.rc != 0:
return "Topology requirements were not met"
return None

class SSSDTopologyMark(TopologyMark):
"""
Expand Down Expand Up @@ -219,6 +226,12 @@ def test_ldap(client: Client, ldap: LDAP):
.. topology-mark:: KnownTopology.IPATrustSamba
"""

EXAMPLE = SSSDTopologyMark(
name='example',
topology=Topology(TopologyDomain("sssd", client=1)),
controller=ExampleController(),
fixtures=dict(client='sssd.client[0]'),
)

class KnownTopologyGroup(KnownTopologyGroupBase):
"""
Expand Down

0 comments on commit 8017828

Please sign in to comment.