From: Rob van der Linde Date: Thu, 19 Oct 2023 01:26:46 +0000 (+1300) Subject: netcmd: tests: stop checking for ERROR prefix from CommandError X-Git-Tag: talloc-2.4.2~1128 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6943a58bff37c815aa993f74fbbbe2587a21202b;p=thirdparty%2Fsamba.git netcmd: tests: stop checking for ERROR prefix from CommandError Signed-off-by: Rob van der Linde Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/samba_tool/domain_auth_policy.py b/python/samba/tests/samba_tool/domain_auth_policy.py index 12d17519f2f..0cf5d15ca8b 100644 --- a/python/samba/tests/samba_tool/domain_auth_policy.py +++ b/python/samba/tests/samba_tool/domain_auth_policy.py @@ -312,7 +312,7 @@ class AuthPolicyCmdTestCase(BaseAuthCmdTest): result, out, err = self.runcmd("domain", "auth", "policy", "create", "--name", "createFails") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) def test_authentication_policy_modify_description(self): """Test modifying an authentication policy description.""" @@ -480,8 +480,7 @@ class AuthPolicyCmdTestCase(BaseAuthCmdTest): "--name", "doesNotExist", "--description", "NewDescription") self.assertEqual(result, -1) - self.assertIn("ERROR: Authentication policy doesNotExist not found.", - err) + self.assertIn("Authentication policy doesNotExist not found.", err) def test_authentication_policy_modify_audit_enforce(self): """Test modify authentication policy using --audit and --enforce.""" @@ -564,7 +563,7 @@ class AuthPolicyCmdTestCase(BaseAuthCmdTest): "--name", "Single Policy", "--description", "New description") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) def test_authentication_policy_delete(self): """Test deleting an authentication policy that is not protected.""" @@ -643,7 +642,7 @@ class AuthPolicyCmdTestCase(BaseAuthCmdTest): "--name", "deleteForceFail", "--force") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) def test_authentication_policy_delete_fails(self): """Test deleting an authentication policy, but it fails.""" @@ -660,7 +659,7 @@ class AuthPolicyCmdTestCase(BaseAuthCmdTest): result, out, err = self.runcmd("domain", "auth", "policy", "delete", "--name", "regularPolicy") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) # When not using --force we get a hint. self.assertIn("Try --force", err) @@ -682,7 +681,7 @@ class AuthPolicyCmdTestCase(BaseAuthCmdTest): "--name", "protectedPolicy", "--force") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) # When using --force we don't get the hint. self.assertNotIn("Try --force", err) diff --git a/python/samba/tests/samba_tool/domain_auth_silo.py b/python/samba/tests/samba_tool/domain_auth_silo.py index 04e7578cfc8..668f8bf9c1d 100644 --- a/python/samba/tests/samba_tool/domain_auth_silo.py +++ b/python/samba/tests/samba_tool/domain_auth_silo.py @@ -81,7 +81,7 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest): result, out, err = self.runcmd("domain", "auth", "silo", "view", "--name", "doesNotExist") self.assertEqual(result, -1) - self.assertIn("ERROR: Authentication silo doesNotExist not found.", err) + self.assertIn("Authentication silo doesNotExist not found.", err) def test_authentication_silo_view_name_required(self): """Test view authentication silo without --name argument.""" @@ -227,7 +227,7 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest): "--name", "createFails", "--policy", "Single Policy") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) def test_authentication_silo_modify_description(self): """Test modify authentication silo changing the description field.""" @@ -323,7 +323,7 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest): "--name", "doesNotExist", "--description=NewDescription") self.assertEqual(result, -1) - self.assertIn("ERROR: Authentication silo doesNotExist not found.", err) + self.assertIn("Authentication silo doesNotExist not found.", err) def test_authentication_silo_modify_name_missing(self): """Test modify authentication silo without --name argument.""" @@ -340,7 +340,7 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest): "--name", "developers", "--description", "Devs") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) def test_authentication_silo_delete(self): """Test deleting an authentication silo that is not protected.""" @@ -422,7 +422,7 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest): "--name", "deleteForceFail", "--force") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) def test_authentication_silo_delete_fails(self): """Test deleting an authentication silo, but it fails.""" @@ -440,7 +440,7 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest): result, out, err = self.runcmd("domain", "auth", "silo", "delete", "--name", "regularSilo") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) # When not using --force we get a hint. self.assertIn("Try --force", err) @@ -463,7 +463,7 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest): "--name", "protectedSilo", "--force") self.assertEqual(result, -1) - self.assertIn("ERROR: Custom error message", err) + self.assertIn("Custom error message", err) # When using --force we don't get the hint. self.assertNotIn("Try --force", err) diff --git a/python/samba/tests/samba_tool/domain_claim.py b/python/samba/tests/samba_tool/domain_claim.py index 6be3e29a1a0..c93d5e8d20e 100644 --- a/python/samba/tests/samba_tool/domain_claim.py +++ b/python/samba/tests/samba_tool/domain_claim.py @@ -180,14 +180,14 @@ class ClaimCmdTestCase(SambaToolCmdTest): """Test view claim type without --name is handled.""" result, out, err = self.runcmd("domain", "claim", "claim-type", "view") self.assertEqual(result, -1) - self.assertIn("ERROR: Argument --name is required.", err) + self.assertIn("Argument --name is required.", err) def test_claim_type_view_notfound(self): """Test viewing claim type that doesn't exist is handled.""" result, out, err = self.runcmd("domain", "claim", "claim-type", "view", "--name", "doesNotExist") self.assertEqual(result, -1) - self.assertIn("ERROR: Claim type doesNotExist not found.", err) + self.assertIn("Claim type doesNotExist not found.", err) def test_claim_type_create(self): """Test creating several known attributes as claim types. @@ -350,7 +350,7 @@ class ClaimCmdTestCase(SambaToolCmdTest): "create", "--attribute=wWWHomePage", "--name=homepage") self.assertEqual(result, -1) - self.assertIn("ERROR: Argument --class is required.", err) + self.assertIn("Argument --class is required.", err) def test_claim_type_delete(self): """Test deleting a claim type that is not protected.""" @@ -405,7 +405,7 @@ class ClaimCmdTestCase(SambaToolCmdTest): result, out, err = self.runcmd("domain", "claim", "claim-type", "delete", "--name", "doesNotExist") self.assertEqual(result, -1) - self.assertIn("ERROR: Claim type doesNotExist not found.", err) + self.assertIn("Claim type doesNotExist not found.", err) def test_claim_type_modify_description(self): """Test modifying a claim type description.""" @@ -435,7 +435,7 @@ class ClaimCmdTestCase(SambaToolCmdTest): "modify", "--name", "seeAlso", "--class=") self.assertEqual(result, -1) - self.assertIn("ERROR: Class name is required.", err) + self.assertIn("Class name is required.", err) # Try changing it to just --class=computer first. result, out, err = self.runcmd("domain", "claim", "claim-type", @@ -546,7 +546,7 @@ class ClaimCmdTestCase(SambaToolCmdTest): "modify", "--name", "doesNotExist", "--description=NewDescription") self.assertEqual(result, -1) - self.assertIn("ERROR: Claim type doesNotExist not found.", err) + self.assertIn("Claim type doesNotExist not found.", err) def test_value_type_list(self): """Test listing claim value types in list format.""" @@ -589,11 +589,11 @@ class ClaimCmdTestCase(SambaToolCmdTest): """Test viewing a claim value type with missing --name is handled.""" result, out, err = self.runcmd("domain", "claim", "value-type", "view") self.assertEqual(result, -1) - self.assertIn("ERROR: Argument --name is required.", err) + self.assertIn("Argument --name is required.", err) def test_value_type_view_notfound(self): """Test viewing a claim value type that doesn't exist is handled.""" result, out, err = self.runcmd("domain", "claim", "value-type", "view", "--name", "doesNotExist") self.assertEqual(result, -1) - self.assertIn("ERROR: Value type doesNotExist not found.", err) + self.assertIn("Value type doesNotExist not found.", err)