summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2023-02-08 15:44:43 +0100
committerJule Anger <janger@samba.org>2023-02-24 08:56:14 +0000
commit6191dbda1932d8eab59a593ce5ef979143ce3a46 (patch)
tree32091cab0b7d067af1b69bca55d515779032e2f1
parentb925ac8094fb62a6247d066bc17b374d24abcd5b (diff)
downloadsamba-6191dbda1932d8eab59a593ce5ef979143ce3a46.tar.gz
python:tests: Make sure we delete the OU for movetest
UNEXPECTED(failure): samba.tests.samba_tool.group.samba.tests.samba_tool.group.GroupCmdTestCase.test_move(ad_dc_default:local) REASON: Exception: Exception: Traceback (most recent call last): File "python/samba/tests/samba_tool/group.py", line 341, in test_move self.assertCmdSuccess(result, out, err) File "python/samba/tests/samba_tool/base.py", line 97, in assertCmdSuccess self.assertIsNone(exit, msg=msg.replace("\n]\n", "\n] \n")) AssertionError: -1 is not None : exit[-1] stdout[] stderr[ERROR(ldb): Failed to add ou "OU=movetest,DC=addom,DC=samba,DC=example,DC=com" - Entry OU=movetest,DC=addom,DC=samba,DC=example,DC=com already exists BUG: https://bugzilla.samba.org/show_bug.cgi?id=15308 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit a4307072d6ea5ddef5b37aa361e9e9f16f7254e7)
-rw-r--r--python/samba/tests/samba_tool/group.py8
-rw-r--r--python/samba/tests/samba_tool/user.py8
2 files changed, 6 insertions, 10 deletions
diff --git a/python/samba/tests/samba_tool/group.py b/python/samba/tests/samba_tool/group.py
index 2542411d74a..3019b7596d2 100644
--- a/python/samba/tests/samba_tool/group.py
+++ b/python/samba/tests/samba_tool/group.py
@@ -336,7 +336,9 @@ class GroupCmdTestCase(SambaToolCmdTest):
def test_move(self):
- full_ou_dn = str(self.samdb.normalize_dn_in_domain("OU=movetest"))
+ full_ou_dn = str(self.samdb.normalize_dn_in_domain("OU=movetest_grp"))
+ self.addCleanup(self.samdb.delete, full_ou_dn, ["tree_delete:1"])
+
(result, out, err) = self.runsubcmd("ou", "add", full_ou_dn)
self.assertCmdSuccess(result, out, err)
self.assertEqual(err, "", "There shouldn't be any error message")
@@ -363,10 +365,6 @@ class GroupCmdTestCase(SambaToolCmdTest):
self.assertIn('Moved group "%s" into "%s"' %
(group["name"], new_dn), out)
- (result, out, err) = self.runsubcmd("ou", "delete", full_ou_dn)
- self.assertCmdSuccess(result, out, err,
- "Failed to delete ou '%s'" % full_ou_dn)
-
def test_show(self):
"""Assert that we can show a group correctly."""
(result, out, err) = self.runsubcmd("group", "show", "Domain Users",
diff --git a/python/samba/tests/samba_tool/user.py b/python/samba/tests/samba_tool/user.py
index ffae45dd529..9b6d19b11cb 100644
--- a/python/samba/tests/samba_tool/user.py
+++ b/python/samba/tests/samba_tool/user.py
@@ -708,7 +708,9 @@ sAMAccountName: %s
self.assertGreater(pwd_expires_time, pwd_last_set_time)
def test_move(self):
- full_ou_dn = str(self.samdb.normalize_dn_in_domain("OU=movetest"))
+ full_ou_dn = str(self.samdb.normalize_dn_in_domain("OU=movetest_usr"))
+ self.addCleanup(self.samdb.delete, full_ou_dn, ["tree_delete:1"])
+
(result, out, err) = self.runsubcmd("ou", "add", full_ou_dn)
self.assertCmdSuccess(result, out, err)
self.assertEqual(err, "", "There shouldn't be any error message")
@@ -735,10 +737,6 @@ sAMAccountName: %s
self.assertIn('Moved user "%s" into "%s"' %
(user["name"], new_dn), out)
- (result, out, err) = self.runsubcmd("ou", "delete", full_ou_dn)
- self.assertCmdSuccess(result, out, err,
- "Failed to delete ou '%s'" % full_ou_dn)
-
def test_rename_surname_initials_givenname(self):
"""rename the existing surname and given name and add missing
initials, then remove them, for all users"""