From: Rob van der Linde Date: Tue, 6 Jun 2023 04:26:37 +0000 (+1200) Subject: netcmd: domain: add test for silo if policy is a dn X-Git-Tag: talloc-2.4.1~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d070a605bb0bbcb0ee49ed44192588151b104d9c;p=thirdparty%2Fsamba.git netcmd: domain: add test for silo if policy is a dn Signed-off-by: Rob van der Linde Reviewed-by: Andrew Bartlett Reviewed-by: Joseph Sutton --- 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",