tester: do not execute TLS tests when it is not available, and avoid using TLS...

tester: do not execute TLS tests when it is not available, and avoid using TLS when it is not necessary
parent 7ae9cf70
......@@ -604,6 +604,7 @@ typedef struct dial_plan{
/* TODO: fill with information for all countries over the world*/
static dial_plan_t const dial_plans[]={
//Country , iso country code, e164 country calling code, number length, international usual prefix
{"Afghanistan" ,"AF" , "93" , 9 , "00" },
{"Albania" ,"AL" , "355" , 9 , "00" },
{"Algeria" ,"DZ" , "213" , 9 , "00" },
......@@ -651,7 +652,7 @@ static dial_plan_t const dial_plans[]={
{"Congo Democratic Republic" ,"CD" , "243" , 9 , "00" },
{"Cook Islands" ,"CK" , "682" , 5 , "00" },
{"Costa Rica" ,"CR" , "506" , 8 , "00" },
{"Cte d'Ivoire" ,"AD" , "225" , 8 , "00" },
{"Cote d'Ivoire" ,"AD" , "225" , 8 , "00" },
{"Croatia" ,"HR" , "385" , 9 , "00" },
{"Cuba" ,"CU" , "53" , 8 , "119" },
{"Cyprus" ,"CY" , "357" , 8 , "00" },
......@@ -780,7 +781,7 @@ static dial_plan_t const dial_plans[]={
{"Saint Vincent and the Grenadines","VC" , "1" , 10 , "011" },
{"Samoa" ,"WS" , "685" , 7 , "0" },
{"San Marino" ,"SM" , "378" , 10 , "00" },
{"S�o Tom� and Pr�ncipe" ,"ST" , "239" , 7 , "00" },
{"Sao Tome and Principe" ,"ST" , "239" , 7 , "00" },
{"Saudi Arabia" ,"SA" , "966" , 9 , "00" },
{"Senegal" ,"SN" , "221" , 9 , "00" },
{"Serbia" ,"RS" , "381" , 9 , "00" },
......
......@@ -47,7 +47,7 @@ set(SOURCE_FILES
setup_tester.c
stun_tester.c
tester.c
transport_tester.c
tunnel_tester.c
upnp_tester.c
video_tester.c
)
......
......@@ -28,7 +28,7 @@ liblinphonetester_la_SOURCES = \
remote_provisioning_tester.c \
setup_tester.c \
stun_tester.c \
transport_tester.c \
tunnel_tester.c \
tester.c \
upnp_tester.c \
video_tester.c \
......
This diff is collapsed.
......@@ -32,11 +32,16 @@ void dtmf_received(LinphoneCore *lc, LinphoneCall *call, int dtmf) {
counters->dtmf_count++;
}
void send_dtmf_base(bool_t use_rfc2833, bool_t use_sipinfo, char dtmf, char* dtmf_seq) {
void send_dtmf_base(bool_t use_rfc2833, bool_t use_sipinfo, char dtmf, char* dtmf_seq, bool_t use_opus) {
char* expected = NULL;
int dtmf_count_prev;
marie = linphone_core_manager_new( "marie_rc");
pauline = linphone_core_manager_new( "pauline_rc");
pauline = linphone_core_manager_new( "pauline_tcp_rc");
if (use_opus) {
disable_all_audio_codecs_except_one(marie->lc, "opus", 48000);
disable_all_audio_codecs_except_one(pauline->lc, "opus", 48000);
}
linphone_core_set_use_rfc2833_for_dtmf(marie->lc, use_rfc2833);
linphone_core_set_use_info_for_dtmf(marie->lc, use_sipinfo);
......@@ -95,22 +100,22 @@ void send_dtmf_cleanup() {
}
static void send_dtmf_rfc2833() {
send_dtmf_base(TRUE,FALSE,'1',NULL);
send_dtmf_base(TRUE,FALSE,'1',NULL,FALSE);
send_dtmf_cleanup();
}
static void send_dtmf_sip_info() {
send_dtmf_base(FALSE,TRUE,'#',NULL);
send_dtmf_base(FALSE,TRUE,'#',NULL,FALSE);
send_dtmf_cleanup();
}
static void send_dtmfs_sequence_rfc2833() {
send_dtmf_base(TRUE,FALSE,'\0',"1230#");
send_dtmf_base(TRUE,FALSE,'\0',"1230#",FALSE);
send_dtmf_cleanup();
}
static void send_dtmfs_sequence_sip_info() {
send_dtmf_base(FALSE,TRUE,'\0',"1230#");
send_dtmf_base(FALSE,TRUE,'\0',"1230#",FALSE);
send_dtmf_cleanup();
}
......@@ -121,7 +126,7 @@ static void send_dtmfs_sequence_not_ready() {
}
static void send_dtmfs_sequence_call_state_changed() {
send_dtmf_base(FALSE,TRUE,'\0',NULL);
send_dtmf_base(FALSE,TRUE,'\0',NULL,FALSE);
/*very long DTMF(around 4 sec to be sent)*/
linphone_call_send_dtmfs(marie_call, "123456789123456789");
......@@ -138,6 +143,11 @@ static void send_dtmfs_sequence_call_state_changed() {
send_dtmf_cleanup();
}
static void send_dtmf_rfc2833_opus() {
send_dtmf_base(TRUE,FALSE,'1',NULL,TRUE);
send_dtmf_cleanup();
}
test_t dtmf_tests[] = {
{ "Send DTMF using RFC2833",send_dtmf_rfc2833},
{ "Send DTMF using SIP INFO",send_dtmf_sip_info},
......@@ -145,6 +155,7 @@ test_t dtmf_tests[] = {
{ "Send DTMF sequence using SIP INFO",send_dtmfs_sequence_sip_info},
{ "DTMF sequence not sent if invalid call",send_dtmfs_sequence_not_ready},
{ "DTMF sequence canceled if call state changed",send_dtmfs_sequence_call_state_changed},
{ "Send DTMF using RFC2833 using Opus",send_dtmf_rfc2833_opus},
};
test_suite_t dtmf_test_suite = {
......
......@@ -122,7 +122,7 @@ void linphone_publish_state_changed(LinphoneCore *lc, LinphoneEvent *ev, Linphon
static void subscribe_test_declined(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneContent* content;
LinphoneEvent *lev;
const LinphoneErrorInfo *ei;
......@@ -164,7 +164,7 @@ typedef enum RefreshTestType{
static void subscribe_test_with_args(bool_t terminated_by_subscriber, RefreshTestType refresh_type) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneContent* content;
LinphoneEvent *lev;
int expires= refresh_type!=NoRefresh ? 4 : 600;
......@@ -217,7 +217,7 @@ static void subscribe_test_with_args(bool_t terminated_by_subscriber, RefreshTes
static void subscribe_test_with_args2(bool_t terminated_by_subscriber, RefreshTestType refresh_type) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneContent* content;
LinphoneEvent *lev;
int expires= refresh_type!=NoRefresh ? 4 : 600;
......@@ -301,7 +301,7 @@ static void subscribe_test_manually_refreshed(void){
static void publish_test_with_args(bool_t refresh, int expires){
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneContent* content;
LinphoneEvent *lev;
MSList* lcs=ms_list_append(NULL,marie->lc);
......
This diff is collapsed.
......@@ -44,7 +44,7 @@ extern test_suite_t stun_test_suite;
extern test_suite_t remote_provisioning_test_suite;
extern test_suite_t quality_reporting_test_suite;
extern test_suite_t log_collection_test_suite;
extern test_suite_t transport_test_suite;
extern test_suite_t tunnel_test_suite;
extern test_suite_t player_test_suite;
extern test_suite_t dtmf_test_suite;
extern test_suite_t offeranswer_test_suite;
......@@ -288,6 +288,7 @@ void end_call(LinphoneCoreManager *m1, LinphoneCoreManager *m2);
void disable_all_audio_codecs_except_one(LinphoneCore *lc, const char *mime, int rate);
void disable_all_video_codecs_except_one(LinphoneCore *lc, const char *mime);
stats * get_stats(LinphoneCore *lc);
bool_t transport_supported(LinphoneCore *lc, LinphoneTransportType transport);
LinphoneCoreManager *get_manager(LinphoneCore *lc);
const char *liblinphone_tester_get_subscribe_content(void);
const char *liblinphone_tester_get_notify_content(void);
......
......@@ -108,7 +108,7 @@ static LinphoneCoreManager* setup(bool_t enable_logs) {
collect_init();
linphone_core_enable_log_collection(enable_logs);
marie = linphone_core_manager_new( "marie_rc");
marie = linphone_core_manager_new2( "marie_rc", 0);
// wait a few seconds to generate some traffic
while (--timeout){
// Generate some logs - error logs because we must ensure that
......@@ -288,27 +288,28 @@ static void logCollectionUploadStateChangedCb(LinphoneCore *lc, LinphoneCoreLogC
}
static void upload_collected_traces() {
LinphoneCoreManager* marie = setup(TRUE);
int waiting = 100;
LinphoneCoreVTable *v_table = linphone_core_v_table_new();
v_table->log_collection_upload_state_changed = logCollectionUploadStateChangedCb;
linphone_core_add_listener(marie->lc, v_table);
linphone_core_set_log_collection_max_file_size(5000);
linphone_core_set_log_collection_upload_server_url(marie->lc,"https://www.linphone.org:444/lft.php");
// Generate some logs
while (--waiting) ms_error("(test error)Waiting %d...", waiting);
linphone_core_compress_log_collection(marie->lc);
linphone_core_upload_log_collection(marie->lc);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,1));
/*try 2 times*/
waiting=100;
linphone_core_reset_log_collection(marie->lc);
while (--waiting) ms_error("(test error)Waiting %d...", waiting);
linphone_core_compress_log_collection(marie->lc);
linphone_core_upload_log_collection(marie->lc);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,2));
if (transport_supported(marie->lc, LinphoneTransportTls)) {
int waiting = 100;
LinphoneCoreVTable *v_table = linphone_core_v_table_new();
v_table->log_collection_upload_state_changed = logCollectionUploadStateChangedCb;
linphone_core_add_listener(marie->lc, v_table);
linphone_core_set_log_collection_max_file_size(5000);
linphone_core_set_log_collection_upload_server_url(marie->lc,"https://www.linphone.org:444/lft.php");
// Generate some logs
while (--waiting) ms_error("(test error)Waiting %d...", waiting);
linphone_core_compress_log_collection(marie->lc);
linphone_core_upload_log_collection(marie->lc);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,1));
/*try 2 times*/
waiting=100;
linphone_core_reset_log_collection(marie->lc);
while (--waiting) ms_error("(test error)Waiting %d...", waiting);
linphone_core_compress_log_collection(marie->lc);
linphone_core_upload_log_collection(marie->lc);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCoreLogCollectionUploadStateDelivered,2));
}
collect_cleanup(marie);
}
......
This diff is collapsed.
......@@ -33,7 +33,7 @@
static void call_waiting_indication_with_param(bool_t enable_caller_privacy) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc");
MSList *iterator;
MSList* lcs;
......@@ -115,7 +115,7 @@ static void call_waiting_indication_with_privacy(void) {
static void incoming_call_accepted_when_outgoing_call_in_state(LinphoneCallState state) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc");
MSList* lcs;
LinphoneCallParams *laure_params=linphone_core_create_default_call_parameters(laure->lc);
......@@ -242,7 +242,7 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag
}
static void simple_conference(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc");
simple_conference_base(marie,pauline,laure);
linphone_core_manager_destroy(marie);
......@@ -252,7 +252,7 @@ static void simple_conference(void) {
static void simple_conference_with_ice(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc");
linphone_core_set_firewall_policy(marie->lc,LinphonePolicyUseIce);
......@@ -271,7 +271,7 @@ static void simple_conference_with_ice(void) {
static void simple_call_transfer(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc");
LinphoneCall* pauline_called_by_marie;
LinphoneCall *marie_calling_pauline;
......@@ -331,7 +331,7 @@ static void simple_call_transfer(void) {
static void unattended_call_transfer(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc");
LinphoneCall* pauline_called_by_marie;
......@@ -377,7 +377,7 @@ static void unattended_call_transfer(void) {
static void unattended_call_transfer_with_error(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCall* pauline_called_by_marie;
bool_t call_ok=TRUE;
MSList* lcs=ms_list_append(NULL,marie->lc);
......@@ -417,7 +417,7 @@ static void unattended_call_transfer_with_error(void) {
static void call_transfer_existing_call_outgoing_call(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCoreManager* laure = linphone_core_manager_new( "laure_rc");
LinphoneCall* marie_call_pauline;
LinphoneCall* pauline_called_by_marie;
......
......@@ -31,7 +31,7 @@ static void call_multicast_base(bool_t video) {
belle_sip_object_enable_leak_detector(TRUE);
begin=belle_sip_object_get_object_count();
marie = linphone_core_manager_new( "marie_rc");
pauline = linphone_core_manager_new( "pauline_rc");
pauline = linphone_core_manager_new( "pauline_tcp_rc");
if (video) {
linphone_core_enable_video_capture(marie->lc, TRUE);
......@@ -101,8 +101,8 @@ static void early_media_with_multicast_base(bool_t video) {
belle_sip_object_enable_leak_detector(TRUE);
begin=belle_sip_object_get_object_count();
marie = linphone_core_manager_new("marie_rc");
pauline = linphone_core_manager_new("pauline_rc");
pauline2 = linphone_core_manager_new("pauline_rc");
pauline = linphone_core_manager_new("pauline_tcp_rc");
pauline2 = linphone_core_manager_new("pauline_tcp_rc");
marie_lp=linphone_core_get_config(marie->lc);
lp_config_set_int(marie_lp,"misc","real_early_media",1);
......
......@@ -80,7 +80,7 @@ static void simple_call_with_different_codec_mappings(void) {
begin=belle_sip_object_get_object_count();
marie = linphone_core_manager_new( "marie_rc");
pauline = linphone_core_manager_new( "pauline_rc");
pauline = linphone_core_manager_new( "pauline_tcp_rc");
disable_all_audio_codecs_except_one(marie->lc,"pcmu",-1);
disable_all_audio_codecs_except_one(pauline->lc,"pcmu",-1);
......@@ -127,7 +127,7 @@ static void call_failed_because_of_codecs(void) {
{
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCall* out_call;
disable_all_audio_codecs_except_one(marie->lc,"pcmu",-1);
......@@ -156,7 +156,7 @@ static void call_failed_because_of_codecs(void) {
static void profile_call_base(bool_t avpf1, LinphoneMediaEncryption srtp1,bool_t avpf2, LinphoneMediaEncryption srtp2, bool_t encryption_mandatory, const char *expected_profile) {
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc");
LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_tcp_rc");
LinphoneProxyConfig *lpc;
const LinphoneCallParams *params;
......
......@@ -180,7 +180,7 @@ static bool_t subscribe_to_callee_presence(LinphoneCoreManager* caller_mgr,Linph
}
static void subscribe_failure_handle_by_app(void) {
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_tcp_rc");
LinphoneProxyConfig* config;
LinphoneFriend* lf;
char* lf_identity=linphone_address_as_string_uri_only(pauline->identity);
......
......@@ -143,7 +143,7 @@ bool_t create_call_for_quality_reporting_tests(
static void quality_reporting_not_used_without_config() {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCall* call_marie = NULL;
LinphoneCall* call_pauline = NULL;
......@@ -167,7 +167,7 @@ static void quality_reporting_not_used_without_config() {
static void quality_reporting_not_sent_if_call_not_started() {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCallLog* out_call_log;
LinphoneCall* out_call;
......@@ -198,7 +198,7 @@ static void quality_reporting_not_sent_if_call_not_started() {
static void quality_reporting_not_sent_if_low_bandwidth() {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCallParams* marie_params;
marie_params=linphone_core_create_default_call_parameters(marie->lc);
......@@ -223,7 +223,7 @@ void on_report_send_remove_fields(const LinphoneCall *call, int stream_type, con
static void quality_reporting_invalid_report() {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCall* call_marie = NULL;
LinphoneCall* call_pauline = NULL;
......@@ -291,7 +291,7 @@ static void quality_reporting_interval_report() {
static void quality_reporting_session_report_if_video_stopped() {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc_rtcp_xr");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCall* call_pauline = NULL;
LinphoneCall* call_marie = NULL;
LinphoneCallParams* pauline_params;
......
......@@ -15,8 +15,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -15,8 +15,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -36,7 +36,7 @@ video_rtp_port=39072-49000
display=0
capture=0
show_local=0
size=vga
size=qcif
enabled=0
self_view=0
automatically_initiate=0
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
This diff is collapsed.
......@@ -59,8 +59,10 @@ static void remote_provisioning_transient(void) {
static void remote_provisioning_https(void) {
LinphoneCoreManager* marie = linphone_core_manager_new2("marie_remote_https_rc", FALSE);
BC_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneConfiguringSuccessful,1));
BC_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneRegistrationOk,1));
if (transport_supported(marie->lc, LinphoneTransportTls)) {
BC_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneConfiguringSuccessful,1));
BC_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneRegistrationOk,1));
}
linphone_core_manager_destroy(marie);
}
......
......@@ -224,6 +224,12 @@ LinphoneCoreManager *get_manager(LinphoneCore *lc){
return manager;
}
bool_t transport_supported(LinphoneCore *lc, LinphoneTransportType transport) {
bool_t supported = linphone_core_sip_transport_supported(lc, transport);
if (!supported) ms_warning("TLS transport not supported, falling back to TCP if possible otherwise skipping test.");
return supported;
}
LinphoneCoreManager* linphone_core_manager_init(const char* rc_file) {
LinphoneCoreManager* mgr= ms_new0(LinphoneCoreManager,1);
char *rc_path = NULL;
......@@ -402,7 +408,7 @@ void liblinphone_tester_add_suites() {
bc_tester_add_suite(&remote_provisioning_test_suite);
bc_tester_add_suite(&quality_reporting_test_suite);
bc_tester_add_suite(&log_collection_test_suite);
bc_tester_add_suite(&transport_test_suite);
bc_tester_add_suite(&tunnel_test_suite);
bc_tester_add_suite(&player_test_suite);
bc_tester_add_suite(&dtmf_test_suite);
#if defined(VIDEO_ENABLED) && defined(HAVE_GTK)
......
......@@ -58,7 +58,7 @@ static char* get_public_contact_ip(LinphoneCore* lc) {
}
static void call_with_transport_base(LinphoneTunnelMode tunnel_mode, bool_t with_sip, LinphoneMediaEncryption encryption, bool_t with_video_and_ice) {
static void call_with_tunnel_base(LinphoneTunnelMode tunnel_mode, bool_t with_sip, LinphoneMediaEncryption encryption, bool_t with_video_and_ice) {
if (linphone_core_tunnel_available()){
LinphoneCoreManager *pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCoreManager *marie = linphone_core_manager_new( "marie_rc");
......@@ -174,30 +174,30 @@ static void call_with_transport_base(LinphoneTunnelMode tunnel_mode, bool_t with
static void call_with_tunnel(void) {
call_with_transport_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionNone, FALSE);
call_with_tunnel_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionNone, FALSE);
}
static void call_with_tunnel_srtp(void) {
call_with_transport_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionSRTP, FALSE);
call_with_tunnel_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionSRTP, FALSE);
}
static void call_with_tunnel_without_sip(void) {
call_with_transport_base(LinphoneTunnelModeEnable, FALSE, LinphoneMediaEncryptionNone, FALSE);
call_with_tunnel_base(LinphoneTunnelModeEnable, FALSE, LinphoneMediaEncryptionNone, FALSE);
}
static void call_with_tunnel_auto(void) {
call_with_transport_base(LinphoneTunnelModeAuto, TRUE, LinphoneMediaEncryptionNone, FALSE);
call_with_tunnel_base(LinphoneTunnelModeAuto, TRUE, LinphoneMediaEncryptionNone, FALSE);
}
static void call_with_tunnel_auto_without_sip_with_srtp(void) {
call_with_transport_base(LinphoneTunnelModeAuto, FALSE, LinphoneMediaEncryptionSRTP, FALSE);
call_with_tunnel_base(LinphoneTunnelModeAuto, FALSE, LinphoneMediaEncryptionSRTP, FALSE);
}
#ifdef VIDEO_ENABLED
static void full_tunnel_video_ice_call(void){
if (linphone_core_tunnel_available()){
call_with_transport_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionNone, TRUE);
call_with_tunnel_base(LinphoneTunnelModeEnable, TRUE, LinphoneMediaEncryptionNone, TRUE);
}else
ms_warning("Could not test %s because tunnel functionality is not available",__FUNCTION__);
}
......@@ -250,28 +250,28 @@ static void tunnel_ice_call(void) {
else
ms_warning("Could not test %s because tunnel functionality is not available",__FUNCTION__);
}
test_t transport_tests[] = {
{ "Tunnel only", call_with_tunnel },
{ "Tunnel with SRTP", call_with_tunnel_srtp },
{ "Tunnel without SIP", call_with_tunnel_without_sip },
{ "Tunnel in automatic mode", call_with_tunnel_auto },
{ "Tunnel in automatic mode with SRTP without SIP", call_with_tunnel_auto_without_sip_with_srtp },
{ "Tunnel ice call", tunnel_ice_call },
{ "Tunnel SRTP ice call", tunnel_srtp_ice_call },
{ "Tunnel ZRTP ice call", tunnel_zrtp_ice_call },
test_t tunnel_tests[] = {
{ "Simple", call_with_tunnel },
{ "With SRTP", call_with_tunnel_srtp },
{ "Without SIP", call_with_tunnel_without_sip },
{ "In automatic mode", call_with_tunnel_auto },
{ "In automatic mode with SRTP without SIP", call_with_tunnel_auto_without_sip_with_srtp },
{ "Ice call", tunnel_ice_call },
{ "SRTP ice call", tunnel_srtp_ice_call },
{ "ZRTP ice call", tunnel_zrtp_ice_call },
#ifdef VIDEO_ENABLED
{ "Tunnel ice video call", tunnel_video_ice_call },
{ "Tunnel with SIP - ice video call", full_tunnel_video_ice_call },
{ "Tunnel SRTP ice video call", tunnel_srtp_video_ice_call },
{ "Tunnel DTLS ice video call", tunnel_dtls_video_ice_call },
{ "Tunnel ZRTP ice video call", tunnel_zrtp_video_ice_call },
{ "Ice video call", tunnel_video_ice_call },
{ "With SIP - ice video call", full_tunnel_video_ice_call },
{ "SRTP ice video call", tunnel_srtp_video_ice_call },
{ "DTLS ice video call", tunnel_dtls_video_ice_call },
{ "ZRTP ice video call", tunnel_zrtp_video_ice_call },
#endif
};
test_suite_t transport_test_suite = {
"Transport",
test_suite_t tunnel_test_suite = {
"Tunnel",
NULL,
NULL,
sizeof(transport_tests) / sizeof(transport_tests[0]),
transport_tests
sizeof(tunnel_tests) / sizeof(tunnel_tests[0]),
tunnel_tests
};
......@@ -247,7 +247,7 @@ static void early_media_video_during_video_call_test(void) {
LinphoneCallParams *laure_params;
marie = linphone_core_manager_new("marie_rc");
pauline = linphone_core_manager_new("pauline_rc");
pauline = linphone_core_manager_new("pauline_tcp_rc");
laure = linphone_core_manager_new("laure_rc");
marie_params = configure_for_early_media_video_receiving(marie);
pauline_params = configure_for_video(pauline);
......@@ -297,7 +297,7 @@ static void two_incoming_early_media_video_calls_test(void) {
const MSList *calls_list;
marie = linphone_core_manager_new("marie_rc");
pauline = linphone_core_manager_new("pauline_rc");
pauline = linphone_core_manager_new("pauline_tcp_rc");
laure = linphone_core_manager_new("laure_rc");
marie_params = configure_for_early_media_video_receiving(marie);
pauline_params = configure_for_early_media_video_sending(pauline);
......@@ -364,7 +364,7 @@ static void early_media_video_with_inactive_audio(void) {
LinphoneCallParams *pauline_params;
marie = linphone_core_manager_new("marie_rc");
pauline = linphone_core_manager_new("pauline_rc");
pauline = linphone_core_manager_new("pauline_tcp_rc");
marie_params = configure_for_early_media_video_receiving_with_inactive_audio(marie);
pauline_params = configure_for_early_media_video_sending(pauline);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment