[ITC][connection][Non-ACR][Fix incorrect test scenario] 27/244427/1
authorJaehyun Kim <jeik01.kim@samsung.com>
Fri, 18 Sep 2020 09:48:13 +0000 (18:48 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Fri, 18 Sep 2020 09:48:13 +0000 (18:48 +0900)
IoT profile usually starts with no default connection.
This is normal and should not be treated as fail.

Change-Id: I4a388ca0029ebbec55c510c70196f58e7adb5e07
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/itc/connection/ITs-connection.c

index 8c301e9de34dc4954ebfa5c6044536c6767df3ea..58b37d78de0c0266ebb8f605ddaaefda881b77a4 100755 (executable)
@@ -96,7 +96,7 @@ bool test_connection_ipv6_address_callback(char *ipv6_address, void *user_data)
 
 void ITs_connection_startup(void)
 {
-       struct stat buf;   
+       struct stat buf;
        if ( stat(ERR_LOG, &buf) == 0 )
        {
                remove(ERR_LOG);
@@ -108,7 +108,7 @@ void ITs_connection_startup(void)
        g_bFeatureSupported = true;
        g_bFeatureMismatch = false;
        g_bFeatureNotSupported = false;
-       
+
        g_bTelFeatureSupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE, API_NAMESPACE);
        g_bWifiFeatureSupported = TCTCheckSystemInfoFeatureSupported(WIFI_FEATURE, API_NAMESPACE);
        g_bBtFeatureSupported = TCTCheckSystemInfoFeatureSupported(TETHERING_BLUETOOTH_FEATURE, API_NAMESPACE);
@@ -125,7 +125,7 @@ void ITs_connection_startup(void)
 
        int nRet = connection_create(&g_hConnection);
 
-       if ( false == g_bTelFeatureSupported && false == g_bWifiFeatureSupported && false == g_bBtFeatureSupported && false == g_bEthernetFeatureSupported) 
+       if ( false == g_bTelFeatureSupported && false == g_bWifiFeatureSupported && false == g_bBtFeatureSupported && false == g_bEthernetFeatureSupported)
        {
                g_bFeatureSupported = false;
                if ( nRet != CONNECTION_ERROR_NOT_SUPPORTED )
@@ -261,7 +261,7 @@ int ITc_connection_create_destroy_p(void)
 int ITc_connection_get_bt_state_p(void)
 {
        START_TEST;
-       
+
        FPRINTF("[Line : %d][%s]Starting test : %s\\n", __LINE__, API_NAMESPACE,__FUNCTION__);
 
        if ( g_nPreconditionError == 1 )
@@ -287,7 +287,7 @@ int ITc_connection_get_bt_state_p(void)
                        FPRINTF("[Line : %d][%s] connection_get_bt_state API call correctly returned %s error for unsupported bluetooth feature\\n", __LINE__, API_NAMESPACE, ConnectionGetError(nRet));
                        return 0;
                }
-               
+
        }
 
        PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_get_bt_state", ConnectionGetError(nRet));
@@ -564,6 +564,12 @@ int ITc_connection_get_current_profile_p(void)
 
        connection_profile_h eFindConnectionProfile = NULL;
        int nRet = connection_get_current_profile(g_hConnection, &eFindConnectionProfile);
+
+       if ( nRet == CONNECTION_ERROR_NO_CONNECTION ) {
+               FPRINTF("[Line : %d][%s] ITc_connection_get_current_profile_p NO_CONNECTION\\n", __LINE__, API_NAMESPACE);
+               return 0;
+       }
+
        PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_get_current_profile", ConnectionGetError(nRet));
        CHECK_HANDLE(eFindConnectionProfile, "connection_get_current_profile");
 
@@ -979,6 +985,7 @@ int ITc_connection_is_metered_network_p(void)
        eGetConnectionType != CONNECTION_TYPE_CELLULAR &&
        eGetConnectionType != CONNECTION_TYPE_ETHERNET &&
        eGetConnectionType != CONNECTION_TYPE_BT &&
+       eGetConnectionType != CONNECTION_TYPE_DISCONNECTED &&
        eGetConnectionType != CONNECTION_TYPE_NET_PROXY)
        {
                FPRINTF("[Line : %d][%s] CONNECTION_ERROR_NOT_SUPPORTED in target device\\n", __LINE__, API_NAMESPACE);
@@ -1023,5 +1030,5 @@ int ITc_connection_set_unset_internet_state_changed_cb_p(void)
 
         return 0;
 }
-/** @} */ 
+/** @} */
 /** @} */