Commit af9e927d authored by Simon Morlat's avatar Simon Morlat

Add default tester_hosts file to redirect everything to fs-test.linphone.org

parent f6ccd36f
......@@ -46,6 +46,10 @@ set(SOURCE_FILES_C
register_tester.h
)
set(OTHER_FILES
tester_hosts
)
add_definitions(
-DBCTBX_LOG_DOMAIN="belle-sip"
)
......@@ -144,3 +148,5 @@ else()
target_link_libraries(belle_sip_parse ${BCTOOLBOX_CORE_LIBRARIES} ${PROJECT_LIBS})
endif()
install(FILES ${OTHER_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/belle_sip_tester")
......@@ -272,8 +272,14 @@ int register_before_all(void) {
belle_sip_listening_point_t *lp;
stack = belle_sip_stack_new(NULL);
const char *client[2] = {NULL, NULL};
if (userhostsfile)
belle_sip_stack_set_dns_user_hosts_file(stack, userhostsfile);
char *default_hosts = NULL;
if (!userhostsfile){
userhostsfile = default_hosts = bc_tester_res("tester_hosts");
}
belle_sip_stack_set_dns_user_hosts_file(stack, userhostsfile);
if (default_hosts) bc_free(default_hosts);
lp = belle_sip_stack_create_listening_point(stack, "0.0.0.0", 7060, "UDP");
prov = belle_sip_stack_create_provider(stack, lp);
......
......@@ -89,7 +89,7 @@ static void log_handler(int lev, const char *fmt, va_list args) {
void belle_sip_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list args)) {
if (ftester_printf == NULL) ftester_printf = log_handler;
bc_tester_init(ftester_printf, BELLE_SIP_LOG_MESSAGE, BELLE_SIP_LOG_ERROR, NULL);
bc_tester_init(ftester_printf, BELLE_SIP_LOG_MESSAGE, BELLE_SIP_LOG_ERROR, "tester_hosts");
belle_sip_init_sockets();
belle_sip_object_enable_marshal_check(TRUE);
ipv6_available=_belle_sip_tester_ipv6_available();
......@@ -196,7 +196,8 @@ int main (int argc, char *argv[]) {
int ret;
const char *root_ca_path = NULL;
const char *env_domain=getenv("TEST_DOMAIN");
char *default_hosts = NULL;
belle_sip_tester_init(NULL);
#ifndef _WIN32 /*this hack doesn't work for argv[0]="c:\blablab\"*/
......@@ -256,6 +257,7 @@ int main (int argc, char *argv[]) {
ret = bc_tester_start(argv[0]);
belle_sip_tester_uninit();
bctbx_uninit_logger();
if (default_hosts) bc_free(default_hosts);
return ret;
}
......
54.37.202.228 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org sipv4.example.org
2001:41d0:700:789::2010 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org
188.165.46.90 tunnel.wildcard2.linphone.org
64:ff9b::54.37.202.228 sipv4-nat64.example.org
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