]> granicus.if.org Git - ejabberd/commitdiff
Add test to demonstrate issue to retrieve roster with mod_shared_roster_ldap
authorMickael Remond <mremond@process-one.net>
Fri, 25 Mar 2016 16:30:12 +0000 (17:30 +0100)
committerMickael Remond <mremond@process-one.net>
Fri, 25 Mar 2016 16:30:12 +0000 (17:30 +0100)
test/ejabberd_SUITE.erl
test/ejabberd_SUITE_data/ejabberd.ldif
test/ejabberd_SUITE_data/ejabberd.yml

index b9ba9956a5b5ab5f3a461c03145e57bb9ab7c260..ca182d0d5f2b2bb4829b0d8742c66104efd5618d 100644 (file)
@@ -354,7 +354,8 @@ db_tests(_) ->
 ldap_tests() ->
     [{ldap_tests, [sequence],
       [test_auth,
-       vcard_get]}].
+       vcard_get,
+       ldap_shared_roster_vcard_get]}].
 
 extauth_tests() ->
     [{extauth_tests, [sequence],
@@ -800,6 +801,13 @@ vcard_get(Config) ->
         send_recv(Config, #iq{type = get, sub_els = [#vcard{}]}),
     disconnect(Config).
 
+ldap_shared_roster_vcard_get(Config) ->
+    Item = #roster_item{jid = jid:from_string(<<"user2@ldap.localhost">>), name = <<"Test User 2">>,
+                        groups = [<<"group1">>], subscription = both},
+    #iq{type = result, sub_els = [#roster{items = [Item]}]} =
+        send_recv(Config, #iq{type = get, sub_els = [#roster{}]}),
+    disconnect(Config).
+
 vcard_xupdate_master(Config) ->
     Img = <<137, "PNG\r\n", 26, $\n>>,
     ImgHash = p1_sha:sha(Img),
index 0d2d60638e7fdbe0c8583ede20a54c17101a6ecd..863a07e4f5cceb58034a3182e0ac12257d13a03e 100644 (file)
@@ -10,6 +10,10 @@ dn: ou=users,dc=localhost
 ou: users
 objectClass: organizationalUnit
 
+dn: ou=groups,dc=localhost
+ou: groups
+objectClass: organizationalUnit
+
 dn: uid=test_single,ou=users,dc=localhost
 uid: test_single
 mail: test_single@localhost
@@ -33,3 +37,16 @@ objectClass: person
 jpegPhoto:: /9g=
 cn: Test Slave
 password: password
+
+dn: uid=user2,ou=users,dc=localhost
+uid: user2
+mail: user2@localhost
+objectClass: person
+cn: Test User 2
+password: password
+
+dn: cn=group1,ou=groups,dc=localhost
+objectClass: posixGroup
+memberUid: test_single
+memberUid: user2
+cn: group1
index 923d690248b28eb86062f62517c44f192c5af527..e920d4637b47e4b9add37b820d729e1e98078416 100644 (file)
@@ -336,6 +336,15 @@ Welcome to this XMPP server."
     auth_method: ldap
     modules: 
       mod_vcard_ldap: []
+      mod_roster: [] # mod_roster is required by mod_shared_roster
+      mod_shared_roster_ldap:
+        ldap_auth_check: off
+        ldap_base: "dc=localhost"
+        ldap_rfilter: "(objectClass=posixGroup)"
+        ldap_gfilter: "(&(objectClass=posixGroup)(cn=%g))"
+        ldap_memberattr: "memberUid"
+        ldap_ufilter: "(uid=%u)"
+        ldap_userdesc: "cn"
       mod_adhoc: []
       mod_configure: []
       mod_disco: []
@@ -415,7 +424,7 @@ listen:
     port: @@web_port@@
     module: ejabberd_http
     captcha: true
-loglevel: 4
+loglevel: 5
 max_fsm_queue: 1000
 modules: 
   mod_adhoc: []