summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests/test-schema.sh
blob: 08595a0a9c50eb614c7d5bbcb66c62c6d3f0e1b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

export LDB_URL="tdb://schema.ldb"

rm -f schema.ldb

echo "LDB_URL: $LDB_URL"

echo "Adding schema"
$VALGRIND bin/ldbadd tests/schema-tests/schema.ldif || exit 1

echo "Adding few test elements (no failure expected here)"
$VALGRIND bin/ldbadd tests/schema-tests/schema-add-test.ldif || exit 1

echo "Modifying elements (2 failures expected here)"

$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-1.ldif || exit 1
$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-2.ldif || exit 1
$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-3.ldif || exit 1
$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-4.ldif
if [ "$?" == "0" ]; then
	echo "test failed!"
	exit 1
fi
$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-5.ldif
if [ "$?" == "0" ]; then
	echo "test failed!"
	exit 1
fi

echo "Showing modified record"
$VALGRIND bin/ldbsearch '(cn=Test)'  || exit 1