enable new tls test

This commit is contained in:
Simon Morlat 2013-05-07 16:12:56 +02:00
parent e1c4e819bc
commit 25f44cc7c9

View file

@ -358,34 +358,34 @@ static void tls_certificate_failure(){
LinphoneCoreVTable v_table;
LinphoneCore* lc;
stats stat;
stats* counters;
//stats* counters;
char rootcapath[256];
memset (&v_table,0,sizeof(v_table));
reset_counters(&stat);
v_table.registration_state_changed=registration_state_changed;
lc = configure_lc_from(&v_table,liblinphone_tester_file_prefix, "pauline_rc", 0);
linphone_core_set_user_data(lc,&stat);
counters = (stats*)linphone_core_get_user_data(lc);
sprintf(rootcapath, "%s/certificates/agent.pem", liblinphone_tester_file_prefix); /*bad root ca*/
//counters = (stats*)linphone_core_get_user_data(lc);
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/agent.pem", liblinphone_tester_file_prefix); /*bad root ca*/
linphone_core_set_root_ca(lc,rootcapath);
linphone_core_set_network_reachable(lc,TRUE);
CU_ASSERT_TRUE(wait_for(lc,lc,&stat.number_of_LinphoneRegistrationFailed,1));
linphone_core_set_root_ca(lc,NULL); /*no root ca*/
linphone_core_refresh_registers(lc);
CU_ASSERT_TRUE(wait_for(lc,lc,&stat.number_of_LinphoneRegistrationFailed,2));
sprintf(rootcapath, "%s/certificates/cacert.pem", liblinphone_tester_file_prefix); /*goot root ca*/
snprintf(rootcapath,sizeof(rootcapath), "%s/certificates/cacert.pem", liblinphone_tester_file_prefix); /*goot root ca*/
linphone_core_set_root_ca(lc,rootcapath);
linphone_core_refresh_registers(lc);
CU_ASSERT_TRUE(wait_for(lc,lc,&stat.number_of_LinphoneRegistrationOk,1));
CU_ASSERT_EQUAL(stat.number_of_LinphoneRegistrationFailed,2);
linphone_core_destroy(lc);
}
/*
static void tls_with_non_tls_server(){
LinphoneCoreVTable v_table;
LinphoneCore* lc;
stats stat;
stats* counters;
//stats* counters;
LinphoneProxyConfig* proxy_cfg;
LinphoneAddress* addr;
@ -395,7 +395,7 @@ static void tls_with_non_tls_server(){
v_table.registration_state_changed=registration_state_changed;
lc = configure_lc_from(&v_table,liblinphone_tester_file_prefix, "marie_rc", 0);
linphone_core_set_user_data(lc,&stat);
counters = (stats*)linphone_core_get_user_data(lc);
//counters = (stats*)linphone_core_get_user_data(lc);
linphone_core_get_default_proxy(lc,&proxy_cfg);
linphone_proxy_config_edit(proxy_cfg);
addr=linphone_address_new(linphone_proxy_config_get_addr(proxy_cfg));
@ -407,7 +407,7 @@ static void tls_with_non_tls_server(){
CU_ASSERT_TRUE(wait_for(lc,lc,&stat.number_of_LinphoneRegistrationFailed,1));
linphone_core_destroy(lc);
}*/
}
test_t register_tests[] = {
{ "Simple register", simple_register },
@ -415,7 +415,7 @@ test_t register_tests[] = {
{ "TCP register compatibility mode", simple_tcp_register_compatibility_mode },
{ "TLS register", simple_tls_register },
{ "TLS certificate not verified",tls_certificate_failure},
/* { "TLS with non tls server",tls_with_non_tls_server},*/
{ "TLS with non tls server",tls_with_non_tls_server},
{ "Simple authenticated register", simple_authenticated_register },
{ "Ha1 authenticated register", ha1_authenticated_register },
{ "Digest auth without initial credentials", authenticated_register_with_no_initial_credentials },