From: cheoleun moon Date: Mon, 11 Jul 2022 07:56:34 +0000 (+0900) Subject: [UTC][connection][ACR-1705][Check network.route feature] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03136de69a09d4996f93c10c521061e01117db3c;p=test%2Ftct%2Fnative%2Fapi.git [UTC][connection][ACR-1705][Check network.route feature] Change-Id: Ifdf24e8f97f753684490c401c2b30c9c4b034f4f --- diff --git a/src/utc/connection/utc-connection-common.h b/src/utc/connection/utc-connection-common.h index 7e85bd387..9665db405 100755 --- a/src/utc/connection/utc-connection-common.h +++ b/src/utc/connection/utc-connection-common.h @@ -35,6 +35,7 @@ #define FEATURE_ETHERNET "http://tizen.org/feature/network.ethernet" #define FEATURE_TELEPHONY "http://tizen.org/feature/network.telephony" #define FEATURE_BT_TETHERING "http://tizen.org/feature/network.tethering.bluetooth" +#define FEATURE_ROUTE "http://tizen.org/feature/network.route" #define CALLBACK_RETURN "callback return" GMainLoop *g_pMainLoop; @@ -45,6 +46,7 @@ bool wifi_supported; bool telephony_supported; bool bt_tethering_supported; bool ethernet_supported; +bool route_supported; bool all_features_not_supported; connection_profile_h profile_cellular; diff --git a/src/utc/connection/utc-network-connection.c b/src/utc/connection/utc-network-connection.c index 225772b38..45e4cbabe 100755 --- a/src/utc/connection/utc-network-connection.c +++ b/src/utc/connection/utc-network-connection.c @@ -124,9 +124,11 @@ void utc_network_connection_startup(void) telephony_supported = connection_check_feature_supported(FEATURE_TELEPHONY); bt_tethering_supported = connection_check_feature_supported(FEATURE_BT_TETHERING); ethernet_supported = connection_check_feature_supported(FEATURE_ETHERNET); + route_supported = connection_check_feature_supported(FEATURE_ROUTE); if (telephony_supported == false && wifi_supported == false - && bt_tethering_supported == false && ethernet_supported == false) { + && bt_tethering_supported == false && ethernet_supported == false + && route_supported == false) { all_features_not_supported = true; FPRINTF("[%s:%d] all feature is not supported\\n", __FILE__, __LINE__); return ; @@ -1501,7 +1503,7 @@ int utc_connection_add_route_n1(void) { int ret; - if (all_features_not_supported) { + if (!route_supported || all_features_not_supported) { ret = connection_add_route(connection, NULL, NULL); CHECK_RETURN("connection_add_route", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1534,7 +1536,7 @@ int utc_connection_add_route_n2(void) int ret; char* interface_name = NULL; - if (all_features_not_supported) { + if (!route_supported || all_features_not_supported) { ret = connection_add_route(connection, interface_name, "192.168.129.3"); CHECK_RETURN("connection_add_route", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1564,7 +1566,7 @@ int utc_connection_remove_route_n1(void) { int ret; - if (all_features_not_supported) { + if (!route_supported || all_features_not_supported) { ret = connection_remove_route(NULL, NULL, NULL); CHECK_RETURN("connection_remove_route", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1597,7 +1599,7 @@ int utc_connection_remove_route_n2(void) int ret; char* interface_name = NULL; - if (all_features_not_supported) { + if (!route_supported || all_features_not_supported) { ret = connection_remove_route(connection, interface_name, "192.168.129.3"); CHECK_RETURN("connection_remove_route", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1627,7 +1629,7 @@ int utc_connection_add_route_ipv6_n1(void) { int ret; - if (telephony_supported == false && wifi_supported == false && ethernet_supported == false) { + if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) { ret = connection_add_route_ipv6(NULL, NULL, NULL, NULL); CHECK_RETURN("connection_add_route_ipv6", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1657,7 +1659,7 @@ int utc_connection_add_route_ipv6_n2(void) int ret; char* interface_name = NULL; - if (telephony_supported == false && wifi_supported == false && ethernet_supported == false) { + if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) { ret = connection_add_route_ipv6(connection, interface_name, "2001:db8:1:0::1", "fe80::"); CHECK_RETURN("connection_add_route_ipv6", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1686,7 +1688,7 @@ int utc_connection_remove_route_ipv6_n1(void) { int ret; - if (all_features_not_supported) { + if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) { ret = connection_remove_route_ipv6(NULL, NULL, NULL, NULL); CHECK_RETURN("connection_remove_route_ipv6", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1716,7 +1718,7 @@ int utc_connection_remove_route_ipv6_n2(void) int ret; char* interface_name = NULL; - if (telephony_supported == false && wifi_supported == false && ethernet_supported == false) { + if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) { ret = connection_remove_route_ipv6(connection, interface_name, "2001:db8:1:0::1", "fe80::"); FREE_RESOURCE(interface_name); CHECK_RETURN("connection_remove_route_ipv6", ret, CONNECTION_ERROR_NOT_SUPPORTED); @@ -1746,7 +1748,7 @@ int utc_connection_add_route_entry_n1(void) { int ret; - if (telephony_supported == false && wifi_supported == false && ethernet_supported == false) { + if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) { ret = connection_add_route_entry(NULL, -1, NULL, NULL, NULL); CHECK_RETURN("connection_add_route_entry", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1776,7 +1778,7 @@ int utc_connection_add_route_entry_n2(void) int ret; char* interface_name = NULL; - if (telephony_supported == false && wifi_supported == false && ethernet_supported == false) { + if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) { ret = connection_add_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV6, interface_name, "2001:db8:1:0::1", "fe80::"); CHECK_RETURN("connection_add_route_entry", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1805,7 +1807,7 @@ int utc_connection_remove_route_entry_n1(void) { int ret; - if (all_features_not_supported) { + if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) { ret = connection_remove_route_entry(NULL, -1, NULL, NULL, NULL); CHECK_RETURN("connection_remove_route_entry", ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; @@ -1835,7 +1837,7 @@ int utc_connection_remove_route_entry_n2(void) int ret; char* interface_name = NULL; - if (telephony_supported == false && wifi_supported == false && ethernet_supported == false) { + if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) { ret = connection_remove_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV6, interface_name, "2001:db8:1:0::1", "fe80::"); FREE_RESOURCE(interface_name); CHECK_RETURN("connection_remove_route_entry", ret, CONNECTION_ERROR_NOT_SUPPORTED);