diff options
Diffstat (limited to 'source4/lib/ldb/tests')
-rwxr-xr-x | source4/lib/ldb/tests/test-samba3sam.sh | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/source4/lib/ldb/tests/test-samba3sam.sh b/source4/lib/ldb/tests/test-samba3sam.sh index 60d429e3b1..73610a2be2 100755 --- a/source4/lib/ldb/tests/test-samba3sam.sh +++ b/source4/lib/ldb/tests/test-samba3sam.sh @@ -2,7 +2,33 @@ rm -f samba3.ldb -$VALGRIND ldbadd -H tdb://samba3.ldb < samba3.ldif +echo "Adding samba3 LDIF..." +$VALGRIND ldbadd -H tdb://samba3.ldb < samba3.ldif || exit 1 + +LOC="-H tdb://samba3.ldb" +OPT="-o modules:samba3sam $LOC" + +echo "Looking up by non-mapped attribute" +$VALGRIND ldbsearch $OPT "(cn=Administrator)" || exit 1 + +echo "Looking up by mapped attribute" +$VALGRIND ldbsearch $OPT "(name=Backup Operators)" || exit 1 + +echo "Looking up by old name of renamed attribute" +$VALGRIND ldbsearch $OPT "(displayName=Backup Operators)" || exit 1 + +echo "Adding a record" +$VALGRIND ldbadd $OPT <<EOF +dn: cn=Foo,dc=idealx,dc=org +unixName: root +lastLogon: 20000 +cn: Foo + +EOF + +echo "Checking for existance of record (mapped)" +$VALGRIND ldbsearch $OPT "(cn=Foo)" unixName lastLogon cn || exit 1 + +echo "Checking for existance of record (non-mapped)" +$VALGRIND ldbsearch $LOC "(cn=Foo)" uid sambaLogonTime cn || exit 1 -OPT="-o modules:samba3sam -H tdb://samba3.ldb " -$VALGRIND ldbsearch $OPT "(cn=Administrator)" |