Commit 8d4c8a46 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Few changes in tests to use new test server (without tls for now)

parent 5ee5a324
......@@ -14,7 +14,8 @@ realm="sip.example.org"
[proxy_0]
reg_proxy=sip.example.org
reg_proxy=sip2.linphone.org
reg_route=sip2.linphone.org
reg_identity=sip:laure@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -14,8 +14,8 @@ realm="sip.example.org"
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp;lr
reg_identity=sip:marie@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -29,7 +29,8 @@ passwd=secret
realm="sip.example.org"
[proxy_0]
reg_proxy=sip.example.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
......@@ -37,7 +38,8 @@ publish=0
dial_escape_plus=0
[proxy_1]
reg_proxy=sip.example.org;transport=tcp
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_identity=sip:marie@sip.example.org
reg_expires=3600
reg_sendregister=1
......@@ -45,7 +47,8 @@ publish=0
dial_escape_plus=0
[proxy_2]
reg_proxy=auth1.example.org
reg_proxy=sip2.linphone.org
reg_route=sip2.linphone.org
reg_identity=sip:liblinphone_tester@auth1.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -14,8 +14,8 @@ realm="sip.example.org"
[proxy_0]
reg_proxy=sip.example.org;transport=tls
reg_route=sip.example.org;transport=tls;lr
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp;lr
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -167,9 +167,6 @@
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\LibLinphoneTester\LibLinphoneTester.vcxproj">
<Project>{5E94A00B-B14A-4E42-8284-8CB0EF099534}</Project>
......
......@@ -36,6 +36,7 @@ const char* test_domain="sipopen.example.org";
const char* auth_domain="sip.example.org";
const char* test_username="liblinphone_tester";
const char* test_password="secret";
const char* test_route="sip2.linphone.org";
LinphoneAddress * create_linphone_address(const char * domain) {
......@@ -43,7 +44,7 @@ LinphoneAddress * create_linphone_address(const char * domain) {
CU_ASSERT_PTR_NOT_NULL_FATAL(addr);
linphone_address_set_username(addr,test_username);
CU_ASSERT_STRING_EQUAL(test_username,linphone_address_get_username(addr));
if (!domain) domain= test_domain;
if (!domain) domain= test_route;
linphone_address_set_domain(addr,domain);
CU_ASSERT_STRING_EQUAL(domain,linphone_address_get_domain(addr));
linphone_address_set_display_name(addr, NULL);
......
......@@ -75,7 +75,7 @@ const char* test_domain;
const char* auth_domain;
const char* test_username;
const char* test_password;
const char* test_route;
typedef struct _stats {
......
......@@ -118,9 +118,11 @@ static void register_with_refresh_with_send_error(void) {
LinphoneCore* lc = create_lc_with_auth(1);
stats* counters = (stats*)linphone_core_get_user_data(lc);
LinphoneAuthInfo *info=linphone_auth_info_new(test_username,NULL,test_password,NULL,auth_domain); /*create authentication structure from identity*/
char route[256];
sprintf(route,"sip:%s",test_route);
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
register_with_refresh_base(lc,TRUE,auth_domain,NULL);
register_with_refresh_base(lc,TRUE,auth_domain,route);
/*simultate a network error*/
sal_set_send_error(lc->sal, -1);
while (counters->number_of_LinphoneRegistrationFailed<1 && retry++ <20) {
......@@ -152,33 +154,37 @@ static void simple_register_with_refresh() {
static void simple_auth_register_with_refresh() {
LinphoneCore* lc = create_lc_with_auth(1);
stats* counters = (stats*)linphone_core_get_user_data(lc);
register_with_refresh(lc,TRUE,auth_domain,NULL);
char route[256];
sprintf(route,"sip:%s",test_route);
register_with_refresh(lc,TRUE,auth_domain,route);
CU_ASSERT_EQUAL(counters->number_of_auth_info_requested,1);
}
static void simple_tcp_register(){
char route[256];
LinphoneCore* lc;
sprintf(route,"sip:%s;transport=tcp",test_domain);
sprintf(route,"sip:%s;transport=tcp",test_route);
lc = create_lc();
register_with_refresh(lc,FALSE,NULL,route);
register_with_refresh(lc,FALSE,test_domain,route);
}
static void simple_tls_register(){
char route[256];
LinphoneCore* lc;
sprintf(route,"sip:%s;transport=tls",test_domain);
sprintf(route,"sip:%s;transport=tls",test_route);
lc = create_lc();
register_with_refresh(lc,FALSE,NULL,route);
register_with_refresh(lc,FALSE,test_domain,route);
}
static void simple_authenticated_register(){
stats* counters;
LinphoneCore* lc = create_lc();
LinphoneAuthInfo *info=linphone_auth_info_new(test_username,NULL,test_password,NULL,auth_domain); /*create authentication structure from identity*/
char route[256];
sprintf(route,"sip:%s",test_route);
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
counters = (stats*)linphone_core_get_user_data(lc);
register_with_refresh(lc,FALSE,auth_domain,NULL);
register_with_refresh(lc,FALSE,auth_domain,route);
CU_ASSERT_EQUAL(counters->number_of_auth_info_requested,0);
}
......@@ -187,6 +193,8 @@ static void authenticated_register_with_no_initial_credentials(){
LinphoneCore* lc;
stats stat;
stats* counters;
char route[256];
sprintf(route,"sip:%s",test_route);
memset (&v_table,0,sizeof(v_table));
v_table.registration_state_changed=registration_state_changed;
v_table.auth_info_requested=auth_info_requested;
......@@ -194,7 +202,7 @@ static void authenticated_register_with_no_initial_credentials(){
linphone_core_set_user_data(lc,&stat);
counters= (stats*)linphone_core_get_user_data(lc);
counters->number_of_auth_info_requested=0;
register_with_refresh(lc,FALSE,auth_domain,NULL);
register_with_refresh(lc,FALSE,auth_domain,route);
CU_ASSERT_EQUAL(counters->number_of_auth_info_requested,1);
}
......@@ -212,13 +220,15 @@ static void authenticated_register_with_late_credentials(){
LinphoneCore* lc;
stats stat;
stats* counters;
char route[256];
sprintf(route,"sip:%s",test_route);
memset (&v_table,0,sizeof(v_table));
v_table.registration_state_changed=registration_state_changed;
v_table.auth_info_requested=auth_info_requested2;
lc = linphone_core_new(&v_table,NULL,NULL,NULL);
linphone_core_set_user_data(lc,&stat);
counters = (stats*)linphone_core_get_user_data(lc);
register_with_refresh_base_2(lc,FALSE,auth_domain,NULL,TRUE);
register_with_refresh_base_2(lc,FALSE,auth_domain,route,TRUE);
CU_ASSERT_EQUAL(counters->number_of_auth_info_requested,1);
linphone_core_destroy(lc);
}
......
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