getncchanges.py: Add GET_ANC replication test case
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 6 Jun 2017 06:21:40 +0000 (18:21 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 18 Aug 2017 04:07:12 +0000 (06:07 +0200)
commit9f0ae6e44d0f6def6be7c44067c7fcfdf0d42db2
treef2dd3b6c1d7c4fe7e92c0fe5d3af25cdd9e7c98c
parent4cfc29688584ca69c43abb770d1e721d1eab1480
getncchanges.py: Add GET_ANC replication test case

This test:
- creates blocks of parent/child objects
- modifies the parents, so the child gets received first in the
  replication (which means the client has to use GET_ANC)
- checks that we always receive the parent before the child (if not, it
  either retries with GET_ANC, or asserts if GET_ANC is already set)
- modifies the parent objects to change their USN while the
  replication is in progress
- checks that all expected objects are received by the end of the
  test

I've added a repl_get_next() function to help simulate a client's
behaviour - if it encounters an object it doesn't know the parent of,
then it retries with GET_ANC.

Also added some debug to drs_base.py that developers can turn on to make
it easier to see what objects we're actually receiving in the
responses.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12972
source4/torture/drs/python/drs_base.py
source4/torture/drs/python/getncchanges.py