diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-04-04 15:17:32 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-04-10 11:14:43 +0200 |
commit | e17d12c23b2f56d8d29f7ee43148be85d28154c6 (patch) | |
tree | 40f233b97d294c70536f1e597de4b130ecd09807 /lib/ldb/tests/test-generic.sh | |
parent | 501d6d3dd4e3045e069bb2f7a52cf842dd1dfa67 (diff) | |
download | samba-e17d12c23b2f56d8d29f7ee43148be85d28154c6.tar.gz samba-e17d12c23b2f56d8d29f7ee43148be85d28154c6.tar.bz2 samba-e17d12c23b2f56d8d29f7ee43148be85d28154c6.zip |
ldb-tools: Place the whole of an ldif file in a transaction
This ensures that when operating ldbadd and ldbmodify against local
ldb files, either an ldif file succeeds or fails as a whole.
Also tests to verify that this is working correctly, and an ABI bump
due to the extra (private, but exported to ldb* tools) symbol and
behaviour change.
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Apr 10 11:14:43 CEST 2012 on sn-devel-104
Diffstat (limited to 'lib/ldb/tests/test-generic.sh')
-rwxr-xr-x | lib/ldb/tests/test-generic.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/ldb/tests/test-generic.sh b/lib/ldb/tests/test-generic.sh index 9c45ed9614..69f901bd7c 100755 --- a/lib/ldb/tests/test-generic.sh +++ b/lib/ldb/tests/test-generic.sh @@ -16,9 +16,30 @@ $VALGRIND ldbadd $LDBDIR/tests/test.ldif 2> /dev/null && { exit 1 } +echo "Adding LDIF with one already-existing user again - should fail" +$VALGRIND ldbadd $LDBDIR/tests/test-dup.ldif 2> /dev/null && { + echo "Should have failed to add again - gave $?" + exit 1 +} + +echo "Adding again - should succeed (as previous failed)" +$VALGRIND ldbadd $LDBDIR/tests/test-dup-2.ldif || exit 1 + echo "Modifying elements" $VALGRIND ldbmodify $LDBDIR/tests/test-modify.ldif || exit 1 +echo "Modify LDIF with one un-met constraint - should fail" +$VALGRIND ldbadd $LDBDIR/tests/test-modify-unmet.ldif 2> /dev/null && { + echo "Should have failed to modify - gave $?" + exit 1 +} + +echo "Modify LDIF with after failure of un-met constraint - should also fail" +$VALGRIND ldbadd $LDBDIR/tests/test-modify-unmet-2.ldif 2> /dev/null && { + echo "Should have failed to modify - gave $?" + exit 1 +} + echo "Showing modified record" $VALGRIND ldbsearch '(uid=uham)' || exit 1 |