diff options
Diffstat (limited to 'testprogs/ejs/samba3sam')
-rwxr-xr-x | testprogs/ejs/samba3sam | 27 |
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 |