summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2017-02-22 17:43:21 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-02-23 23:58:21 +0100
commit6f2deb01fa1c6e81f101df49990dadcbc9c31226 (patch)
treeee7b44a6a8f59f28bfd5e624170f47cc332e5fb2 /testprogs
parent86f10eaecd4ed9fd9db83d711cbf1f823528d6e5 (diff)
downloadsamba-6f2deb01fa1c6e81f101df49990dadcbc9c31226.tar.gz
tests/dbcheck: Add a test for two live objects, with a dangling forward link
Handling backlinks appears to be rather non-deterministic, so the forward link hangs off of the RODC replication group (which has no other valid forward links). In other situations, it either won't delete the memberOf, or the expected output order will vary. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12600
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/blackbox/dbcheck-links.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/testprogs/blackbox/dbcheck-links.sh b/testprogs/blackbox/dbcheck-links.sh
index f6c6a76d8f4..2a1bfbace02 100755
--- a/testprogs/blackbox/dbcheck-links.sh
+++ b/testprogs/blackbox/dbcheck-links.sh
@@ -91,6 +91,27 @@ dbcheck_clean() {
fi
}
+add_dangling_link() {
+ ldif=$release_dir/add-dangling-forwardlink-user.ldif
+ TZ=UTC $ldbadd -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $ldif
+ if [ "$?" != "0" ]; then
+ return 1
+ fi
+
+ ldif=$release_dir/add-initially-normal-link.ldif
+ TZ=UTC $ldbmodify -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $ldif
+ if [ "$?" != "0" ]; then
+ return 1
+ fi
+ sleep 6
+
+ ldif=$release_dir/delete-only-backlink.ldif
+ TZ=UTC $ldbmodify -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb.d/DC%3DRELEASE-4-5-0-PRE1,DC%3DSAMBA,DC%3DCORP.ldb $ldif
+ if [ "$?" != "0" ]; then
+ return 1
+ fi
+}
+
add_dangling_backlink() {
ldif=$release_dir/add-dangling-backlink-user.ldif
TZ=UTC $ldbadd -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $ldif
@@ -186,6 +207,7 @@ if [ -d $release_dir ]; then
testit "remove_one_link" remove_one_link
testit "remove_one_user" remove_one_user
testit "move_one_user" move_one_user
+ testit "add_dangling_link" add_dangling_link
testit "add_dangling_backlink" add_dangling_backlink
testit "dbcheck" dbcheck
testit "dbcheck_clean" dbcheck_clean