return 0;
}
-//& purpose: To check add/remove a route in routing table
-//& type : auto
-/**
-* @testcase ITc_connection_add_remove_route_p
-* @since_tizen 2.3
-* @author SRID(sameer.g1)
-* @reviewer SRID(gupta.sanjay)
-* @type auto
-* @description To check add/remove a route in routing table
-* @scenario get current profile and get interface name
-* Call API to add a route in route table
-* Call API to remove a route from route table
-* @apicovered connection_add_route, connection_remove_route
-* @passcase When APIs return CONNECTION_ERROR_NONE
-* @failcase When APIs not return CONNECTION_ERROR_NONE
-* @precondition Cellular data connection must be exist in the testing device
-* @postcondition None
-*/
-int ITc_connection_add_remove_route_p(void)
-{
- START_TEST;
-
- if ( g_nPreconditionError == 1 )
- {
- FPRINTF("[Line : %d][%s] ITc_connection_add_remove_route_p failed on precondition\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- connection_profile_h eCurrentConnectionProfile;
-
- char *psz_Interface_name = NULL;
- char *psz_Host_address = "198.126.98.128"; // testing host address
-
- int nRet = connection_get_current_profile(g_hConnection, &eCurrentConnectionProfile);
- PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_get_current_profile", ConnectionGetError(nRet));
- CHECK_HANDLE(eCurrentConnectionProfile, "connection_get_current_profile");
-
- nRet = connection_profile_get_network_interface_name(eCurrentConnectionProfile, &psz_Interface_name);
- PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_profile_get_network_interface_name", ConnectionGetError(nRet));
- if ( psz_Interface_name == NULL )
- {
- FPRINTF("[Line : %d][%s] connection_profile_get_network_interface_name failed on get interface name\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = connection_add_route(g_hConnection, psz_Interface_name, psz_Host_address);
- PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_add_route", ConnectionGetError(nRet));
-
- nRet = connection_remove_route(g_hConnection,psz_Interface_name, psz_Host_address);
- PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_remove_route", ConnectionGetError(nRet));
-
- FREE_MEMORY(psz_Interface_name);
- psz_Host_address = NULL;
-
- return 0;
-}
-
-
-//Shilpa - Added ITc_connection_add_remove_IPv6_route_p
-
-//& purpose: To check add/remove a IPv6 route in routing table
-//& type : auto
-/**
-* @testcase ITc_connection_add_remove_IPv6_route_p
-* @since_tizen 2.3.1
-* @author SRID(shilpa.j)
-* @reviewer SRID(gupta.sanjay)
-* @type auto
-* @description To check add/remove a IPv6 route in routing table
-* @scenario Get current profile and get interface name
-* Call api to add a route in route table
-* Call api to remove a route from route table
-* @apicovered connection_add_route_ipv6, connection_remove_route_ipv6
-* @passcase When APIs return CONNECTION_ERROR_NONE
-* @failcase When APIs not return CONNECTION_ERROR_NONE
-* @precondition Cellular data connection must be exist in the testing device
-* @postcondition None
-*/
-
-int ITc_connection_add_remove_IPv6_route_p(void)
-{
- START_TEST;
-
- if (g_nPreconditionError == 1)
- {
- FPRINTF("[Line: %d][%s] ITc_connection_add_remove_IPv6_route_p failed on precondition\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- int nRetVal = -1;
- connection_profile_h eCurrentConnectionProfile;
-
- char *psz_Interface_name = NULL;
- char *psz_Host_address = "2002:0:0:0:0:0:c67e:6280"; // testing host address
- char *psz_gateway = "fe90::1"; // default gateway
-
- nRetVal = connection_get_current_profile(g_hConnection, &eCurrentConnectionProfile);
- PRINT_RESULT(CONNECTION_ERROR_NONE, nRetVal, "connection_get_current_profile", ConnectionGetError(nRetVal));
- CHECK_HANDLE(eCurrentConnectionProfile, "connection_get_current_profile");
-
- nRetVal = connection_profile_get_network_interface_name(eCurrentConnectionProfile, &psz_Interface_name);
- PRINT_RESULT_CLEANUP(CONNECTION_ERROR_NONE, nRetVal, "connection_profile_get_network_interface_name", ConnectionGetError(nRetVal),FREE_MEMORY(psz_Interface_name));
- if ( psz_Interface_name == NULL )
- {
- FPRINTF("[Line: %d][%s] connection_profile_get_network_interface_name failed on get interface name\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRetVal = connection_add_route_ipv6(g_hConnection, psz_Interface_name, psz_Host_address, psz_gateway);
- PRINT_RESULT_CLEANUP(CONNECTION_ERROR_NONE, nRetVal, " connection_add_route_ipv6", ConnectionGetError(nRetVal),FREE_MEMORY(psz_Interface_name));
-
- nRetVal = connection_remove_route_ipv6(g_hConnection,psz_Interface_name, psz_Host_address, psz_gateway);
- PRINT_RESULT_CLEANUP(CONNECTION_ERROR_NONE, nRetVal, " connection_remove_route_ipv6", ConnectionGetError(nRetVal),FREE_MEMORY(psz_Interface_name));
-
- FREE_MEMORY(psz_Interface_name);
-
- psz_Host_address = NULL;// assigning NULL
- psz_gateway = NULL;// assigning NULL
-
- return 0;
-}
-
-
//& purpose: To check state of Bluetooth
//& type : auto
/**
return 0;
}
-//& purpose: To check add/remove
-// 1) Adds a route to the routing table.
-// 2) Removes a route from the routing table.
-//& type : auto
-/**
-* @testcase ITc_connection_add_remove_route_entry_p
-* @since_tizen 4.0
-* @author SRID(j.abhishek)
-* @reviewer SRID(shobhit.v)
-* @type auto
-* @description connection_add_route_entry should fail with invalid parameter.
- Invoking connection_remove_route_entry with valid parameter.
-* @scenario
-* Invoking connection_add_route_entry with valid parameter.
-* Invoking connection_remove_route_entry with valid parameter.
-* @apicovered connection_add_route_entry, connection_remove_route_entry
-* @passcase When APIs return CONNECTION_ERROR_NONE
-* @failcase When APIs not return CONNECTION_ERROR_NONE
-* @precondition Cellular data connection must be exist in the testing device
-* @postcondition None
-*/
-
-int ITc_connection_add_remove_route_entry_p(void)
-{
- START_TEST;
-
- if (g_nPreconditionError == 1)
- {
- FPRINTF("[Line: %d][%s] ITc_connection_add_remove_route_entry_p failed on precondition\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
-
- connection_address_family_e eConnectionAddressFamily = -1;
- connection_profile_h eCurrentConnectionProfile;
-
- int nRet = -1, nEnumLoopCount = 0;
-
- char *psz_Interface_name = NULL;
- char *psz_Host_address = "2001:db8:1:0::1"; // testing host address
- char *psz_gateway = "fe80::"; // default gateway
-
- int arrConnectionAddressFamilyValues[] = {
- CONNECTION_ADDRESS_FAMILY_IPV6, /**< IPV6 Address type */
- //CONNECTION_ADDRESS_FAMILY_IPV4 /**< IPV4 Address type */
- };
-
- int nConnectionFamilyCount = sizeof(arrConnectionAddressFamilyValues) / sizeof(arrConnectionAddressFamilyValues[0]);
-
- for ( nEnumLoopCount = 0; nEnumLoopCount < nConnectionFamilyCount; nEnumLoopCount++ )
- {
-
- eConnectionAddressFamily = arrConnectionAddressFamilyValues[nEnumLoopCount]; //Currently the code is applied only on IPV6
-
- nRet = connection_get_current_profile(g_hConnection, &eCurrentConnectionProfile);
-
- PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_get_current_profile", ConnectionGetError(nRet));
- CHECK_HANDLE(eCurrentConnectionProfile, "connection_get_current_profile");
-
- nRet = connection_profile_get_network_interface_name(eCurrentConnectionProfile, &psz_Interface_name);
- PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_profile_get_network_interface_name", ConnectionGetError(nRet));
-
- if ( psz_Interface_name == NULL )
- {
- FPRINTF("[Line : %d][%s] connection_profile_get_network_interface_name failed on get interface name\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = connection_add_route_entry(g_hConnection, eConnectionAddressFamily, psz_Interface_name, psz_Host_address, psz_gateway);
- PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_add_route_entry", ConnectionGetError(nRet));
-
- nRet = connection_remove_route_entry(g_hConnection, eConnectionAddressFamily, psz_Interface_name, psz_Host_address, psz_gateway);
- PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_remove_route_entry", ConnectionGetError(nRet));
-
- FREE_MEMORY(psz_Interface_name);
- psz_Host_address = NULL;
- }
-
- return 0;
-}
-
//& purpose: To check whether network state is connected
// also if the connection type is cellular
//& type : auto
extern int ITc_connection_reset_profile_p(void);
extern int ITc_connection_add_remove_profile_p(void);
extern int ITc_connection_create_destroy_p(void);
-extern int ITc_connection_add_remove_route_p(void);
-extern int ITc_connection_add_remove_IPv6_route_p(void);
extern int ITc_connection_get_bt_state_p(void);
extern int ITc_connection_get_type_p(void);
extern int ITc_connection_get_proxy_p(void);
extern int ITc_connection_profile_get_ipv6_state_p(void);
extern int ITc_connection_profile_set_get_prefix_length_p(void);
extern int ITc_connection_profile_set_get_dns_config_type_p(void);
-extern int ITc_connection_add_remove_route_entry_p(void);
extern int ITc_connection_profile_get_dhcp_server_address_p(void);
extern int ITc_connection_profile_get_dhcp_lease_duration_p(void);
extern int ITc_connection_is_metered_network_p(void);
{"ITc_connection_reset_profile_p", ITc_connection_reset_profile_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_add_remove_profile_p", ITc_connection_add_remove_profile_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_create_destroy_p", ITc_connection_create_destroy_p, ITs_connection_startup, ITs_connection_cleanup},
- {"ITc_connection_add_remove_route_p", ITc_connection_add_remove_route_p, ITs_connection_startup, ITs_connection_cleanup},
- {"ITc_connection_add_remove_IPv6_route_p", ITc_connection_add_remove_IPv6_route_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_get_bt_state_p", ITc_connection_get_bt_state_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_get_type_p", ITc_connection_get_type_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_get_proxy_p", ITc_connection_get_proxy_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_profile_get_ipv6_state_p", ITc_connection_profile_get_ipv6_state_p, ITs_connection_wifi_profile_startup, ITs_connection_wifi_profile_cleanup},
{"ITc_connection_profile_set_get_prefix_length_p", ITc_connection_profile_set_get_prefix_length_p, ITs_connection_wifi_profile_startup, ITs_connection_wifi_profile_cleanup},
{"ITc_connection_profile_set_get_dns_config_type_p", ITc_connection_profile_set_get_dns_config_type_p, ITs_connection_wifi_profile_startup, ITs_connection_wifi_profile_cleanup},
- {"ITc_connection_add_remove_route_entry_p",ITc_connection_add_remove_route_entry_p,ITs_connection_startup,ITs_connection_cleanup},
{"ITc_connection_profile_get_dhcp_lease_duration_p", ITc_connection_profile_get_dhcp_lease_duration_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_set_unset_internet_state_changed_cb_p", ITc_connection_set_unset_internet_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
extern int ITc_connection_reset_profile_p(void);
extern int ITc_connection_add_remove_profile_p(void);
extern int ITc_connection_create_destroy_p(void);
-extern int ITc_connection_add_remove_route_p(void);
-extern int ITc_connection_add_remove_IPv6_route_p(void);
extern int ITc_connection_get_bt_state_p(void);
extern int ITc_connection_get_type_p(void);
extern int ITc_connection_get_proxy_p(void);
extern int ITc_connection_profile_get_ipv6_state_p(void);
extern int ITc_connection_profile_set_get_prefix_length_p(void);
extern int ITc_connection_profile_set_get_dns_config_type_p(void);
-extern int ITc_connection_add_remove_route_entry_p(void);
extern int ITc_connection_profile_get_dhcp_server_address_p(void);
extern int ITc_connection_profile_get_dhcp_lease_duration_p(void);
extern int ITc_connection_is_metered_network_p(void);
{"ITc_connection_reset_profile_p", ITc_connection_reset_profile_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_add_remove_profile_p", ITc_connection_add_remove_profile_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_create_destroy_p", ITc_connection_create_destroy_p, ITs_connection_startup, ITs_connection_cleanup},
- {"ITc_connection_add_remove_route_p", ITc_connection_add_remove_route_p, ITs_connection_startup, ITs_connection_cleanup},
- {"ITc_connection_add_remove_IPv6_route_p", ITc_connection_add_remove_IPv6_route_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_get_bt_state_p", ITc_connection_get_bt_state_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_get_type_p", ITc_connection_get_type_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_get_proxy_p", ITc_connection_get_proxy_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_profile_get_ipv6_state_p", ITc_connection_profile_get_ipv6_state_p, ITs_connection_wifi_profile_startup, ITs_connection_wifi_profile_cleanup},
{"ITc_connection_profile_set_get_prefix_length_p", ITc_connection_profile_set_get_prefix_length_p, ITs_connection_wifi_profile_startup, ITs_connection_wifi_profile_cleanup},
{"ITc_connection_profile_set_get_dns_config_type_p", ITc_connection_profile_set_get_dns_config_type_p, ITs_connection_wifi_profile_startup, ITs_connection_wifi_profile_cleanup},
- {"ITc_connection_add_remove_route_entry_p",ITc_connection_add_remove_route_entry_p,ITs_connection_startup,ITs_connection_cleanup},
{"ITc_connection_profile_get_dhcp_lease_duration_p", ITc_connection_profile_get_dhcp_lease_duration_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_set_unset_internet_state_changed_cb_p", ITc_connection_set_unset_internet_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
extern int ITc_connection_reset_profile_p(void);
extern int ITc_connection_add_remove_profile_p(void);
extern int ITc_connection_create_destroy_p(void);
-extern int ITc_connection_add_remove_route_p(void);
-extern int ITc_connection_add_remove_IPv6_route_p(void);
extern int ITc_connection_get_bt_state_p(void);
extern int ITc_connection_get_type_p(void);
extern int ITc_connection_get_proxy_p(void);
extern int ITc_connection_profile_get_ipv6_state_p(void);
extern int ITc_connection_profile_set_get_prefix_length_p(void);
extern int ITc_connection_profile_set_get_dns_config_type_p(void);
-extern int ITc_connection_add_remove_route_entry_p(void);
extern int ITc_connection_profile_get_dhcp_server_address_p(void);
extern int ITc_connection_profile_get_dhcp_lease_duration_p(void);
extern int ITc_connection_is_metered_network_p(void);
{"ITc_connection_reset_profile_p", ITc_connection_reset_profile_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_add_remove_profile_p", ITc_connection_add_remove_profile_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_create_destroy_p", ITc_connection_create_destroy_p, ITs_connection_startup, ITs_connection_cleanup},
- {"ITc_connection_add_remove_route_p", ITc_connection_add_remove_route_p, ITs_connection_startup, ITs_connection_cleanup},
- {"ITc_connection_add_remove_IPv6_route_p", ITc_connection_add_remove_IPv6_route_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_get_bt_state_p", ITc_connection_get_bt_state_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_get_type_p", ITc_connection_get_type_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_get_proxy_p", ITc_connection_get_proxy_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_profile_get_ipv6_state_p", ITc_connection_profile_get_ipv6_state_p, ITs_connection_wifi_profile_startup, ITs_connection_wifi_profile_cleanup},
{"ITc_connection_profile_set_get_prefix_length_p", ITc_connection_profile_set_get_prefix_length_p, ITs_connection_wifi_profile_startup, ITs_connection_wifi_profile_cleanup},
{"ITc_connection_profile_set_get_dns_config_type_p", ITc_connection_profile_set_get_dns_config_type_p, ITs_connection_wifi_profile_startup, ITs_connection_wifi_profile_cleanup},
- {"ITc_connection_add_remove_route_entry_p",ITc_connection_add_remove_route_entry_p,ITs_connection_startup,ITs_connection_cleanup},
{"ITc_connection_profile_get_dhcp_lease_duration_p", ITc_connection_profile_get_dhcp_lease_duration_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
{"ITc_connection_set_unset_internet_state_changed_cb_p", ITc_connection_set_unset_internet_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},