"""Test creating a new authentication policy."""
self.addCleanup(self.delete_authentication_policy,
name="createTest", force=True)
-
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name", "createTest")
self.assertIsNone(result, msg=err)
"""Test creating a new authentication policy with description set."""
self.addCleanup(self.delete_authentication_policy,
name="descriptionTest", force=True)
-
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name", "descriptionTest",
"--description", "Custom Description")
"""
self.addCleanup(self.delete_authentication_policy,
name="userTGTLifetime", force=True)
-
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name", "userTGTLifetime",
"--user-tgt-lifetime-mins", "60")
"""
self.addCleanup(self.delete_authentication_policy,
name="serviceTGTLifetime", force=True)
-
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name", "serviceTGTLifetime",
"--service-tgt-lifetime-mins", "60")
"""
self.addCleanup(self.delete_authentication_policy,
name="computerTGTLifetime", force=True)
-
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name", "computerTGTLifetime",
"--computer-tgt-lifetime-mins", "60")
self.addCleanup(self.delete_authentication_policy,
name="validSDDLPolicy", force=True)
-
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name", "validSDDLPolicy",
"--user-allowed-to-authenticate-from",
def test_create__audit(self):
"""Test create authentication policy with --audit flag."""
+ self.addCleanup(self.delete_authentication_policy,
+ name="auditPolicy", force=True)
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name", "auditPolicy",
"--audit")
def test_create__enforce(self):
"""Test create authentication policy with --enforce flag."""
+ self.addCleanup(self.delete_authentication_policy,
+ name="enforcePolicy", force=True)
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name", "enforcePolicy",
"--enforce")
def test_modify__description(self):
"""Test modifying an authentication policy description."""
- # Create a policy to modify for this test.
name = "modifyDescription"
- self.runcmd("domain", "auth", "policy", "create", "--name", name)
+
+ # Create a policy to modify for this test.
self.addCleanup(self.delete_authentication_policy,
name=name, force=True)
+ self.runcmd("domain", "auth", "policy", "create", "--name", name)
# Change the policy description.
result, out, err = self.runcmd("domain", "auth", "policy", "modify",
def test_modify__strong_ntlm_policy(self):
"""Test modify strong ntlm policy on the authentication policy."""
- # Create a policy to modify for this test.
name = "modifyStrongNTLMPolicy"
- self.runcmd("domain", "auth", "policy", "create", "--name", name)
+
+ # Create a policy to modify for this test.
self.addCleanup(self.delete_authentication_policy,
name=name, force=True)
+ self.runcmd("domain", "auth", "policy", "create", "--name", name)
result, out, err = self.runcmd("domain", "auth", "policy", "modify",
"--name", name,
This includes checking the upper and lower bounds.
"""
- # Create a policy to modify for this test.
name = "modifyUserTGTLifetime"
- self.runcmd("domain", "auth", "policy", "create", "--name", name)
+
+ # Create a policy to modify for this test.
self.addCleanup(self.delete_authentication_policy,
name=name, force=True)
+ self.runcmd("domain", "auth", "policy", "create", "--name", name)
result, out, err = self.runcmd("domain", "auth", "policy", "modify",
"--name", name,
This includes checking the upper and lower bounds.
"""
- # Create a policy to modify for this test.
name = "modifyServiceTGTLifetime"
- self.runcmd("domain", "auth", "policy", "create", "--name", name)
+
+ # Create a policy to modify for this test.
self.addCleanup(self.delete_authentication_policy,
name=name, force=True)
+ self.runcmd("domain", "auth", "policy", "create", "--name", name)
result, out, err = self.runcmd("domain", "auth", "policy", "modify",
"--name", name,
This includes checking the upper and lower bounds.
"""
- # Create a policy to modify for this test.
name = "modifyComputerTGTLifetime"
- self.runcmd("domain", "auth", "policy", "create", "--name", name)
+
+ # Create a policy to modify for this test.
self.addCleanup(self.delete_authentication_policy,
name=name, force=True)
+ self.runcmd("domain", "auth", "policy", "create", "--name", name)
result, out, err = self.runcmd("domain", "auth", "policy", "modify",
"--name", name,
def test_modify__audit_enforce(self):
"""Test modify authentication policy using --audit and --enforce."""
- # Create a policy to modify for this test.
name = "modifyEnforce"
- self.runcmd("domain", "auth", "policy", "create", "--name", name)
+
+ # Create a policy to modify for this test.
self.addCleanup(self.delete_authentication_policy,
name=name, force=True)
+ self.runcmd("domain", "auth", "policy", "create", "--name", name)
# Change to audit, the default is --enforce.
result, out, err = self.runcmd("domain", "auth", "policy", "modify",
def test_modify__protect_unprotect(self):
"""Test modify authentication policy using --protect and --unprotect."""
- # Create a policy to modify for this test.
name = "modifyProtect"
- self.runcmd("domain", "auth", "policy", "create", "--name", name)
+
+ # Create a policy to modify for this test.
self.addCleanup(self.delete_authentication_policy,
name=name, force=True)
+ self.runcmd("domain", "auth", "policy", "create", "--name", name)
utils = SDUtils(self.samdb)
result, out, err = self.runcmd("domain", "auth", "policy", "modify",
def test_delete__force_fails(self):
"""Test deleting an authentication policy with --force, but it fails."""
# Create protected authentication policy.
+ self.addCleanup(self.delete_authentication_policy,
+ name="deleteForceFail", force=True)
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name=deleteForceFail",
"--protect")
def test_delete__fails(self):
"""Test deleting an authentication policy, but it fails."""
# Create regular authentication policy.
+ self.addCleanup(self.delete_authentication_policy,
+ name="regularPolicy", force=True)
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name=regularPolicy")
self.assertIsNone(result, msg=err)
def test_delete__protected_fails(self):
"""Test deleting an authentication policy, but it fails."""
# Create protected authentication policy.
+ self.addCleanup(self.delete_authentication_policy,
+ name="protectedPolicy", force=True)
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name=protectedPolicy",
"--protect")
def test_modify__description(self):
"""Test modify authentication silo changing the description field."""
- # Create a silo to modify for this test.
name = "modifyDescription"
- self.runcmd("domain", "auth", "silo", "create", "--name", name)
+
+ # Create a silo to modify for this test.
self.addCleanup(self.delete_authentication_silo,
name=name, force=True)
+ self.runcmd("domain", "auth", "silo", "create", "--name", name)
result, out, err = self.runcmd("domain", "auth", "silo", "modify",
"--name", name,
def test_modify__audit_enforce(self):
"""Test modify authentication silo setting --audit and --enforce."""
- # Create a silo to modify for this test.
name = "modifyEnforce"
- self.runcmd("domain", "auth", "silo", "create", "--name", name)
+
+ # Create a silo to modify for this test.
self.addCleanup(self.delete_authentication_silo,
name=name, force=True)
+ self.runcmd("domain", "auth", "silo", "create", "--name", name)
result, out, err = self.runcmd("domain", "auth", "silo", "modify",
"--name", name,
def test_modify__protect_unprotect(self):
"""Test modify un-protecting and protecting an authentication silo."""
- # Create a silo to modify for this test.
name = "modifyProtect"
- self.runcmd("domain", "auth", "silo", "create", "--name", name)
+
+ # Create a silo to modify for this test.
self.addCleanup(self.delete_authentication_silo,
name=name, force=True)
+ self.runcmd("domain", "auth", "silo", "create", "--name", name)
utils = SDUtils(self.samdb)
result, out, err = self.runcmd("domain", "auth", "silo", "modify",
def test_delete__force_fails(self):
"""Test deleting an authentication silo with --force, but it fails."""
# Create protected authentication silo.
+ self.addCleanup(self.delete_authentication_silo,
+ name="deleteForceFail", force=True)
result, out, err = self.runcmd("domain", "auth", "silo", "create",
"--name=deleteForceFail",
"--user-authentication-policy", "User Policy",
def test_delete__fails(self):
"""Test deleting an authentication silo, but it fails."""
# Create regular authentication silo.
+ self.addCleanup(self.delete_authentication_silo,
+ name="regularSilo", force=True)
result, out, err = self.runcmd("domain", "auth", "silo", "create",
"--name=regularSilo",
"--user-authentication-policy", "User Policy")
def test_delete__protected_fails(self):
"""Test deleting an authentication silo, but it fails."""
# Create protected authentication silo.
+ self.addCleanup(self.delete_authentication_silo,
+ name="protectedSilo", force=True)
result, out, err = self.runcmd("domain", "auth", "silo", "create",
"--name=protectedSilo",
"--user-authentication-policy", "User Policy",