[ITC][connection][ACR-1040][Added new TCs as per ACR]
authormanmohan kumar <manmohan.k@samsung.com>
Thu, 24 Aug 2017 08:40:07 +0000 (14:10 +0530)
committerJihun Park <jihun87.park@samsung.com>
Thu, 24 Aug 2017 22:00:19 +0000 (22:00 +0000)
Change-Id: I350bdd260ebaf10170dc96073563a245b638665f
Signed-off-by: manmohan kumar <manmohan.k@samsung.com>
src/itc/connection/ITs-connection-profile.c
src/itc/connection/tct-connection-native_mobile.h
src/itc/connection/tct-connection-native_wearable.h

index ddbf7b48147411434d6c635e02972efe0e176486..2ad128d95462e2cfda8c3b7c7c36c435a8b86a70 100755 (executable)
@@ -99,7 +99,7 @@ void test_connection_reset_profile_callback_cb(connection_error_e result, void *
 
 void ITs_connection_profile_startup(void)
 {
-       struct stat buf;   
+       struct stat buf;
        if ( stat(ERR_LOG, &buf) == 0 )
        {
                remove(ERR_LOG);
@@ -151,7 +151,7 @@ void ITs_connection_profile_startup(void)
                g_hConenctionHandle = NULL;
                return;
        }
-       
+
        nRet = connection_get_cellular_state(g_hConenctionHandle, &eState);
     if ( nRet != CONNECTION_ERROR_NONE && nRet != CONNECTION_ERROR_NOT_SUPPORTED)
        {
@@ -165,7 +165,7 @@ void ITs_connection_profile_startup(void)
                g_bFeatureNotSupported = true;
                return;
        }
-       
+
        if ( ConnectionManager_get_celluar_profile(g_hConenctionHandle, &g_hConnectionProfileHandleCellular) == 0 )
        {
                if ( false == bTelFeatureSupported )
@@ -191,7 +191,7 @@ void ITs_connection_profile_startup(void)
        }
 
        if ( ConnectionManager_get_MMS_type(g_hConenctionHandle, &g_hConnectionProfileHandleMMS) == 0 )
-       {       
+       {
                if ( false == bTelFeatureSupported )
                {
                        if ( g_hConnectionProfileHandleMMS == NULL )
@@ -250,7 +250,7 @@ void ITs_connection_profile_cleanup(void)
 
                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));
@@ -717,7 +717,7 @@ int ITc_connection_profile_set_get_gateway_p(void)
 * @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
@@ -1466,7 +1466,7 @@ int ITc_connection_add_remove_profile_p(void)
 * @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
@@ -1488,14 +1488,14 @@ int ITc_connection_profile_get_dhcp_server_address_p(void)
        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;
        }
 
@@ -1504,4 +1504,35 @@ int ITc_connection_profile_get_dhcp_server_address_p(void)
        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;
+}
 
index 7c25bdbd8bdf20b6c802b1aa41177c5bc695eb92..8bffea112ded65dcf66820826cc218fe1d74d5b7 100755 (executable)
@@ -99,6 +99,7 @@ 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);
 
 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},
@@ -170,6 +171,7 @@ testcase tc_array[] = {
     {"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}
 };
 
index 7c25bdbd8bdf20b6c802b1aa41177c5bc695eb92..8bffea112ded65dcf66820826cc218fe1d74d5b7 100755 (executable)
@@ -99,6 +99,7 @@ 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);
 
 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},
@@ -170,6 +171,7 @@ testcase tc_array[] = {
     {"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}
 };