summaryrefslogtreecommitdiff
path: root/testprogs/ejs/samba3sam
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-08-14 23:41:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:15:36 -0500
commit1ace9b6ec0949aea9ca5897724b1acca8eee57d9 (patch)
tree03faa96563d37f85335d256019ccaa6dc37a1bc9 /testprogs/ejs/samba3sam
parentc846d461fa1edb97219be87c4ba37e97e85dd488 (diff)
downloadsamba-1ace9b6ec0949aea9ca5897724b1acca8eee57d9.tar.gz
samba-1ace9b6ec0949aea9ca5897724b1acca8eee57d9.tar.bz2
samba-1ace9b6ec0949aea9ca5897724b1acca8eee57d9.zip
r17543: Patch from Martin Kühl <martin.kuehl@gmail.com> to extend the
samba3sam test cases for ldb_map, and to include this into our default 'make test'. (This used to be commit f69a842314b3d5c57c3fa1f5b1bae3ee6d42da2b)
Diffstat (limited to 'testprogs/ejs/samba3sam')
-rwxr-xr-xtestprogs/ejs/samba3sam27
1 files changed, 19 insertions, 8 deletions
diff --git a/testprogs/ejs/samba3sam b/testprogs/ejs/samba3sam
index 0f6d1a82ab..5d9fd6f514 100755
--- a/testprogs/ejs/samba3sam
+++ b/testprogs/ejs/samba3sam
@@ -48,14 +48,7 @@ ok = s4.connect("tdb://samba4.ldb");
assert(ok);
println("Initial samba4 LDIF...");
-var path = "../../source/setup/provision_init.ldif";
-var ldif = sys.file_load(mypath + path);
-ldif = substitute_var(ldif, local);
-assert(ldif != undefined);
-ok = s4.add(ldif);
-assert(ok);
-
-var path = "../../source/setup/provision_templates.ldif";
+var path = "../../testdata/samba3/provision_samba3sam.ldif"
var ldif = sys.file_load(mypath + path);
ldif = substitute_var(ldif, local);
assert(ldif != undefined);
@@ -112,6 +105,24 @@ for (var i in oc) {
assert(oc[i] == "posixGroup" || oc[i] == "group");
}
+println("Looking up by objectClass");
+msg = s4.search("(|(objectClass=user)(cn=Administrator))");
+assert(msg != undefined);
+assert(msg.length == 2);
+for (var i = 0; i < msg.length; i++) {
+ assert((msg[i].dn == "unixName=Administrator,ou=Users,sambaDomainName=TESTS,dc=vernstok,dc=nl") ||
+ (msg[i].dn == "unixName=nobody,ou=Users,sambaDomainName=TESTS,dc=vernstok,dc=nl"));
+}
+
+println("Looking up by objectClass");
+msg = s4.search("(|(objectClass=user)(cn=Administrator))");
+assert(msg != undefined);
+assert(msg.length == 2);
+for (var i = 0; i < msg.length; i++) {
+ assert((msg[i].dn == "unixName=Administrator,ou=Users,sambaDomainName=TESTS,dc=vernstok,dc=nl") ||
+ (msg[i].dn == "unixName=nobody,ou=Users,sambaDomainName=TESTS,dc=vernstok,dc=nl"));
+}
+
println("Adding a record that will be fallbacked");
ok = s4.add("
dn: cn=Foo,dc=idealx,dc=org