summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-27 19:46:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:41 -0500
commite1269bafe8449f2417d7c666bf0f95af5d7a005f (patch)
treee997c5db18e465bd64e10a17a6633dfe260e0544 /source4/lib/ldb/tests
parentafb62ee775c3e5b56d786f8246df4a56002b133f (diff)
downloadsamba-e1269bafe8449f2417d7c666bf0f95af5d7a005f.tar.gz
samba-e1269bafe8449f2417d7c666bf0f95af5d7a005f.tar.bz2
samba-e1269bafe8449f2417d7c666bf0f95af5d7a005f.zip
r9690: Extend test + fix several bugs
(This used to be commit 0cff0e03fca0ddccaff3b463aadba63d29e061a9)
Diffstat (limited to 'source4/lib/ldb/tests')
-rwxr-xr-xsource4/lib/ldb/tests/test-samba3sam.sh32
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)"