python:tests: Make sure we do not run into issues with already existing users
authorAndreas Schneider <asn@samba.org>
Wed, 8 Feb 2023 09:17:05 +0000 (10:17 +0100)
committerJule Anger <janger@samba.org>
Fri, 24 Feb 2023 08:56:14 +0000 (08:56 +0000)
commit9e8cc236bd3111b81289fe35187e6d8e5d843ea8
tree7c18659f0eebc8030acb6740252a924e5b71298d
parentbebf313dcb05af6ba7dbc75ea64ad8270562ba1b
python:tests: Make sure we do not run into issues with already existing users

UNEXPECTED(failure): samba.tests.samba_tool.user.samba.tests.samba_tool.user.UserCmdTestCase.test_getpwent(ad_dc_ntvfs:local)
REASON: Exception: Exception: Traceback (most recent call last):
  File "/builddir/build/BUILD/samba-4.18.0rc2/bin/python/samba/tests/samba_tool/user.py", line 1044, in test_getpwent
    self.assertCmdSuccess(result, out, err)
  File "/builddir/build/BUILD/samba-4.18.0rc2/bin/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 user 'mockbuild':  - LDAP error 68 LDAP_ENTRY_ALREADY_EXISTS -  <00002071:
samldb: samAccountName 'mockbuild' already in use!> <>
]:
UNEXPECTED(failure): samba.tests.samba_tool.user.samba.tests.samba_tool.user.UserCmdTestCase.test_list(ad_dc_ntvfs:local)
REASON: Exception: Exception: Traceback (most recent call last):
  File "/builddir/build/BUILD/samba-4.18.0rc2/bin/python/samba/tests/samba_tool/user.py", line 69, in setUp
    self.assertCmdSuccess(result, out, err)
  File "/builddir/build/BUILD/samba-4.18.0rc2/bin/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 user 'sambatool1':  - LDAP error 68 LDAP_ENTRY_ALREADY_EXISTS -  <00002071:
samldb: samAccountNa me 'sambatool1' already in use!> <>

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 af27b1d37573d165983933d3789a18b12fad0272)
python/samba/tests/samba_tool/user.py