1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-29 16:23:52 +03:00
Files
samba-mirror/source/lib/ldb/tests/test-extended.sh
Andrew Tridgell f648fdf187 r7709: - convert ldb to use popt, so that it can interact with the samba
cmdline credentials code (which will be done soon)

- added a ldb_init() call, and changed ldb_connect() to take a ldb
  context. This allows for much better error handling in
  ldb_connect(), and also made the popt conversion easier

- fixed up all the existing backends with the new syntax

- improved error handling in *_connect()

- fixed a crash bug in the new case_fold_required() code

- ensured that ltdb_rename() and all ltdb_search() paths get the read lock

- added a ldb_oom() macro to make it easier to report out of memory
  situations in ldb code
2007-10-10 13:18:24 -05:00

71 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
echo "Running extended search tests"
rm -f $LDB_URL
cat <<EOF | bin/ldbadd || exit 1
dn: testrec1
i1: 1
i2: 0
i3: 1234
i4: 0x7003004
dn: testrec2
i1: 0x800000
dn: testrec3
i1: 0x101010101
i1: 7
dn: auser1
groupType: 2147483648
samAccountType: 805306368
dn: auser2
groupType: 2147483648
samAccountType: 805306369
dn: auser3
groupType: 2147483649
samAccountType: 805306370
dn: auser4
groupType: 2147483649
samAccountType: 805306369
EOF
checkcount() {
count=$1
expression="$2"
n=`bin/ldbsearch "$expression" | grep ^dn | wc -l`
if [ $n != $count ]; then
echo "Got $n but expected $count for $expression"
bin/ldbsearch "$expression"
exit 1
fi
echo "OK: $count $expression"
}
checkcount 1 '(i3=1234)'
checkcount 0 '(i3=12345)'
checkcount 2 '(i1:1.2.840.113556.1.4.803:=1)'
checkcount 1 '(i1:1.2.840.113556.1.4.803:=3)'
checkcount 1 '(i1:1.2.840.113556.1.4.803:=7)'
checkcount 0 '(i1:1.2.840.113556.1.4.803:=15)'
checkcount 1 '(i1:1.2.840.113556.1.4.803:=0x800000)'
checkcount 1 '(i1:1.2.840.113556.1.4.803:=8388608)'
checkcount 2 '(i1:1.2.840.113556.1.4.804:=1)'
checkcount 2 '(i1:1.2.840.113556.1.4.804:=3)'
checkcount 2 '(i1:1.2.840.113556.1.4.804:=7)'
checkcount 2 '(i1:1.2.840.113556.1.4.804:=15)'
checkcount 1 '(i1:1.2.840.113556.1.4.804:=0x800000)'
checkcount 1 '(i1:1.2.840.113556.1.4.804:=8388608)'
# this is one that w2k gives
checkcount 3 '(|(|(&(!(groupType:1.2.840.113556.1.4.803:=1))(groupType:1.2.840.113556.1.4.803:=2147483648)(groupType:1.2.840.113556.1.4.804:=10))(samAccountType=805306368))(samAccountType=805306369))'
rm -f $LDB_URL