selftest: replica_sync did not fully cleanup if test failed
authorTim Beale <timbeale@catalyst.net.nz>
Mon, 18 Sep 2017 00:39:21 +0000 (12:39 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Sep 2017 03:33:17 +0000 (05:33 +0200)
commit1b395f488a94f2e2811622b61a8c750374d640ed
tree985eeb41faeff896e3e1863cf0c13cde0d6bc2f2
parent3982b774f4f41661e890dc2ef2d9403db33c7195
selftest: replica_sync did not fully cleanup if test failed

Normally the replica_sync tests do the cleanup at the end of the test
case, rather than in the tearDown(). However, if the tests don't run to
completion (because they fail), then the objects may not get cleaned up
properly, which causes the tests to fail on the 2nd test-env.

The problem is the object deletion only occurs on DC2 and it relies on
replication to propagate the deletion to DC1. Presumably this
propagation could be missed because the tests are repeatedly turning off
inbound replication on both DCs.

This patch changes the tearDown() so it tries to delete the objects off
both DCs, which appears to fix the problem.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/torture/drs/python/replica_sync.py