From: Yu Date: Tue, 23 Apr 2019 01:38:15 +0000 (+0900) Subject: [ITC][capi-network-inm][Non-ACR][Check state of IP v6 because IP v6 is not mantatory... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92b81174b9a666162f4289b0a8b5d04260fa0bdd;p=test%2Ftct%2Fnative%2Fapi.git [ITC][capi-network-inm][Non-ACR][Check state of IP v6 because IP v6 is not mantatory for some APs] Change-Id: I03687f12b28f0cc16c1d26e299937e5c54daa2e2 Signed-off-by: Yu Jiung --- diff --git a/src/itc/capi-network-inm/ITs-capi-network-inm.c b/src/itc/capi-network-inm/ITs-capi-network-inm.c index 73df7c224..363c7203f 100755 --- a/src/itc/capi-network-inm/ITs-capi-network-inm.c +++ b/src/itc/capi-network-inm/ITs-capi-network-inm.c @@ -1449,6 +1449,7 @@ int ITc_inm_connection_get_ip_address_p(void) { START_TEST; + inm_connection_state_e eConnectionState; char *pszIpAddr = NULL; int nRet = INM_ERROR_NONE; inm_connection_h hProfile = NULL; @@ -1465,10 +1466,14 @@ int ITc_inm_connection_get_ip_address_p(void) CHECK_HANDLE_CLEANUP(pszIpAddr, "inm_connection_get_ip_address", inm_connection_destroy(&hProfile)); FREE_MEMORY_TC(pszIpAddr); - nRet = inm_connection_get_ip_address(hProfile, INM_ADDRESS_FAMILY_IPV6, &pszIpAddr); - PRINT_RESULT_CLEANUP(nRet, INM_ERROR_NONE, "inm_connection_get_ip_address", InmGetError(nRet),inm_connection_destroy(&hProfile)); - CHECK_HANDLE_CLEANUP(pszIpAddr, "inm_connection_get_ip_address", inm_connection_destroy(&hProfile)); - FREE_MEMORY_TC(pszIpAddr); + nRet = inm_connection_get_ipv6_state(hProfile, &eConnectionState); + PRINT_RESULT_CLEANUP(nRet, INM_ERROR_NONE, "inm_connection_get_ipv6_state", InmGetError(nRet), inm_connection_destroy(&hProfile)); + if (eConnectionState == INM_CONNECTION_STATE_CONNECTED) { + nRet = inm_connection_get_ip_address(hProfile, INM_ADDRESS_FAMILY_IPV6, &pszIpAddr); + PRINT_RESULT_CLEANUP(nRet, INM_ERROR_NONE, "inm_connection_get_ip_address", InmGetError(nRet),inm_connection_destroy(&hProfile)); + CHECK_HANDLE_CLEANUP(pszIpAddr, "inm_connection_get_ip_address", inm_connection_destroy(&hProfile)); + FREE_MEMORY_TC(pszIpAddr); + } nRet = inm_connection_destroy(&hProfile); PRINT_RESULT_NORETURN(nRet, INM_ERROR_NONE, "inm_connection_destroy", InmGetError(nRet)); @@ -1538,6 +1543,7 @@ int ITc_inm_connection_get_gateway_address_p(void) { START_TEST; + inm_connection_state_e eConnectionState; char *pszIpAddr = NULL; int nRet = INM_ERROR_NONE; inm_connection_h hProfile = NULL; @@ -1553,11 +1559,14 @@ int ITc_inm_connection_get_gateway_address_p(void) PRINT_RESULT_CLEANUP(nRet, INM_ERROR_NONE, "inm_connection_get_gateway_address", InmGetError(nRet), inm_connection_destroy(&hProfile)); CHECK_HANDLE_CLEANUP(pszIpAddr, "inm_connection_get_gateway_address", inm_connection_destroy(&hProfile)); FREE_MEMORY_TC(pszIpAddr); - - nRet = inm_connection_get_gateway_address(hProfile, INM_ADDRESS_FAMILY_IPV6, &pszIpAddr); - PRINT_RESULT_CLEANUP(nRet, INM_ERROR_NONE, "inm_connection_get_gateway_address", InmGetError(nRet), inm_connection_destroy(&hProfile)); - CHECK_HANDLE_CLEANUP(pszIpAddr, "inm_connection_get_gateway_address", inm_connection_destroy(&hProfile)); - FREE_MEMORY_TC(pszIpAddr); + nRet = inm_connection_get_ipv6_state(hProfile, &eConnectionState); + PRINT_RESULT_CLEANUP(nRet, INM_ERROR_NONE, "inm_connection_get_ipv6_state", InmGetError(nRet), inm_connection_destroy(&hProfile)); + if (eConnectionState == INM_CONNECTION_STATE_CONNECTED) { + nRet = inm_connection_get_gateway_address(hProfile, INM_ADDRESS_FAMILY_IPV6, &pszIpAddr); + PRINT_RESULT_CLEANUP(nRet, INM_ERROR_NONE, "inm_connection_get_gateway_address", InmGetError(nRet), inm_connection_destroy(&hProfile)); + CHECK_HANDLE_CLEANUP(pszIpAddr, "inm_connection_get_gateway_address", inm_connection_destroy(&hProfile)); + FREE_MEMORY_TC(pszIpAddr); + } nRet = inm_connection_destroy(&hProfile); PRINT_RESULT_NORETURN(nRet, INM_ERROR_NONE, "inm_connection_destroy", InmGetError(nRet));