tests: Move repeated code into a helper function
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 14 Mar 2018 23:44:30 +0000 (12:44 +1300)
committerGarming Sam <garming@samba.org>
Fri, 11 May 2018 04:01:23 +0000 (06:01 +0200)
commit597428943b1b77267243dc69ecea6fda8dfc3163
tree0c55ce675bd572554ae252ad5a0934ab9144b1a8
parentb07b4e459e95f2609af651e579d3b0b01b8a4c7e
tests: Move repeated code into a helper function

Several tests hang all the objects they create off a unique OU.
Having a common OU makes cleanup easier, and having a unique OU (i.e.
adding some randomness) helps protect against one-off test failures
(Replication between testenvs is happening in the background.
Occasionally, when a test finishes on one testenv and moves onto the
next testenv, that testenv may have received the replicated test
objects from the first testenv, but has not received their deletion
yet).

Rather than copy-n-pasting this code yet again, split it out into a
helper function.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
python/samba/tests/__init__.py
source4/torture/drs/python/getncchanges.py
source4/torture/drs/python/link_conflicts.py
source4/torture/drs/python/repl_rodc.py