Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
8f1b21f8
Commit
8f1b21f8
authored
Aug 10, 2018
by
Benjamin REIS
Browse files
test bodyless_lists rc settings
parent
0a537423
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
21 deletions
+129
-21
tester/flexisip/userdb.conf
tester/flexisip/userdb.conf
+9
-0
tester/presence_server_tester.c
tester/presence_server_tester.c
+58
-21
tester/rcfiles/marie_bodyless_rc
tester/rcfiles/marie_bodyless_rc
+62
-0
No files found.
tester/flexisip/userdb.conf
View file @
8f1b21f8
...
...
@@ -10,6 +10,15 @@ bellesip@sip.example.org md5:2fc013743b860819a784b0e6c4bee11a ;
liblinphone_sha_tester
@
sip
.
example
.
org
clrtxt
:
secret
;
test
%
20
username
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
friend1
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
friend2
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
friend3
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
friend4
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
buddy1
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
buddy2
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
buddy3
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
bro
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
user_1
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
user_2
@
sip
.
example
.
org
clrtxt
:
secret
;
sip
:
user_3
@
sip
.
example
.
org
clrtxt
:
secret
;
...
...
tester/presence_server_tester.c
View file @
8f1b21f8
...
...
@@ -1749,17 +1749,17 @@ static void simple_bodyless_list_subscription(void) {
LinphoneCoreManager
*
marie
=
linphone_core_manager_new
(
"marie_rc"
);
LinphoneFriendList
*
friendList
=
linphone_core_create_friend_list
(
marie
->
lc
);
linphone_core_add_friend_list
(
marie
->
lc
,
friendList
);
linphone_friend_list_set_rls_uri
(
friendList
,
"sip:friends@sip
open
.example.org"
);
linphone_friend_list_set_rls_uri
(
friendList
,
"sip:friends@sip.example.org"
);
linphone_friend_list_set_display_name
(
friendList
,
"Friends"
);
linphone_friend_list_set_subscription_bodyless
(
friendList
,
TRUE
);
BC_ASSERT_TRUE
(
wait_for_until
(
marie
->
lc
,
NULL
,
&
marie
->
stat
.
number_of_NotifyPresenceReceived
,
4
,
4
000
));
BC_ASSERT_TRUE
(
wait_for_until
(
marie
->
lc
,
NULL
,
&
marie
->
stat
.
number_of_NotifyPresenceReceived
,
4
,
15
000
));
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
friendList
)),
4
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend1@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend2@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend3@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend4@sip
open
.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend5@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend1@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend2@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend3@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend4@sip.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend5@sip.example.org"
));
linphone_friend_list_unref
(
friendList
);
linphone_core_manager_destroy
(
marie
);
...
...
@@ -1772,38 +1772,74 @@ static void multiple_bodyless_list_subscription(void) {
LinphoneFriendList
*
broList
=
linphone_core_create_friend_list
(
marie
->
lc
);
linphone_core_add_friend_list
(
marie
->
lc
,
friendList
);
linphone_friend_list_set_rls_uri
(
friendList
,
"sip:friends@sip
open
.example.org"
);
linphone_friend_list_set_rls_uri
(
friendList
,
"sip:friends@sip.example.org"
);
linphone_friend_list_set_display_name
(
friendList
,
"Friends"
);
linphone_friend_list_set_subscription_bodyless
(
friendList
,
TRUE
);
linphone_core_add_friend_list
(
marie
->
lc
,
buddyList
);
linphone_friend_list_set_rls_uri
(
buddyList
,
"sip:buddies@sip
open
.example.org"
);
linphone_friend_list_set_rls_uri
(
buddyList
,
"sip:buddies@sip.example.org"
);
linphone_friend_list_set_display_name
(
buddyList
,
"Buddies"
);
linphone_friend_list_set_subscription_bodyless
(
buddyList
,
TRUE
);
linphone_core_add_friend_list
(
marie
->
lc
,
broList
);
linphone_friend_list_set_rls_uri
(
broList
,
"sip:bros@sip
open
.example.org"
);
linphone_friend_list_set_rls_uri
(
broList
,
"sip:bros@sip.example.org"
);
linphone_friend_list_set_display_name
(
broList
,
"Bros"
);
linphone_friend_list_set_subscription_bodyless
(
broList
,
TRUE
);
BC_ASSERT_TRUE
(
wait_for_until
(
marie
->
lc
,
NULL
,
&
marie
->
stat
.
number_of_NotifyPresenceReceived
,
8
,
8000
));
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
friendList
)),
4
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend1@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend2@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend3@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend4@sip
open
.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend5@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend1@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend2@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend3@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend4@sip.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend5@sip.example.org"
));
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
buddyList
)),
3
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy1@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy2@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy3@sip
open
.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy4@sip
open
.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy1@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy2@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy3@sip.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy4@sip.example.org"
));
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
broList
)),
1
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
broList
,
"sip:bro@sipopen.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
broList
,
"sip:bro2@sipopen.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
broList
,
"sip:bro@sip.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
broList
,
"sip:bro2@sip.example.org"
));
linphone_friend_list_unref
(
friendList
);
linphone_friend_list_unref
(
buddyList
);
linphone_friend_list_unref
(
broList
);
linphone_core_manager_destroy
(
marie
);
}
static
void
multiple_bodyless_list_subscription_with_rc
(
void
)
{
LinphoneCoreManager
*
marie
=
linphone_core_manager_new
(
"marie_bodyless_rc"
);
BC_ASSERT_TRUE
(
wait_for_until
(
marie
->
lc
,
NULL
,
&
marie
->
stat
.
number_of_NotifyPresenceReceived
,
8
,
8000
));
LinphoneFriendList
*
friendList
=
linphone_core_get_friend_list_by_name
(
marie
->
lc
,
"friends"
);
LinphoneFriendList
*
buddyList
=
linphone_core_get_friend_list_by_name
(
marie
->
lc
,
"buddies"
);
LinphoneFriendList
*
broList
=
linphone_core_get_friend_list_by_name
(
marie
->
lc
,
"bros"
);
BC_ASSERT_PTR_NOT_NULL
(
friendList
);
BC_ASSERT_PTR_NOT_NULL
(
buddyList
);
BC_ASSERT_PTR_NOT_NULL
(
broList
);
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
friendList
)),
4
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend1@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend2@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend3@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend4@sip.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
friendList
,
"sip:friend5@sip.example.org"
));
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
buddyList
)),
3
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy1@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy2@sip.example.org"
));
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy3@sip.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
buddyList
,
"sip:buddy4@sip.example.org"
));
BC_ASSERT_EQUAL
(
bctbx_list_size
(
linphone_friend_list_get_friends
(
broList
)),
1
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_friend_list_find_friend_by_uri
(
broList
,
"sip:bro@sip.example.org"
));
BC_ASSERT_PTR_NULL
(
linphone_friend_list_find_friend_by_uri
(
broList
,
"sip:bro2@sip.example.org"
));
linphone_friend_list_unref
(
friendList
);
linphone_friend_list_unref
(
buddyList
);
...
...
@@ -1843,6 +1879,7 @@ test_t presence_server_tests[] = {
TEST_NO_TAG
(
"Extended notify only when subscribe then unsubscribe then re-subscribe 2"
,
extended_notify_sub_unsub_sub2
),
TEST_ONE_TAG
(
"Simple bodyless list subscription"
,
simple_bodyless_list_subscription
,
"bodyless"
),
TEST_ONE_TAG
(
"Multiple bodyless list subscription"
,
multiple_bodyless_list_subscription
,
"bodyless"
),
TEST_ONE_TAG
(
"Multiple bodyless list subscription with rc"
,
multiple_bodyless_list_subscription_with_rc
,
"bodyless"
),
};
test_suite_t
presence_server_test_suite
=
{
"Presence using server"
,
NULL
,
NULL
,
liblinphone_tester_before_each
,
liblinphone_tester_after_each
,
...
...
tester/rcfiles/marie_bodyless_rc
0 → 100644
View file @
8f1b21f8
[sip]
sip_port=-1
sip_tcp_port=-1
sip_tls_port=-1
default_proxy=0
ping_with_options=0
composing_idle_timeout=1
store_ha1_passwd=0 #used for sipp
bodyless_lists=sip:friends@sipopen.example.org, sip:buddies@sipopen.example.org, sip:bros@sipopen.example.org
[auth_info_0]
username=marie
userid=marie
passwd=secret
realm=sip.example.org
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
reg_identity="Super Marie" <sip:marie@sip.example.org>
reg_expires=3600
reg_sendregister=1
publish=0
dial_escape_plus=0
[friend_0]
url="Paupoche" <sip:pauline@sip.example.org>
pol=accept
subscribe=0
[misc]
enable_basic_to_client_group_chat_room_migration=1
basic_to_client_group_chat_room_migration_timer=180
[rtp]
audio_rtp_port=18070-28000
video_rtp_port=28070-38000
text_rtp_port=39000-49000
[video]
display=0
capture=0
show_local=0
size=qcif
enabled=0
self_view=0
automatically_initiate=0
automatically_accept=0
device=StaticImage: Static picture
[sound]
echocancellation=0 #to not overload cpu in case of VG
[net]
dns_srv_enabled=0 #no srv needed in general
stun_server=stun.linphone.org
#leave this section, which is used by "Codec setup" test of "Setup" suite.
[video_codec_0]
mime=VP8
rate=90000
enabled=1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment