diff options
| author | Rob van der Linde <rob@catalyst.net.nz> | 2023-06-06 16:26:37 +1200 |
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2023-06-25 23:29:32 +0000 |
| commit | d070a605bb0bbcb0ee49ed44192588151b104d9c (patch) | |
| tree | da0d0ca74f797b4f2ca6bfc4fb10b28dac16a01e /python/samba | |
| parent | df5e6045fa1c0ee2225fc76d7ff83dee57c2576e (diff) | |
| download | samba-d070a605bb0bbcb0ee49ed44192588151b104d9c.tar.gz samba-d070a605bb0bbcb0ee49ed44192588151b104d9c.tar.bz2 samba-d070a605bb0bbcb0ee49ed44192588151b104d9c.zip | |
netcmd: domain: add test for silo if policy is a dn
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Diffstat (limited to 'python/samba')
| -rw-r--r-- | python/samba/tests/samba_tool/domain_auth_silo.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/samba/tests/samba_tool/domain_auth_silo.py b/python/samba/tests/samba_tool/domain_auth_silo.py index 0970559a8df..96e617dfbe3 100644 --- a/python/samba/tests/samba_tool/domain_auth_silo.py +++ b/python/samba/tests/samba_tool/domain_auth_silo.py @@ -118,6 +118,23 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest): self.assertIn("Computer Policy", str(silo["msDS-ComputerAuthNPolicy"])) self.assertEqual(str(silo["msDS-AuthNPolicySiloEnforced"]), "TRUE") + def test_authentication_silo_create_policy_dn(self): + """Test creating a new authentication silo when policy is a dn.""" + policy = self.get_authentication_policy("Single Policy") + + result, out, err = self.runcmd("domain", "auth", "silo", "create", + "--name", "singlePolicyDN", + "--policy", policy["dn"]) + self.assertIsNone(result, msg=err) + + # Check silo that was created + silo = self.get_authentication_silo("singlePolicyDN") + self.assertEqual(str(silo["cn"]), "singlePolicyDN") + self.assertIn(str(policy["name"]), str(silo["msDS-UserAuthNPolicy"])) + self.assertIn(str(policy["name"]), str(silo["msDS-ServiceAuthNPolicy"])) + self.assertIn(str(policy["name"]), str(silo["msDS-ComputerAuthNPolicy"])) + self.assertEqual(str(silo["msDS-AuthNPolicySiloEnforced"]), "TRUE") + def test_authentication_silo_create_already_exists(self): """Test creating a new authentication silo that already exists.""" result, out, err = self.runcmd("domain", "auth", "silo", "create", |
