diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:20:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:20:00 +0000 |
commit | 8daa83a594a2e98f39d764422bfbdbc62c9efd44 (patch) | |
tree | 4099e8021376c7d8c05bdf8503093d80e9c7bad0 /lib/ldb/tests/test-controls.sh | |
parent | Initial commit. (diff) | |
download | samba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.tar.xz samba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.zip |
Adding upstream version 2:4.20.0+dfsg.upstream/2%4.20.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | lib/ldb/tests/test-controls.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/ldb/tests/test-controls.sh b/lib/ldb/tests/test-controls.sh new file mode 100755 index 0000000..328ed29 --- /dev/null +++ b/lib/ldb/tests/test-controls.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +if [ -n "$TEST_DATA_PREFIX" ]; then + LDB_URL="$TEST_DATA_PREFIX/tdbtest.ldb" +else + LDB_URL="tdbtest.ldb" +fi +export LDB_URL + +PATH=bin:$PATH +export PATH + +rm -f $LDB_URL* + +echo "LDB_URL: $LDB_URL" +cat <<EOF | $VALGRIND ldbadd || exit 1 +dn: @MODULES +@LIST: sample +EOF + +cat <<EOF | $VALGRIND ldbadd || exit 1 +dn: dc=bar +dc: bar +someThing: someThingElse +EOF + +$VALGRIND ldbsearch "(touchedBy=sample)" | grep "touchedBy: sample" || exit 1 +# This action are expected to fails because the sample module return an error when presented the relax control + +cat <<EOF | $VALGRIND ldbadd --controls "relax:0" >/dev/null 2>&1 && exit 1 +dn: dc=foobar +dc: foobar +someThing: someThingElse +EOF + +cat <<EOF | $VALGRIND ldbmodify --controls "relax:0" >/dev/null 2>&1 && exit 1 +dn: dc=bar +changetype: modify +replace someThing +someThing: someThingElseBetter +EOF + +$VALGRIND ldbsearch --controls "bypassoperational:0" >/dev/null 2>&1 || exit 1 |