summaryrefslogtreecommitdiff
path: root/testprogs/ejs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-07-29 01:13:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:15:08 -0500
commit77bb75ead0b5b13539ab89531542cc2e9813fda4 (patch)
treeafd8b68e1a99ef0ff04395d02f0b81b069eb539e /testprogs/ejs
parent431720960648841305ca1f2b8ebc2c1344461661 (diff)
downloadsamba-77bb75ead0b5b13539ab89531542cc2e9813fda4.tar.gz
samba-77bb75ead0b5b13539ab89531542cc2e9813fda4.tar.bz2
samba-77bb75ead0b5b13539ab89531542cc2e9813fda4.zip
r17299: Improve the partition module to replicate attribute records into all
partitions. Test that we do that correctly. Andrew Bartlett (This used to be commit 90c07b88010b848423dee9556a24e8d181c365dd)
Diffstat (limited to 'testprogs/ejs')
-rwxr-xr-xtestprogs/ejs/ldb.js65
1 files changed, 65 insertions, 0 deletions
diff --git a/testprogs/ejs/ldb.js b/testprogs/ejs/ldb.js
index 0d2de577d3..fb1a2d4b0d 100755
--- a/testprogs/ejs/ldb.js
+++ b/testprogs/ejs/ldb.js
@@ -101,6 +101,16 @@ partition: cn=Sub,cn=Sub,cn=PartTest:" + prefix + "testsubsub.ldb
function modules_test(ldb)
{
println("Running modules tests");
+
+ ok = ldb.add("
+dn: @ATTRIBUTES
+caseattr: CASE_INSENSITIVE
+");
+ if (!ok) {
+ println("Failed to add: " + ldb.errstring());
+ assert(ok);
+ }
+
ok = ldb.add("
dn: cn=x8,cn=PartTest
objectClass: foo
@@ -207,6 +217,57 @@ x: 11
assert(res8[0].name == "x11");
assert(res8[0].cn == "x11");
+ ok = ldb.add("
+dn: caseattr=XY,cn=PartTest
+objectClass: foo
+x: Y
+");
+ if (!ok) {
+ println("Failed to add: " + ldb.errstring());
+ assert(ok);
+ }
+
+ ok = ldb.add("
+dn: caseattr=XZ,cn=PartTest
+objectClass: foo
+x: Z
+caseattr: XZ
+");
+ if (!ok) {
+ println("Failed to add: " + ldb.errstring());
+ 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);
+ assert(resX[0].createTimestamp != undefined);
+ assert(resX[0].whenCreated != undefined);
+ assert(resX[0].name == "XZ");
+
+ var rescount = ldb.search("(|(caseattr=*)(cn=*))", "cn=parttest", ldb.SCOPE_DEFAULT, attrs);
+ assert(rescount.length == 5);
+
+ /* Check this attribute is *not* case sensitive */
+ var resXcount = ldb.search("caseattr=x*", "cn=parttest", ldb.SCOPE_DEFAULT, attrs);
+ assert(resXcount.length == 2);
+
+ /* Check that this attribute *is* case sensitive */
+ var resXcount2 = ldb.search("caseattr2=xz", "cn=parttest", ldb.SCOPE_DEFAULT, attrs);
+ assert(resXcount2.length == 0);
+
+
/* Now abort the transaction to show that even with
* partitions, it is aborted everywhere */
ok = ldb.transaction_cancel();
@@ -229,6 +290,10 @@ x: 11
var res11 = ldb.search("x=10", "cn=parttest", ldb.SCOPE_DEFAULT, attrs);
assert(res11.length == 0);
+ var attrs = new Array("*");
+ var res12 = ldb.search("caseattr=*", "cn=parttest", ldb.SCOPE_DEFAULT, attrs);
+ assert(res12.length == 0);
+
}
sys = sys_init();