]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netcmd: tests: stop checking for ERROR prefix from CommandError
authorRob van der Linde <rob@catalyst.net.nz>
Thu, 19 Oct 2023 01:26:46 +0000 (14:26 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 24 Oct 2023 23:31:29 +0000 (23:31 +0000)
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/samba_tool/domain_auth_policy.py
python/samba/tests/samba_tool/domain_auth_silo.py
python/samba/tests/samba_tool/domain_claim.py

index 12d17519f2fc4ad42af43a6b5ce28b4aaa210870..0cf5d15ca8b5b49674b4dda40e7cfac754529830 100644 (file)
@@ -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)
index 04e7578cfc810a47a5aaa529fa48b15547b909d0..668f8bf9c1de416da1f3c92bf8fdb3a8d9bda70d 100644 (file)
@@ -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)
index 6be3e29a1a0cf7f85071726d2605415d68fc13ee..c93d5e8d20eed1d07ce9ee98d8048cbe078f84a0 100644 (file)
@@ -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)