void ITs_connection_profile_startup(void)
{
- struct stat buf;
+ struct stat buf;
if ( stat(ERR_LOG, &buf) == 0 )
{
remove(ERR_LOG);
g_hConenctionHandle = NULL;
return;
}
-
+
nRet = connection_get_cellular_state(g_hConenctionHandle, &eState);
if ( nRet != CONNECTION_ERROR_NONE && nRet != CONNECTION_ERROR_NOT_SUPPORTED)
{
g_bFeatureNotSupported = true;
return;
}
-
+
if ( ConnectionManager_get_celluar_profile(g_hConenctionHandle, &g_hConnectionProfileHandleCellular) == 0 )
{
if ( false == bTelFeatureSupported )
}
if ( ConnectionManager_get_MMS_type(g_hConenctionHandle, &g_hConnectionProfileHandleMMS) == 0 )
- {
+ {
if ( false == bTelFeatureSupported )
{
if ( g_hConnectionProfileHandleMMS == NULL )
if ( g_hConnectionProfileHandleMMS != NULL )
{
- nRet = connection_profile_destroy(g_hConnectionProfileHandleMMS);
+ nRet = connection_profile_destroy(g_hConnectionProfileHandleMMS);
if ( nRet != CONNECTION_ERROR_NONE )
{
FPRINTF("[Line: %d][%s] connection_profile_destroy failed on post condition error returned = %s\\n", __LINE__, API_NAMESPACE, ConnectionGetError(nRet));
* @author SRID(sameer.g1)
* @reviewer SRID(gupta.sanjay)
* @type auto
-* @description To check set/get IP address
+* @description To check set/get IP address
* @scenario Call API to set ip address\n
* Call API to get ip address
* @apicovered connection_profile_set_ip_address, connection_profile_get_ip_address
* @author SRID(mandadi.mr)
* @reviewer SRID(nibha.sharma)
* @type auto
-* @description To check get DHCP address
+* @description To check get DHCP address
* @scenario Call API to get DHCP address
* @apicovered connection_profile_get_dhcp_address
* @passcase When APIs return CONNECTION_ERROR_NONE
char* pszFindDHCPAddress = NULL;
connection_address_family_e e_address_family;
e_address_family = CONNECTION_ADDRESS_FAMILY_IPV4;
-
+
nRet = connection_profile_get_dhcp_server_address(g_hConnectionProfileHandleCellular, e_address_family, &pszFindDHCPAddress);
-
+
if ( nRet != CONNECTION_ERROR_NONE )
{
FREE_MEMORY(pszFindDHCPAddress);
FPRINTF("[Line : %d][%s] connection_profile_get_dhcp_server_address failed for address family = %s, error returned = %s\\n", __LINE__, API_NAMESPACE, ConnectionGetAddressFamily(e_address_family), ConnectionGetError(nRet));
-
+
return 1;
}
return 0;
}
+//& purpose: Gets the DHCP lease duration
+//& type : auto
+/**
+* @testcase ITc_connection_profile_get_dhcp_lease_duration_p
+* @since_tizen 4.0
+* @author SRID(manmohan.k)
+* @reviewer SRID(shobhit.v)
+* @type auto
+* @description To Gets the DHCP lease duration
+* @scenario Call API to get the DHCP lease duration
+* @apicovered connection_profile_get_dhcp_lease_duration
+* @passcase When APIs return CONNECTION_ERROR_NONE
+* @failcase When APIs not return CONNECTION_ERROR_NONE
+* @precondition None
+* @postcondition None
+*/
+int ITc_connection_profile_get_dhcp_lease_duration_p(void)
+{
+ START_TEST;
+
+ int dhcp_lease_duration = 0;
+ int nRet = connection_profile_get_dhcp_lease_duration(g_hConnectionProfileHandleCellular, CONNECTION_ADDRESS_FAMILY_IPV4, &dhcp_lease_duration);
+ PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_profile_get_dhcp_lease_duration", ConnectionGetError(nRet));
+ FPRINTF("[Line : %d][%s] connection_profile_get_dhcp_lease_duration return value=%d\\n", __LINE__, API_NAMESPACE, dhcp_lease_duration);
+
+ nRet = connection_profile_get_dhcp_lease_duration(g_hConnectionProfileHandleMMS, CONNECTION_ADDRESS_FAMILY_IPV4, &dhcp_lease_duration);
+ PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_profile_get_dhcp_lease_duration", ConnectionGetError(nRet));
+ FPRINTF("[Line : %d][%s] connection_profile_get_dhcp_lease_duration return value=%d\\n", __LINE__, API_NAMESPACE, dhcp_lease_duration);
+
+ return 0;
+}
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);
testcase tc_array[] = {
{"ITc_connection_profile_get_dhcp_server_address_p",ITc_connection_profile_get_dhcp_server_address_p,ITs_connection_profile_startup, ITs_connection_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},
{NULL, NULL}
};
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);
testcase tc_array[] = {
{"ITc_connection_profile_get_dhcp_server_address_p",ITc_connection_profile_get_dhcp_server_address_p,ITs_connection_profile_startup, ITs_connection_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},
{NULL, NULL}
};