From f79dc78c50a2f2b853c1002eee2d078570714b3e Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 14 Apr 2016 10:09:05 +0200 Subject: [PATCH] add test for re-invite with 200ok losses --- tester/call_tester.c | 20 ++++++++++++++++++-- tester/liblinphone_tester.h | 2 +- tester/multicast_call_tester.c | 2 +- tester/presence_tester.c | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index 83ca92b88..fd9f7a817 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -1374,7 +1374,7 @@ static void call_with_custom_sdp_attributes(void) { linphone_core_manager_destroy(pauline); } -void call_paused_resumed_base(bool_t multicast) { +void call_paused_resumed_base(bool_t multicast, bool_t with_retransmition) { LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); LinphoneCall* call_pauline; @@ -1391,8 +1391,18 @@ void call_paused_resumed_base(bool_t multicast) { wait_for_until(pauline->lc, marie->lc, NULL, 5, 3000); + if (with_retransmition) { + sal_set_send_error(marie->lc->sal,1500); /*to trash 200ok without generating error*/ + } linphone_core_pause_call(pauline->lc,call_pauline); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPausing,1)); + + if (with_retransmition) { + BC_ASSERT_FALSE(wait_for_until(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPaused,1,1000)); + sal_set_send_error(marie->lc->sal,0); /*to trash 200ok without generating error*/ + } + + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallPausedByRemote,1)); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPaused,1)); @@ -1415,8 +1425,13 @@ end: linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } + static void call_paused_resumed(void) { - call_paused_resumed_base(FALSE); + call_paused_resumed_base(FALSE,FALSE); +} + +static void call_paused_resumed_with_sip_packets_losses(void) { + call_paused_resumed_base(FALSE,TRUE); } static void call_paused_by_both(void) { @@ -6181,6 +6196,7 @@ test_t call_tests[] = { TEST_NO_TAG("Call without SDP", call_with_no_sdp), TEST_NO_TAG("Call without SDP and ACK without SDP", call_with_no_sdp_ack_without_sdp), TEST_NO_TAG("Call paused resumed", call_paused_resumed), + TEST_NO_TAG("Call paused resumed with sip packets looses", call_paused_resumed_with_sip_packets_losses), #ifdef VIDEO_ENABLED TEST_NO_TAG("Call paused resumed with video", call_paused_resumed_with_video), TEST_NO_TAG("Call paused resumed with video no sdp ack", call_paused_resumed_with_no_sdp_ack), diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index 62f3b591c..e8ea90693 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -336,7 +336,7 @@ void account_manager_destroy(void); LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char* path, const char* file, void* user_data); void liblinphone_tester_enable_ipv6(bool_t enabled); void linphone_call_iframe_decoded_cb(LinphoneCall *call,void * user_data); -void call_paused_resumed_base(bool_t multicast); +void call_paused_resumed_base(bool_t multicast,bool_t with_losses); void simple_call_base(bool_t enable_multicast_recv_side); void call_base_with_configfile(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel, const char *marie_rc, const char *pauline_rc); void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel); diff --git a/tester/multicast_call_tester.c b/tester/multicast_call_tester.c index 242be7664..bd70bd8d5 100644 --- a/tester/multicast_call_tester.c +++ b/tester/multicast_call_tester.c @@ -69,7 +69,7 @@ static void call_multicast(void) { call_multicast_base(FALSE); } static void multicast_audio_with_pause_resume(void) { - call_paused_resumed_base(TRUE); + call_paused_resumed_base(TRUE,FALSE); } #ifdef VIDEO_ENABLED static void call_multicast_video(void) { diff --git a/tester/presence_tester.c b/tester/presence_tester.c index 8f63feb7a..81d6baf53 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -183,7 +183,7 @@ static void simple_publish_with_expire(int expires) { BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,4)); linphone_core_manager_destroy(marie); - /*fixme we should wait untill 200ok*/BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishCleared,2,int,"%i"); + /*fixme we should wait untill 200okBC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishCleared,2,int,"%i");*/ BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,4,int,"%i"); } -- GitLab