ldb: Fix a wrong changetype in unit test
[Samba.git] / source4 / lib / ldb / tests / test-controls.sh
blob868e8c2377c908244bb765a669019401966cfec8
1 #!/bin/sh
3 if [ -n "$TEST_DATA_PREFIX" ]; then
4 LDB_URL="$TEST_DATA_PREFIX/tdbtest.ldb"
5 else
6 LDB_URL="tdbtest.ldb"
7 fi
8 export LDB_URL
10 PATH=bin:$PATH
11 export PATH
13 rm -f $LDB_URL*
14 LDB_MODULES_PATH=`dirname $0`/../../../bin/modules/testldb
15 echo $LDB_MODULES_PATH
17 echo "LDB_URL: $LDB_URL"
18 cat <<EOF | $VALGRIND ldbadd || exit 1
19 dn: @MODULES
20 @LIST: sample
21 EOF
23 cat <<EOF | $VALGRIND ldbadd || exit 1
24 dn: dc=bar
25 dc: bar
26 someThing: someThingElse
27 EOF
29 $VALGRIND ldbsearch "(touchedBy=sample)" | grep "touchedBy: sample" || exit 1
30 # This action are expected to fails because the sample module return an error when presented the relax control
32 cat <<EOF | $VALGRIND ldbadd --controls "relax:0" && exit 1
33 dn: dc=foobar
34 dc: foobar
35 someThing: someThingElse
36 EOF
38 cat <<EOF | $VALGRIND ldbmodify --controls "relax:0" && exit 1
39 dn: dc=bar
40 changetype: modify
41 replace someThing
42 someThing: someThingElseBetter
43 EOF
45 $VALGRIND ldbsearch --controls "bypassoperational:0" >/dev/null 2>&1 || exit 1
47 set