summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-07-29 01:52:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:15:08 -0500
commitcfa762ff8781531cf7dffc0f81377b90be6f439a (patch)
tree00b1bc9ba5e1346fd09f2768c90e15c339ac4275 /testprogs
parent09b861f45ba2354edee85ccc966e3b3ee62e02e0 (diff)
downloadsamba-cfa762ff8781531cf7dffc0f81377b90be6f439a.tar.gz
samba-cfa762ff8781531cf7dffc0f81377b90be6f439a.tar.bz2
samba-cfa762ff8781531cf7dffc0f81377b90be6f439a.zip
r17302: Testing!
This confirms that records are replicated into the correct databases, and that the case insensitive flags really work. Andrew Bartlett (This used to be commit ad463c1a5243019548bdbeea3070ec2e6cbcfcdf)
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/ejs/ldb.js57
1 files changed, 55 insertions, 2 deletions
diff --git a/testprogs/ejs/ldb.js b/testprogs/ejs/ldb.js
index fb1a2d4b0d..6851ee0b30 100755
--- a/testprogs/ejs/ldb.js
+++ b/testprogs/ejs/ldb.js
@@ -92,18 +92,22 @@ partition: cn=SideTest:" + prefix + "testside.ldb
partition: cn=Sub,cn=PartTest:" + prefix + "testsub.ldb
partition: cn=PartTest:" + prefix + "testpartition.ldb
partition: cn=Sub,cn=Sub,cn=PartTest:" + prefix + "testsubsub.ldb
+replicateEntries: @SUBCLASSES
+replicateEntries: @ATTRIBUTES
+replicateEntries: @INDEXLIST
");
}
/* Test the basic operation of the timestamps,objectguid and name_rdn
modules */
-function modules_test(ldb)
+function modules_test(ldb, parttestldb)
{
println("Running modules tests");
ok = ldb.add("
dn: @ATTRIBUTES
+cn: CASE_INSENSITIVE
caseattr: CASE_INSENSITIVE
");
if (!ok) {
@@ -111,6 +115,10 @@ caseattr: CASE_INSENSITIVE
assert(ok);
}
+ /* Confirm that the attributes were replicated */
+ var res_attrs = parttestldb.search("cn=*", "@ATTRIBUTES", parttestldb.SCOPE_BASE);
+ assert(res_attrs[0].cn == "CASE_INSENSITIVE");
+
ok = ldb.add("
dn: cn=x8,cn=PartTest
objectClass: foo
@@ -132,6 +140,17 @@ cn: X9
assert(ok);
}
+ ok = ldb.add("
+dn: cn=X9,cn=PartTest
+objectClass: foo
+x: 9
+cn: X9
+");
+ if (ok) {
+ println("Should have failed to add cn=X9,cn=PartTest");
+ assert(!ok);
+ }
+
var res = ldb.search("x=8", "cn=PartTest", ldb.SCOPE_DEFAULT);
assert(res[0].objectGUID != undefined);
assert(res[0].createTimestamp == undefined);
@@ -139,6 +158,14 @@ cn: X9
assert(res[0].name == "x8");
assert(res[0].cn == "x8");
+ /* Confirm that this ended up in the correct LDB */
+ var res_otherldb = parttestldb.search("x=8", "cn=PartTest", parttestldb.SCOPE_DEFAULT);
+ assert(res_otherldb[0].objectGUID != undefined);
+ assert(res_otherldb[0].createTimestamp == undefined);
+ assert(res_otherldb[0].whenCreated != undefined);
+ assert(res_otherldb[0].name == "x8");
+ assert(res_otherldb[0].cn == "x8");
+
var attrs = new Array("*", "createTimestamp");
var res2 = ldb.search("x=9", "cn=PartTest", ldb.SCOPE_DEFAULT, attrs);
assert(res2[0].objectGUID != undefined);
@@ -239,6 +266,17 @@ caseattr: XZ
}
ok = ldb.add("
+dn: caseattr=xz,cn=PartTest
+objectClass: foo
+x: Z
+caseattr: xz
+");
+ if (ok) {
+ println("Should have failed to add caseattr=xz,cn=PartTest");
+ assert(!ok);
+ }
+
+ ok = ldb.add("
dn: caseattr2=XZ,cn=PartTest
objectClass: foo
x: Z
@@ -249,6 +287,17 @@ caseattr2: XZ
assert(ok);
}
+ ok = ldb.add("
+dn: caseattr2=Xz,cn=PartTest
+objectClass: foo
+x: Z
+caseattr2: Xz
+");
+ if (!ok) {
+ println("Failed to add: " + ldb.errstring());
+ assert(ok);
+ }
+
var resX = ldb.search("caseattr=xz", "cn=parttest", ldb.SCOPE_DEFAULT, attrs);
assert(resX.length == 1);
assert(resX[0].objectGUID != undefined);
@@ -315,7 +364,11 @@ ldb = ldb_init();
var ok = ldb.connect("tdb://" + prefix + dbfile);
assert(ok);
-modules_test(ldb);
+parttestldb = ldb_init();
+var ok = parttestldb.connect("tdb://" + prefix + "testpartition.ldb");
+assert(ok);
+
+modules_test(ldb, parttestldb);
sys.unlink(prefix + dbfile);
sys.unlink(prefix + "testpartition.ldb");