25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Add tests for 'vcard' option

This commit is contained in:
Evgeny Khramtsov 2019-08-06 14:03:23 +03:00
parent 934392fd7e
commit 77acbab965
12 changed files with 140 additions and 6 deletions

View File

@ -13,6 +13,7 @@ define_macro:
db_type: internal
mod_muc:
db_type: internal
vcard: VCARD
mod_offline:
db_type: internal
mod_privacy:
@ -26,6 +27,7 @@ define_macro:
plugins:
- "flat"
- "pep"
vcard: VCARD
mod_roster:
versioning: true
store_current_id: true
@ -34,6 +36,7 @@ define_macro:
db_type: internal
mod_vcard:
db_type: internal
vcard: VCARD
mod_vcard_xupdate: []
mod_client_state:
queue_presence: true

View File

@ -21,6 +21,7 @@ define_macro:
mod_muc:
db_type: sql
ram_db_type: sql
vcard: VCARD
mod_offline:
use_cache: true
db_type: sql
@ -36,6 +37,7 @@ define_macro:
plugins:
- "flat"
- "pep"
vcard: VCARD
mod_roster:
versioning: true
store_current_id: true
@ -44,6 +46,7 @@ define_macro:
db_type: sql
mod_vcard:
db_type: sql
vcard: VCARD
mod_vcard_xupdate: []
mod_adhoc: []
mod_configure: []

View File

@ -21,6 +21,7 @@ define_macro:
mod_muc:
db_type: sql
ram_db_type: sql
vcard: VCARD
mod_offline:
use_cache: true
db_type: sql
@ -36,6 +37,7 @@ define_macro:
plugins:
- "flat"
- "pep"
vcard: VCARD
mod_roster:
versioning: true
store_current_id: true
@ -44,6 +46,7 @@ define_macro:
db_type: sql
mod_vcard:
db_type: sql
vcard: VCARD
mod_vcard_xupdate: []
mod_adhoc: []
mod_configure: []

View File

@ -14,6 +14,7 @@ define_macro:
db_type: internal
mod_muc:
db_type: internal
vcard: VCARD
mod_offline:
db_type: internal
mod_privacy:
@ -27,6 +28,7 @@ define_macro:
plugins:
- "flat"
- "pep"
vcard: VCARD
mod_roster:
versioning: true
store_current_id: true
@ -35,6 +37,7 @@ define_macro:
db_type: internal
mod_vcard:
db_type: internal
vcard: VCARD
mod_vcard_xupdate: []
mod_client_state:
queue_presence: true

View File

@ -16,6 +16,7 @@ define_macro:
mod_muc:
db_type: sql
ram_db_type: sql
vcard: VCARD
mod_offline:
db_type: sql
mod_privacy:
@ -30,6 +31,7 @@ define_macro:
plugins:
- "flat"
- "pep"
vcard: VCARD
mod_roster:
versioning: true
store_current_id: true
@ -38,6 +40,7 @@ define_macro:
db_type: sql
mod_vcard:
db_type: sql
vcard: VCARD
mod_vcard_xupdate: []
mod_adhoc: []
mod_configure: []

View File

@ -100,8 +100,10 @@ modules:
mod_configure: []
mod_disco: []
mod_ping: []
mod_proxy65: []
mod_muc: []
mod_proxy65:
vcard: VCARD
mod_muc:
vcard: VCARD
mod_muc_admin: []
mod_carboncopy: []
mod_mam: []
@ -124,6 +126,7 @@ Welcome to this XMPP server."
put_url: PUT_URL
get_url: GET_URL
max_size: 10000
vcard: VCARD
registration_timeout: infinity
route_subdomains: s2s
s2s_use_starttls: false

View File

@ -22,3 +22,106 @@ define_macro:
PGSQL_PORT: @@pgsql_port@@
PGSQL_PASS: "@@pgsql_pass@@"
PGSQL_DB: "@@pgsql_db@@"
VCARD:
version: "1.0"
fn: Full Name
n:
family: Family
given: Given
middle: Middle
prefix: Prefix
suffix: Suffix
nickname: Nickname
photo:
type: image/png
extval: https://domain.tld/photo.png
binval: >-
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQAAAAA3bvkkAA
AACklEQVR4AWNoAAAAggCBTBfX3wAAAABJRU5ErkJggg==
bday: 2000-01-01
adr:
-
home: true
work: true
postal: true
parcel: true
dom: true
intl: true
pref: true
pobox: Pobox
extadd: Extadd
street: Street
locality: Locality
region: Region
pcode: Pcode
ctry: Ctry
label:
-
home: true
work: true
postal: true
parcel: true
dom: true
intl: true
pref: true
line:
- Line1
- Line2
tel:
-
home: true
work: true
voice: true
fax: true
pager: true
msg: true
cell: true
video: true
bbs: true
modem: true
isdn: true
pcs: true
pref: true
number: +7-900-01-02
email:
-
home: true
work: true
internet: true
pref: true
x400: true
userid: user@domain.tld
jabberid: user@domain.tld
mailer: Mailer
tz: TZ
geo:
lat: "12.0"
lon: "21.0"
title: Title
role: Role
logo:
type: image/png
extval: https://domain.tld/logo.png
binval: >-
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQAAAAA3bvkkAA
AACklEQVR4AWNoAAAAggCBTBfX3wAAAABJRU5ErkJggg==
categories:
- Cat1
- Cat2
note: Note
prodid: ProdID
rev: Rev
sort_string: SortString
sound:
phonetic: Phonetic
extval: https://domain.tld/sound.ogg
binval: >-
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQAAAAA3bvkkAA
AACklEQVR4AWNoAAAAggCBTBfX3wAAAABJRU5ErkJggg==
uid: UID
url: https://domain.tld
class: public
key:
type: Type
cred: Cred
desc: Desc

View File

@ -193,7 +193,8 @@ service_disco_items(Config) ->
service_vcard(Config) ->
MUC = muc_jid(Config),
ct:comment("Retreiving vCard from ~s", [jid:encode(MUC)]),
#iq{type = result, sub_els = [#vcard_temp{}]} =
VCard = mod_muc_opt:vcard(?config(server, Config)),
#iq{type = result, sub_els = [VCard]} =
send_recv(Config, #iq{type = get, to = MUC, sub_els = [#vcard_temp{}]}),
disconnect(Config).

View File

@ -49,7 +49,8 @@ feature_enabled(Config) ->
service_vcard(Config) ->
JID = proxy_jid(Config),
ct:comment("Retreiving vCard from ~s", [jid:encode(JID)]),
#iq{type = result, sub_els = [#vcard_temp{}]} =
VCard = mod_proxy65_opt:vcard(?config(server, Config)),
#iq{type = result, sub_els = [VCard]} =
send_recv(Config, #iq{type = get, to = JID, sub_els = [#vcard_temp{}]}),
disconnect(Config).

View File

@ -87,7 +87,8 @@ test_features(Config) ->
test_vcard(Config) ->
JID = pubsub_jid(Config),
ct:comment("Retreiving vCard from ~s", [jid:encode(JID)]),
#iq{type = result, sub_els = [#vcard_temp{}]} =
VCard = mod_pubsub_opt:vcard(?config(server, Config)),
#iq{type = result, sub_els = [VCard]} =
send_recv(Config, #iq{type = get, to = JID, sub_els = [#vcard_temp{}]}),
disconnect(Config).

View File

@ -40,6 +40,7 @@
single_cases() ->
{upload_single, [sequence],
[single_test(feature_enabled),
single_test(service_vcard),
single_test(get_max_size),
single_test(slot_request),
single_test(put_get_request),
@ -52,6 +53,14 @@ feature_enabled(Config) ->
end, namespaces()),
disconnect(Config).
service_vcard(Config) ->
Upload = upload_jid(Config),
ct:comment("Retreiving vCard from ~s", [jid:encode(Upload)]),
VCard = mod_http_upload_opt:vcard(?config(server, Config)),
#iq{type = result, sub_els = [VCard]} =
send_recv(Config, #iq{type = get, to = Upload, sub_els = [#vcard_temp{}]}),
disconnect(Config).
get_max_size(Config) ->
Xs = get_disco_info_xdata(Config),
lists:foreach(

View File

@ -91,7 +91,8 @@ get_set(Config) ->
service_vcard(Config) ->
JID = server_jid(Config),
ct:comment("Retreiving vCard from ~s", [jid:encode(JID)]),
#iq{type = result, sub_els = [#vcard_temp{}]} =
VCard = mod_vcard_opt:vcard(?config(server, Config)),
#iq{type = result, sub_els = [VCard]} =
send_recv(Config, #iq{type = get, to = JID, sub_els = [#vcard_temp{}]}),
disconnect(Config).