2 // Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #include "utc-connection-common.h"
19 static void test_network_state_changed_cb(connection_type_e state, void* user_data)
21 PRINT_RETURN("test_network_state_changed_cb", CONNECTION_ERROR_NONE);
24 static void test_ip_address_changed_cb(const char* ipv4_address, const char* ipv6_address, void* user_data)
26 PRINT_RETURN("test_ip_address_changed_cb", CONNECTION_ERROR_NONE);
29 static void test_proxy_address_changed_cb(const char* ipv4_address, const char* ipv6_address, void* user_data)
31 PRINT_RETURN("test_proxy_address_changed_cb", CONNECTION_ERROR_NONE);
34 static void test_connection_opened_callback(connection_error_e result, void* user_data)
36 PRINT_RETURN("test_connection_opened_callback", result);
37 g_CallbackRet = result;
40 static void test_connection_closed_callback(connection_error_e result, void* user_data)
42 PRINT_RETURN("test_connection_closed_callback", result);
43 g_CallbackRet = result;
46 static void test_connection_set_default_callback(connection_error_e result, void* user_data)
48 PRINT_RETURN("test_connection_set_default_callback", result);
49 g_CallbackRet = result;
52 static void test_connection_set_ethernet_callback(connection_ethernet_cable_state_e state, void* user_data)
54 PRINT_RETURN("test_connection_set_ethernet_callback", state);
55 g_CallbackRet = CONNECTION_ERROR_NONE;
58 static void test_connection_reset_profile_callback(connection_error_e result, void* user_data)
60 PRINT_RETURN("test_connection_reset_profile_callback", result);
61 g_CallbackRet = result;
64 static bool test_connection_ipv6_address_callback(char *ipv6_address, void *user_data)
66 PRINT_RETURN("test_connection_ipv6_address_callback", CONNECTION_ERROR_NONE);
70 static void test_connection_internet_state_changed_callback(connection_internet_state_e state, void* user_data)
72 PRINT_RETURN("test_connection_internet_state_changed_callback", CONNECTION_ERROR_NONE);
76 * @function utc_network_connection_startup
77 * @description Called before each test
81 void utc_network_connection_startup(void)
83 wifi_supported = connection_check_feature_supported(FEATURE_WIFI);
84 telephony_supported = connection_check_feature_supported(FEATURE_TELEPHONY);
85 bt_tethering_supported = connection_check_feature_supported(FEATURE_BT_TETHERING);
86 ethernet_supported = connection_check_feature_supported(FEATURE_ETHERNET);
87 route_supported = connection_check_feature_supported(FEATURE_ROUTE);
89 if (telephony_supported == false && wifi_supported == false
90 && bt_tethering_supported == false && ethernet_supported == false) {
91 all_features_not_supported = true;
95 int ret = connection_create(&connection);
96 PRINT_RETURN("connection_create", ret);
98 if (ret != CONNECTION_ERROR_NONE)
101 if (telephony_supported) {
102 if (!profile_cellular) {
103 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, CUSTOM_PROFILE_NAME, &profile_cellular);
104 PRINT_RETURN("connection_profile_create", ret);
110 * @function utc_network_connection_cleanup
111 * @description Called after each test
115 void utc_network_connection_cleanup(void)
119 if (profile_cellular) {
120 ret = connection_profile_destroy(profile_cellular);
121 PRINT_RETURN("connection_profile_destroy", ret);
122 profile_cellular = NULL;
126 ret = connection_profile_destroy(profile_temp);
127 PRINT_RETURN("connection_profile_destroy", ret);
132 ret = connection_destroy(connection);
133 PRINT_RETURN("connection_destroy", ret);
139 * @testcase utc_connection_create_p
142 * @description Creates a handle for managing data connections.
143 * @scenario Invoking connection_create with valid parameter.Destroy and create Connection.
145 int utc_connection_create_p(void)
149 if (all_features_not_supported) {
150 ret = connection_create(&connection);
151 CHECK_RETURN("connection_create", ret, CONNECTION_ERROR_NOT_SUPPORTED);
156 ret = connection_destroy(connection);
157 PRINT_RETURN("connection_destroy", ret);
161 ret = connection_create(&connection);
162 CHECK_RETURN("connection_create", ret, CONNECTION_ERROR_NONE);
168 * @testcase utc_connection_create_n
171 * @description connection_create should fail with invalid parameter.
172 * @scenario Verify connection_create by passing NULL parameter.
174 int utc_connection_create_n(void)
178 if (all_features_not_supported) {
179 ret = connection_create(&connection);
180 CHECK_RETURN("connection_create", ret, CONNECTION_ERROR_NOT_SUPPORTED);
185 ret = connection_destroy(connection);
186 PRINT_RETURN("connection_destroy", ret);
190 ret = connection_create(NULL);
191 CHECK_RETURN("connection_create", ret, CONNECTION_ERROR_INVALID_PARAMETER);
197 * @testcase utc_connection_get_ip_address_p
200 * @description Gets the IP address of the current connection.
201 * @scenario Invoking connection_get_ip_address with valid parameter.
203 int utc_connection_get_ip_address_p(void)
205 char *ip_address = NULL;
207 int ret = connection_get_ip_address(connection, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_address);
208 FREE_RESOURCE(ip_address);
210 if (all_features_not_supported)
211 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
213 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_NONE);
214 ret = connection_get_ip_address(connection, CONNECTION_ADDRESS_FAMILY_IPV6, &ip_address);
215 FREE_RESOURCE(ip_address);
217 if (all_features_not_supported)
218 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
220 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_NONE);
225 * @testcase utc_connection_get_ip_address_n
228 * @description connection_get_ip_address should fail with invalid parameter.
229 * @scenario Verify connection_get_ip_address by passing invalid parameter.
231 int utc_connection_get_ip_address_n(void)
234 char *ip_address = NULL;
236 if (all_features_not_supported) {
237 ret = connection_get_ip_address(connection, -100, NULL);
238 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
242 ret = connection_get_ip_address(NULL, -100, NULL);
243 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
244 ret = connection_get_ip_address(NULL, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_address);
245 FREE_RESOURCE(ip_address);
246 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
247 ret = connection_get_ip_address(connection, -100, &ip_address);
248 FREE_RESOURCE(ip_address);
249 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
250 ret = connection_get_ip_address(connection, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
251 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
252 ret = connection_get_ip_address(NULL, -100, &ip_address);
253 FREE_RESOURCE(ip_address);
254 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
255 ret = connection_get_ip_address(NULL, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
256 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
257 ret = connection_get_ip_address(connection, -100, NULL);
258 CHECK_RETURN("connection_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
264 * @testcase utc_connection_get_proxy_p
267 * @description Gets the proxy address of the current connection.
268 * @scenario Invoking connection_get_proxy with valid parameter.
270 int utc_connection_get_proxy_p(void)
274 int ret = connection_get_proxy(connection, CONNECTION_ADDRESS_FAMILY_IPV4, &proxy);
275 FREE_RESOURCE(proxy);
276 if (all_features_not_supported)
277 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_NOT_SUPPORTED);
279 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_NONE);
284 * @testcase utc_connection_get_proxy_n
287 * @description connection_get_proxy should fail with invalid parameter.
288 * @scenario Verify connection_get_proxy by passing invalid parameter.
290 int utc_connection_get_proxy_n(void)
295 if (all_features_not_supported) {
296 ret = connection_get_proxy(connection, -100, NULL);
297 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_NOT_SUPPORTED);
301 ret = connection_get_proxy(NULL, -100, NULL);
302 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_INVALID_PARAMETER);
303 ret = connection_get_proxy(NULL, CONNECTION_ADDRESS_FAMILY_IPV4, &proxy);
304 FREE_RESOURCE(proxy);
305 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_INVALID_PARAMETER);
306 ret = connection_get_proxy(connection, -100, &proxy);
307 FREE_RESOURCE(proxy);
308 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_INVALID_PARAMETER);
309 ret = connection_get_proxy(connection, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
310 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_INVALID_PARAMETER);
311 ret = connection_get_proxy(NULL, -100, &proxy);
312 FREE_RESOURCE(proxy);
313 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_INVALID_PARAMETER);
314 ret = connection_get_proxy(NULL, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
315 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_INVALID_PARAMETER);
316 ret = connection_get_proxy(connection, -100, NULL);
317 CHECK_RETURN("connection_get_proxy", ret, CONNECTION_ERROR_INVALID_PARAMETER);
323 * @testcase utc_connection_get_type_n
326 * @description connection_get_type should fail with invalid parameter.
327 * @scenario Verify connection_get_type by passing invalid parameter.
329 int utc_connection_get_type_n(void)
332 connection_type_e state;
334 if (all_features_not_supported) {
335 ret = connection_get_type(connection, NULL);
336 CHECK_RETURN("connection_get_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
340 ret = connection_get_type(NULL, NULL);
341 CHECK_RETURN("connection_get_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
342 ret = connection_get_type(NULL, &state);
343 CHECK_RETURN("connection_get_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
344 ret = connection_get_type(connection, NULL);
345 CHECK_RETURN("connection_get_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
351 * @testcase utc_connection_get_type_p
354 * @description Gets the type of the current profile for data connection.
355 * @scenario Invoking connection_get_type with valid parameter.
357 int utc_connection_get_type_p(void)
359 connection_type_e state;
361 int ret = connection_get_type(connection, &state);
363 if (all_features_not_supported)
364 CHECK_RETURN("connection_get_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
366 CHECK_RETURN("connection_get_type", ret, CONNECTION_ERROR_NONE);
371 * @testcase utc_connection_is_metered_network_n
374 * @description connection_is_metered_network should fail with invalid parameter.
375 * @scenario Verify utc_connection_is_metered_network_n by passing invalid parameter.
377 int utc_connection_is_metered_network_n(void)
382 if (all_features_not_supported) {
383 ret = connection_is_metered_network(connection, NULL);
384 CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_NOT_SUPPORTED);
388 ret = connection_is_metered_network(NULL, NULL);
389 CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_INVALID_PARAMETER);
390 ret = connection_is_metered_network(NULL, &state);
391 CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_INVALID_PARAMETER);
392 ret = connection_is_metered_network(connection, NULL);
393 CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_INVALID_PARAMETER);
399 * @testcase utc_connection_is_metered_network_p
402 * @description Gets if the current connection is metered.
403 * @scenario Invoking utc_connection_is_metered_network_p with valid parameter.
405 int utc_connection_is_metered_network_p(void)
408 connection_type_e type;
410 int ret = connection_is_metered_network(connection, &state);
411 connection_get_type(connection, &type);
413 if (all_features_not_supported)
414 CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_NOT_SUPPORTED);
416 CHECK_RETURN("connection_is_metered_network", type, CONNECTION_TYPE_CELLULAR);
418 CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_NONE);
423 * @testcase utc_connection_get_cellular_state_n
426 * @description connection_get_cellular_state should fail with invalid parameter.
427 * @scenario Verify connection_get_cellular_state by passing invalid parameter.
429 int utc_connection_get_cellular_state_n(void)
431 connection_cellular_state_e state;
433 if (!telephony_supported) {
434 int ret = connection_get_cellular_state(NULL, NULL);
435 CHECK_RETURN("connection_get_cellular_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
439 int ret = connection_get_cellular_state(NULL, NULL);
440 CHECK_RETURN("connection_get_cellular_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
441 ret = connection_get_cellular_state(NULL, &state);
442 CHECK_RETURN("connection_get_cellular_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
443 ret = connection_get_cellular_state(connection, NULL);
444 CHECK_RETURN("connection_get_cellular_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
450 * @testcase utc_connection_get_cellular_state_p
453 * @description Gets the state of cellular connection.
454 * @scenario Invoking connection_get_cellular_state with valid parameter.
456 int utc_connection_get_cellular_state_p(void)
458 connection_cellular_state_e state;
460 if (!telephony_supported) {
461 int ret = connection_get_cellular_state(connection, &state);
462 CHECK_RETURN("connection_get_cellular_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
466 int ret = connection_get_cellular_state(connection, &state);
467 CHECK_RETURN("connection_get_cellular_state", ret, CONNECTION_ERROR_NONE);
473 * @testcase utc_connection_get_ethernet_state_n
476 * @description connection_get_ethernet_state should fail with invalid parameter.
477 * @scenario Verify connection_get_ethernet_state by passing invalid parameter.
479 int utc_connection_get_ethernet_state_n(void)
481 connection_ethernet_state_e state;
483 if (!ethernet_supported) {
484 int ret = connection_get_ethernet_state(NULL, NULL);
485 CHECK_RETURN("connection_get_ethernet_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
489 int ret = connection_get_ethernet_state(NULL, NULL);
490 CHECK_RETURN("connection_get_ethernet_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
491 ret = connection_get_ethernet_state(NULL, &state);
492 CHECK_RETURN("connection_get_ethernet_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
493 ret = connection_get_ethernet_state(connection, NULL);
494 CHECK_RETURN("connection_get_ethernet_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
500 * @testcase utc_connection_get_ethernet_state_p
503 * @description Gets the state of the Ethernet.
504 * @scenario Invoking connection_get_ethernet_state with valid parameter.
506 int utc_connection_get_ethernet_state_p(void)
508 connection_ethernet_state_e state;
510 if (!ethernet_supported) {
511 int ret = connection_get_ethernet_state(connection, &state);
512 CHECK_RETURN("connection_get_ethernet_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
516 int ret = connection_get_ethernet_state(connection, &state);
517 CHECK_RETURN("connection_get_ethernet_state", ret, CONNECTION_ERROR_NONE);
523 * @testcase utc_connection_get_wifi_state_n
526 * @description connection_get_wifi_state should fail with invalid parameter.
527 * @scenario Verify connection_get_wifi_state by passing invalid parameter.
529 int utc_connection_get_wifi_state_n(void)
531 connection_wifi_state_e state;
533 if (!wifi_supported) {
534 int ret = connection_get_wifi_state(NULL, NULL);
535 CHECK_RETURN("connection_get_wifi_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
539 int ret = connection_get_wifi_state(NULL, NULL);
540 CHECK_RETURN("connection_get_wifi_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
541 ret = connection_get_wifi_state(NULL, &state);
542 CHECK_RETURN("connection_get_wifi_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
543 ret = connection_get_wifi_state(connection, NULL);
544 CHECK_RETURN("connection_get_wifi_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
550 * @testcase utc_connection_get_wifi_state_p
553 * @description Gets the state of the Wi-Fi.
554 * @scenario Invoking connection_get_wifi_state with valid parameter.
556 int utc_connection_get_wifi_state_p(void)
558 connection_wifi_state_e state;
560 if (!wifi_supported) {
561 int ret = connection_get_wifi_state(connection, &state);
562 CHECK_RETURN("connection_get_wifi_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
566 int ret = connection_get_wifi_state(connection, &state);
567 CHECK_RETURN("connection_get_wifi_state", ret, CONNECTION_ERROR_NONE);
573 * @testcase utc_connection_get_bt_state_n
576 * @description connection_get_bt_state should fail with invalid parameter.
577 * @scenario Verify connection_get_bt_state by passing invalid parameter.
579 int utc_connection_get_bt_state_n(void)
581 connection_bt_state_e state;
583 if (!bt_tethering_supported) {
584 int ret = connection_get_bt_state(NULL, NULL);
585 CHECK_RETURN("connection_get_bt_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
589 int ret = connection_get_bt_state(NULL, NULL);
590 CHECK_RETURN("connection_get_bt_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
591 ret = connection_get_bt_state(NULL, &state);
592 CHECK_RETURN("connection_get_bt_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
593 ret = connection_get_bt_state(connection, NULL);
594 CHECK_RETURN("connection_get_bt_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
600 * @testcase utc_connection_get_bt_state_p
603 * @description Gets the state of the bluetooth.The returned state is for the bluetooth connection state.
604 * @scenario Invoking connection_get_bt_state with valid parameter.
606 int utc_connection_get_bt_state_p(void)
608 connection_bt_state_e state;
610 if (!bt_tethering_supported) {
611 int ret = connection_get_bt_state(connection, &state);
612 CHECK_RETURN("connection_get_bt_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
616 int ret = connection_get_bt_state(connection, &state);
617 CHECK_RETURN("connection_get_bt_state", ret, CONNECTION_ERROR_NONE);
623 * @testcase utc_connection_get_mac_address_n
626 * @description connection_get_mac_address should fail with invalid parameter.
627 * @scenario Verify connection_get_mac_address by passing invalid parameter.
629 int utc_connection_get_mac_address_n(void)
632 char *mac_addr = NULL;
634 if (wifi_supported == false && ethernet_supported == false) {
635 ret = connection_get_mac_address(connection, CONNECTION_TYPE_WIFI, &mac_addr);
636 CHECK_RETURN("connection_get_mac_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
640 if (wifi_supported) {
641 ret = connection_get_mac_address(NULL, CONNECTION_TYPE_WIFI, &mac_addr);
642 FREE_RESOURCE(mac_addr);
643 CHECK_RETURN("connection_get_mac_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
645 ret = connection_get_mac_address(connection, CONNECTION_TYPE_ETHERNET, NULL);
646 FREE_RESOURCE(mac_addr);
647 CHECK_RETURN("connection_get_mac_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
654 * @testcase utc_connection_get_mac_address_p
657 * @description Gets the MAC address of the Wi-Fi or ethernet.
658 * @scenario Invoking connection_get_mac_address with valid parameter.
660 int utc_connection_get_mac_address_p(void)
663 char *mac_addr = NULL;
665 if (wifi_supported) {
666 ret = connection_get_mac_address(connection, CONNECTION_TYPE_WIFI, &mac_addr);
667 assert(mac_addr); FREE_RESOURCE(mac_addr);
668 CHECK_RETURN("connection_get_mac_address", ret, CONNECTION_ERROR_NONE);
669 } else if (ethernet_supported) {
670 ret = connection_get_mac_address(connection, CONNECTION_TYPE_ETHERNET, &mac_addr);
671 assert(mac_addr); FREE_RESOURCE(mac_addr);
672 CHECK_RETURN("connection_get_mac_address", ret, CONNECTION_ERROR_NONE);
674 ret = connection_get_mac_address(connection, CONNECTION_TYPE_WIFI, &mac_addr);
675 FREE_RESOURCE(mac_addr);
676 CHECK_RETURN("connection_get_mac_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
683 * @testcase utc_connection_set_ethernet_cable_state_chaged_cb_n
686 * @description connection_set_ethernet_cable_state_chaged_cb should fail with invalid parameter.
687 * @scenario Verify connection_set_ethernet_cable_state_chaged_cb by passing invalid parameter.
689 int utc_connection_set_ethernet_cable_state_chaged_cb_n(void)
692 if (ethernet_supported == false) {
693 ret = connection_set_ethernet_cable_state_chaged_cb(NULL, NULL, NULL);
694 CHECK_RETURN("connection_set_ethernet_cable_state_chaged_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
698 ret = connection_set_ethernet_cable_state_chaged_cb(NULL,
699 test_connection_set_ethernet_callback, NULL);
700 CHECK_RETURN("connection_set_ethernet_cable_state_chaged_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
701 ret = connection_set_ethernet_cable_state_chaged_cb(connection, NULL, NULL);
702 CHECK_RETURN("connection_set_ethernet_cable_state_chaged_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
707 int utc_connection_set_ethernet_cable_state_chaged_cb_p(void)
710 if (ethernet_supported == false) {
711 ret = connection_set_ethernet_cable_state_chaged_cb(NULL, NULL, NULL);
712 CHECK_RETURN("connection_set_ethernet_cable_state_chaged_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
716 ret = connection_set_ethernet_cable_state_chaged_cb(connection, test_connection_set_ethernet_callback, NULL);
717 CHECK_RETURN("connection_set_ethernet_cable_state_chaged_cb", ret, CONNECTION_ERROR_NONE);
723 * @testcase utc_connection_unset_ethernet_cable_state_chaged_cb_n
726 * @description connection_unset_ethernet_cable_state_chaged_cb should fail with invalid parameter.
727 * @scenario Verify connection_unset_ethernet_cable_state_chaged_cb by passing invalid parameter.
729 int utc_connection_unset_ethernet_cable_state_chaged_cb_n(void)
732 ret = connection_unset_ethernet_cable_state_chaged_cb(NULL);
734 if (ethernet_supported == false)
735 CHECK_RETURN("connection_unset_ethernet_cable_state_chaged_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
737 CHECK_RETURN("connection_unset_ethernet_cable_state_chaged_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
743 int utc_connection_unset_ethernet_cable_state_chaged_cb_p(void)
746 ret = connection_unset_ethernet_cable_state_chaged_cb(connection);
747 if (ethernet_supported == false)
748 CHECK_RETURN("connection_unset_ethernet_cable_state_chaged_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
750 CHECK_RETURN("connection_unset_ethernet_cable_state_chaged_cb", ret, CONNECTION_ERROR_NONE);
755 * @testcase utc_connection_get_ethernet_cable_state_n
758 * @description connection_get_ethernet_cable_state should fail with invalid parameter.
759 * @scenario Verify connection_get_ethernet_cable_state by passing invalid parameter.
761 int utc_connection_get_ethernet_cable_state_n(void)
764 connection_ethernet_cable_state_e cable_state;
766 if (ethernet_supported == false) {
767 ret = connection_get_ethernet_cable_state(NULL, NULL);
768 CHECK_RETURN("connection_get_ethernet_cable_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
772 ret = connection_get_ethernet_cable_state(NULL, &cable_state);
773 CHECK_RETURN("connection_get_ethernet_cable_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
774 ret = connection_get_ethernet_cable_state(connection, NULL);
775 CHECK_RETURN("connection_get_ethernet_cable_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
781 * @testcase utc_connection_get_ethernet_cable_state_p
784 * @description Checks for ethernet cable is attached or not.
785 * @scenario Invoking connection_get_ethernet_cable_state with valid parameter.
787 int utc_connection_get_ethernet_cable_state_p(void)
790 connection_ethernet_cable_state_e cable_state;
792 ret = connection_get_ethernet_cable_state(connection, &cable_state);
793 if (ethernet_supported == false)
794 CHECK_RETURN("connection_get_ethernet_cable_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
796 CHECK_RETURN("connection_get_ethernet_cable_state", ret, CONNECTION_ERROR_NONE);
801 * @testcase utc_connection_get_current_profile_p
804 * @description Gets the name of the default profile.
805 * @scenario Invoking connection_get_current_profile with valid parameter.
807 int utc_connection_get_current_profile_p(void)
809 int ret = connection_get_current_profile(connection, &profile_temp);
811 if (all_features_not_supported)
812 CHECK_RETURN("connection_get_current_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
814 CHECK_RETURN("connection_get_current_profile", ret, CONNECTION_ERROR_NONE);
819 * @testcase utc_connection_get_current_profile_n
822 * @description connection_get_current_profile should fail with invalid parameter.
823 * @scenario Verify connection_get_current_profile by passing invalid parameter.
825 int utc_connection_get_current_profile_n(void)
828 connection_profile_h profile = NULL;
830 if (all_features_not_supported) {
831 ret = connection_get_current_profile(connection, NULL);
832 CHECK_RETURN("connection_get_current_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
836 ret = connection_get_current_profile(NULL, NULL);
837 CHECK_RETURN("connection_get_current_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
838 ret = connection_get_current_profile(connection, NULL);
839 CHECK_RETURN("connection_get_current_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
840 ret = connection_get_current_profile(NULL, &profile);
841 CHECK_RETURN("connection_get_current_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
847 * @testcase utc_connection_get_default_cellular_service_profile_p
850 * @description Gets the default profile which provides the given cellular service.
851 * @scenario Invoking connection_get_default_cellular_service_profile with valid parameter.
853 int utc_connection_get_default_cellular_service_profile_p(void)
855 connection_profile_h profile = NULL;
857 if (!telephony_supported) {
858 int ret = connection_get_default_cellular_service_profile(connection, CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET, &profile);
859 CHECK_RETURN("connection_get_default_cellular_service_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
863 connection_cellular_state_e state;
864 int ret = connection_get_cellular_state(connection, &state);
865 PRINT_RETURN("connection_get_cellular_state", ret);
866 if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE)
869 int service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
870 ret = connection_get_default_cellular_service_profile(connection, service_type, &profile);
871 CHECK_RETURN("connection_get_default_cellular_service_profile", ret, CONNECTION_ERROR_NONE);
873 service_type = CONNECTION_CELLULAR_SERVICE_TYPE_MMS;
874 ret = connection_get_default_cellular_service_profile(connection, service_type, &profile);
875 CHECK_RETURN("connection_get_default_cellular_service_profile", ret, CONNECTION_ERROR_NONE);
881 * @testcase utc_connection_get_default_cellular_service_profile_n
884 * @description connection_get_default_cellular_service_profile should fail with invalid parameter.
885 * @scenario Verify connection_get_default_cellular_service_profile by passing invalid parameter.
887 int utc_connection_get_default_cellular_service_profile_n(void)
889 connection_profile_h profile = NULL;
891 if (!telephony_supported) {
892 int ret = connection_get_default_cellular_service_profile(NULL, CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET, NULL);
893 CHECK_RETURN("connection_get_default_cellular_service_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
897 int service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
898 int ret = connection_get_default_cellular_service_profile(NULL, service_type, NULL);
899 CHECK_RETURN("connection_get_default_cellular_service_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
900 service_type = CONNECTION_CELLULAR_SERVICE_TYPE_MMS;
901 ret = connection_get_default_cellular_service_profile(connection, service_type, NULL);
902 CHECK_RETURN("connection_get_default_cellular_service_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
903 service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
904 ret = connection_get_default_cellular_service_profile(NULL, service_type, &profile);
905 CHECK_RETURN("connection_get_default_cellular_service_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
911 * @testcase utc_connection_set_default_cellular_service_profile_p
914 * @description Sets the default profile which provides the given cellular service.
915 * @scenario Invoking connection_set_default_cellular_service_profile with valid parameter.
917 int utc_connection_set_default_cellular_service_profile_p(void)
919 int service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
921 if (!telephony_supported) {
922 int ret = connection_set_default_cellular_service_profile(connection, service_type, profile_cellular);
923 CHECK_RETURN("connection_set_default_cellular_service_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
927 connection_cellular_state_e state;
928 int ret = connection_get_cellular_state(connection, &state);
929 PRINT_RETURN("connection_get_cellular_state", ret);
930 if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE)
933 ret = connection_get_default_cellular_service_profile(connection, service_type, &profile_cellular);
934 CHECK_RETURN("connection_set_default_cellular_service_profile", ret, CONNECTION_ERROR_NONE);
936 ret = connection_set_default_cellular_service_profile(connection, service_type, profile_cellular);
937 CHECK_RETURN("connection_set_default_cellular_service_profile", ret, CONNECTION_ERROR_NONE);
943 * @testcase utc_connection_set_default_cellular_service_profile_n
946 * @description connection_set_default_cellular_service_profile should fail with invalid parameter.
947 * @scenario Verify connection_set_default_cellular_service_profile by passing invalid parameter.
949 int utc_connection_set_default_cellular_service_profile_n(void)
951 int service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
953 if (!telephony_supported) {
954 int ret = connection_set_default_cellular_service_profile(NULL, service_type, NULL);
955 CHECK_RETURN("connection_set_default_cellular_service_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
959 int ret = connection_set_default_cellular_service_profile(NULL, service_type, NULL);
960 CHECK_RETURN("connection_set_default_cellular_service_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
961 ret = connection_set_default_cellular_service_profile(connection, service_type, NULL);
962 CHECK_RETURN("connection_set_default_cellular_service_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
963 service_type = CONNECTION_CELLULAR_SERVICE_TYPE_TETHERING;
964 ret = connection_get_default_cellular_service_profile(NULL, service_type, profile_cellular);
965 CHECK_RETURN("connection_set_default_cellular_service_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
971 * @testcase utc_connection_set_default_cellular_service_profile_async_p
974 * @description Sets the default profile which provides the given cellular service, asynchronously.
975 * @scenario Invoking connection_set_default_cellular_service_profile_async with valid parameter.
977 int utc_connection_set_default_cellular_service_profile_async_p(void)
979 int service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
981 if (!telephony_supported) {
982 int ret = connection_set_default_cellular_service_profile_async(connection, service_type, NULL, test_connection_set_default_callback, NULL);
983 CHECK_RETURN("connection_set_default_cellular_service_profile_async", ret, CONNECTION_ERROR_NOT_SUPPORTED);
987 connection_cellular_state_e state;
988 int ret = connection_get_cellular_state(connection, &state);
989 PRINT_RETURN("connection_get_cellular_state", ret);
990 if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE)
993 ret = connection_get_default_cellular_service_profile(connection, service_type, &profile_cellular);
994 CHECK_RETURN("connection_set_default_cellular_service_profile_async", ret, CONNECTION_ERROR_NONE);
996 ret = connection_set_default_cellular_service_profile_async(connection, service_type, profile_cellular, test_connection_set_default_callback, NULL);
997 CHECK_RETURN("connection_set_default_cellular_service_profile_async", ret, CONNECTION_ERROR_NONE);
998 test_connection_set_default_callback(CONNECTION_ERROR_NONE, NULL);
1004 * @testcase utc_connection_set_default_cellular_service_profile_async_n
1007 * @description connection_set_default_cellular_service_profile_async should fail with invalid parameter.
1008 * @scenario Verify connection_set_default_cellular_service_profile_async by passing invalid parameter.
1010 int utc_connection_set_default_cellular_service_profile_async_n(void)
1012 int service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
1014 if (!telephony_supported) {
1015 int ret = connection_set_default_cellular_service_profile_async(NULL, service_type, NULL, NULL, NULL);
1016 CHECK_RETURN("connection_set_default_cellular_service_profile_async", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1020 int ret = connection_set_default_cellular_service_profile_async(NULL, service_type, NULL, NULL, NULL);
1021 CHECK_RETURN("connection_set_default_cellular_service_profile_async", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1022 ret = connection_set_default_cellular_service_profile_async(connection, service_type, profile_cellular, NULL, NULL);
1023 CHECK_RETURN("connection_set_default_cellular_service_profile_async", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1024 ret = connection_set_default_cellular_service_profile_async(connection, service_type, NULL, test_connection_set_default_callback, NULL);
1025 CHECK_RETURN("connection_set_default_cellular_service_profile_async", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1026 service_type = CONNECTION_CELLULAR_SERVICE_TYPE_TETHERING;
1027 ret = connection_set_default_cellular_service_profile_async(NULL, service_type, profile_cellular, test_connection_set_default_callback, NULL);
1028 CHECK_RETURN("connection_set_default_cellular_service_profile_async", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1034 * @testcase utc_connection_set_type_changed_cb_n
1037 * @description connection_set_type_changed_cb should fail with invalid parameter.
1038 * @scenario Verify connection_set_type_changed_cb by passing invalid parameter.
1040 int utc_connection_set_type_changed_cb_n(void)
1044 if (all_features_not_supported) {
1045 ret = connection_set_type_changed_cb(connection, NULL, NULL);
1046 CHECK_RETURN("connection_set_type_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1050 ret = connection_set_type_changed_cb(NULL, NULL, NULL);
1051 CHECK_RETURN("connection_set_type_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1052 ret = connection_set_type_changed_cb(NULL, test_network_state_changed_cb, NULL);
1053 CHECK_RETURN("connection_set_type_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1054 ret = connection_set_type_changed_cb(connection, NULL, NULL);
1055 CHECK_RETURN("connection_set_type_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1061 * @testcase utc_connection_set_type_changed_cb_p
1064 * @description Registers the callback that is called when the type of the current connection is changed.
1065 * @scenario Invoking connection_set_type_changed_cb with valid parameter.
1067 int utc_connection_set_type_changed_cb_p(void)
1071 if (all_features_not_supported) {
1072 ret = connection_set_type_changed_cb(connection, NULL, NULL);
1073 CHECK_RETURN("connection_set_type_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1077 ret = connection_set_type_changed_cb(connection, test_network_state_changed_cb, NULL);
1078 CHECK_RETURN("connection_set_type_changed_cb", ret, CONNECTION_ERROR_NONE);
1079 test_network_state_changed_cb(CONNECTION_TYPE_CELLULAR, NULL);
1085 * @testcase utc_connection_unset_type_changed_cb_n
1088 * @description connection_unset_type_changed_cb should fail with invalid parameter.
1089 * @scenario Verify connection_unset_type_changed_cb by passing invalid parameter.
1091 int utc_connection_unset_type_changed_cb_n(void)
1093 int ret = connection_unset_type_changed_cb(NULL);
1095 if (all_features_not_supported)
1096 CHECK_RETURN("connection_unset_type_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1098 CHECK_RETURN("connection_unset_type_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1103 * @testcase utc_connection_unset_type_changed_cb_p
1106 * @description Unregisters the callback that is called when the type of current connection is changed.
1107 * @scenario Invoking connection_unset_type_changed_cb with valid parameter.
1109 int utc_connection_unset_type_changed_cb_p(void)
1111 int ret = connection_unset_type_changed_cb(connection);
1113 if (all_features_not_supported)
1114 CHECK_RETURN("connection_unset_type_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1116 CHECK_RETURN("connection_unset_type_changed_cb", ret, CONNECTION_ERROR_NONE);
1121 * @testcase utc_connection_set_ip_address_changed_cb_n
1124 * @description connection_set_ip_address_changed_cb should fail with invalid parameter.
1125 * @scenario Verify connection_set_ip_address_changed_cb by passing invalid parameter.
1127 int utc_connection_set_ip_address_changed_cb_n(void)
1131 if (all_features_not_supported) {
1132 ret = connection_set_ip_address_changed_cb(connection, NULL, NULL);
1133 CHECK_RETURN("connection_set_ip_address_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1137 ret = connection_set_ip_address_changed_cb(NULL, NULL, NULL);
1138 CHECK_RETURN("connection_set_ip_address_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1139 ret = connection_set_ip_address_changed_cb(NULL, test_ip_address_changed_cb, NULL);
1140 CHECK_RETURN("connection_set_ip_address_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1141 ret = connection_set_ip_address_changed_cb(connection, NULL, NULL);
1142 CHECK_RETURN("connection_set_ip_address_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1148 * @testcase utc_connection_set_ip_address_changed_cb_p
1151 * @description Registers the callback that is called when the IP address is changed.
1152 * @scenario Invoking connection_set_ip_address_changed_cb with valid parameter.
1154 int utc_connection_set_ip_address_changed_cb_p(void)
1158 if (all_features_not_supported) {
1159 ret = connection_set_ip_address_changed_cb(connection, NULL, NULL);
1160 CHECK_RETURN("connection_set_ip_address_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1164 ret = connection_set_ip_address_changed_cb(connection, test_ip_address_changed_cb, NULL);
1165 CHECK_RETURN("connection_set_ip_address_changed_cb", ret, CONNECTION_ERROR_NONE);
1166 test_ip_address_changed_cb(NULL, NULL, NULL);
1172 * @testcase utc_connection_unset_ip_address_changed_cb_n
1175 * @description connection_unset_ip_address_changed_cb should fail with invalid parameter.
1176 * @scenario Verify connection_unset_ip_address_changed_cb by passing invalid parameter.
1178 int utc_connection_unset_ip_address_changed_cb_n(void)
1180 int ret = connection_unset_ip_address_changed_cb(NULL);
1182 if (all_features_not_supported)
1183 CHECK_RETURN("connection_set_ip_address_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1185 CHECK_RETURN("connection_set_ip_address_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1190 * @testcase utc_connection_unset_ip_address_changed_cb_p
1193 * @description Unregisters the callback that is called when the IP address is changed.
1194 * @scenario Invoking connection_unset_ip_address_changed_cb with valid parameter.
1196 int utc_connection_unset_ip_address_changed_cb_p(void)
1198 int ret = connection_unset_ip_address_changed_cb(connection);
1200 if (all_features_not_supported)
1201 CHECK_RETURN("connection_unset_ip_address_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1203 CHECK_RETURN("connection_unset_ip_address_changed_cb", ret, CONNECTION_ERROR_NONE);
1208 * @testcase utc_connection_set_proxy_address_changed_cb_n
1211 * @description connection_set_proxy_address_changed_cb should fail with invalid parameter.
1212 * @scenario Verify connection_set_proxy_address_changed_cb by passing invalid parameter.
1214 int utc_connection_set_proxy_address_changed_cb_n(void)
1218 if (all_features_not_supported) {
1219 ret = connection_set_proxy_address_changed_cb(connection, NULL, NULL);
1220 CHECK_RETURN("connection_set_proxy_address_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1224 ret = connection_set_proxy_address_changed_cb(NULL, NULL, NULL);
1225 CHECK_RETURN("connection_set_proxy_address_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1226 ret = connection_set_proxy_address_changed_cb(NULL, test_proxy_address_changed_cb, NULL);
1227 CHECK_RETURN("connection_set_proxy_address_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1228 ret = connection_set_proxy_address_changed_cb(connection, NULL, NULL);
1229 CHECK_RETURN("connection_set_proxy_address_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1235 * @testcase utc_connection_set_proxy_address_changed_cb_p
1238 * @description Registers the callback that is called when the proxy address is changed.
1239 * @scenario Invoking connection_set_proxy_address_changed_cb with valid parameter.
1241 int utc_connection_set_proxy_address_changed_cb_p(void)
1245 if (all_features_not_supported) {
1246 ret = connection_set_proxy_address_changed_cb(connection, NULL, NULL);
1247 CHECK_RETURN("connection_set_proxy_address_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1251 ret = connection_set_proxy_address_changed_cb(connection, test_proxy_address_changed_cb, NULL);
1252 CHECK_RETURN("connection_set_proxy_address_changed_cb", ret, CONNECTION_ERROR_NONE);
1253 test_proxy_address_changed_cb(NULL, NULL, NULL);
1259 * @testcase utc_connection_unset_proxy_address_changed_cb_n
1262 * @description connection_unset_proxy_address_changed_cb should fail with invalid parameter.
1263 * @scenario Verify connection_unset_proxy_address_changed_cb by passing invalid parameter.
1265 int utc_connection_unset_proxy_address_changed_cb_n(void)
1267 int ret = connection_unset_proxy_address_changed_cb(NULL);
1269 if (all_features_not_supported)
1270 CHECK_RETURN("connection_unset_proxy_address_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1272 CHECK_RETURN("connection_unset_proxy_address_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1277 * @testcase utc_connection_unset_proxy_address_changed_cb_p
1280 * @description Unregisters the callback that is called when the proxy address is changed.
1281 * @scenario Invoking connection_unset_proxy_address_changed_cb with valid parameter.
1283 int utc_connection_unset_proxy_address_changed_cb_p(void)
1285 int ret = connection_unset_proxy_address_changed_cb(connection);
1287 if (all_features_not_supported)
1288 CHECK_RETURN("connection_unset_proxy_address_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1290 CHECK_RETURN("connection_unset_proxy_address_changed_cb", ret, CONNECTION_ERROR_NONE);
1295 * @testcase utc_connection_get_statistics_p
1298 * @description Gets the statistics information.
1299 * @scenario Invoking connection_get_statistics with valid parameter.
1301 int utc_connection_get_statistics_p(void)
1305 if (telephony_supported) {
1306 int ret = connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA, &stat);
1307 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NONE);
1308 ret = connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA, &stat);
1309 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NONE);
1310 ret = connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA, &stat);
1311 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NONE);
1312 ret = connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA, &stat);
1313 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NONE);
1315 int ret = connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA, &stat);
1316 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1319 if (wifi_supported) {
1320 int ret = connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA, &stat);
1321 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NONE);
1322 ret = connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA, &stat);
1323 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NONE);
1324 ret = connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA, &stat);
1325 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NONE);
1326 ret = connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA, &stat);
1327 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NONE);
1329 int ret = connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA, &stat);
1330 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1337 * @testcase utc_connection_get_statistics_n
1340 * @description connection_get_statistics should fail with invalid parameter.
1341 * @scenario Verify connection_get_statistics by passing invalid parameter.
1343 int utc_connection_get_statistics_n(void)
1348 if (telephony_supported == false && wifi_supported == false) {
1349 ret = connection_get_statistics(NULL, -1, -1, NULL);
1350 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1354 ret = connection_get_statistics(NULL, -1, -1, NULL);
1355 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1356 ret = connection_get_statistics(connection, -1, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA, &stat);
1357 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1358 ret = connection_get_statistics(connection, -1, -1, &stat);
1359 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1361 if (telephony_supported) {
1362 ret = connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, -1, &stat);
1363 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1364 ret = connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA, NULL);
1365 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1366 ret = connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, -1, NULL);
1367 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1369 ret = connection_get_statistics(connection, CONNECTION_TYPE_CELLULAR, -1, &stat);
1370 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1373 if (wifi_supported) {
1374 ret = connection_get_statistics(connection, CONNECTION_TYPE_WIFI, -1, &stat);
1375 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1376 ret = connection_get_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA, NULL);
1377 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1378 ret = connection_get_statistics(connection, CONNECTION_TYPE_WIFI, -1, NULL);
1379 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1381 ret = connection_get_statistics(connection, CONNECTION_TYPE_WIFI, -1, &stat);
1382 CHECK_RETURN("connection_get_statistics", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1389 * @testcase utc_connection_reset_statistics_p
1392 * @description Resets the statistics information.
1393 * @scenario Invoking connection_reset_statistics with valid parameter.
1395 int utc_connection_reset_statistics_p(void)
1398 if (telephony_supported) {
1399 ret = connection_reset_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA);
1400 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NONE);
1401 ret = connection_reset_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA);
1402 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NONE);
1403 ret = connection_reset_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA);
1404 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NONE);
1405 ret = connection_reset_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA);
1406 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NONE);
1408 ret = connection_reset_statistics(connection, CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA);
1409 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1412 if (wifi_supported) {
1413 ret = connection_reset_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA);
1414 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NONE);
1415 ret = connection_reset_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA);
1416 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NONE);
1417 ret = connection_reset_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA);
1418 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NONE);
1419 ret = connection_reset_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA);
1420 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NONE);
1422 ret = connection_reset_statistics(connection, CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA);
1423 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1430 * @testcase utc_connection_reset_statistics_n
1433 * @description connection_reset_statistics should fail with invalid parameter.
1434 * @scenario Verify connection_reset_statistics by passing invalid parameter.
1436 int utc_connection_reset_statistics_n(void)
1439 if (telephony_supported == false && wifi_supported == false) {
1440 ret = connection_reset_statistics(NULL, -1, -1);
1441 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1445 ret = connection_reset_statistics(NULL, -1, -1);
1446 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1447 ret = connection_reset_statistics(connection, -1, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA);
1448 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1450 if (telephony_supported) {
1451 ret = connection_reset_statistics(connection, CONNECTION_TYPE_CELLULAR, -1);
1452 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1454 ret = connection_reset_statistics(connection, CONNECTION_TYPE_CELLULAR, -1);
1455 CHECK_RETURN("connection_reset_statistics", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1462 * @testcase utc_connection_add_route_n
1465 * @description connection_add_route should fail with invalid parameter.
1466 * @scenario Verify connection_add_route by passing invalid parameter.
1468 int utc_connection_add_route_n(void)
1472 if (!route_supported || all_features_not_supported) {
1473 ret = connection_add_route(connection, NULL, NULL);
1474 CHECK_RETURN("connection_add_route", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1478 ret = connection_add_route(NULL, NULL, NULL);
1479 CHECK_RETURN("connection_add_route", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1481 ret = connection_add_route(NULL, "pdp0", "192.168.129.3");
1482 CHECK_RETURN("connection_add_route", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1484 ret = connection_add_route(connection, "pdp0", NULL);
1485 CHECK_RETURN("connection_add_route", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1487 ret = connection_add_route(connection, NULL, "192.168.129.3");
1488 CHECK_RETURN("connection_add_route", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1494 * @testcase utc_connection_add_route_p
1497 * @description Adds a IPv4 route to the routing table.You can get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
1498 * @scenario Invoking connection_add_route with valid parameter.
1500 int utc_connection_add_route_p(void)
1503 char* interface_name = NULL;
1505 if (!route_supported || all_features_not_supported) {
1506 ret = connection_add_route(connection, interface_name, "192.168.129.3");
1507 CHECK_RETURN("connection_add_route", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1511 ret = connection_get_current_profile(connection, &profile_temp);
1512 PRINT_RETURN("connection_get_current_profile", ret);
1514 ret = connection_profile_get_network_interface_name(profile_temp, &interface_name);
1515 PRINT_RETURN("connection_get_current_profile", ret);
1517 ret = connection_add_route(connection, interface_name, "192.168.129.3");
1518 FREE_RESOURCE(interface_name);
1519 CHECK_RETURN("connection_add_route", ret, CONNECTION_ERROR_NONE);
1525 * @testcase utc_connection_remove_route_n
1528 * @description connection_remove_route should fail with invalid parameter.
1529 * @scenario Verify connection_remove_route by passing invalid parameter.
1531 int utc_connection_remove_route_n(void)
1535 if (!route_supported || all_features_not_supported) {
1536 ret = connection_remove_route(NULL, NULL, NULL);
1537 CHECK_RETURN("connection_remove_route", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1541 ret = connection_remove_route(NULL, NULL, NULL);
1542 CHECK_RETURN("connection_remove_route", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1544 ret = connection_remove_route(NULL, "pdp0", "192.168.129.3");
1545 CHECK_RETURN("connection_remove_route", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1547 ret = connection_remove_route(connection, "pdp0", NULL);
1548 CHECK_RETURN("connection_remove_route", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1550 ret = connection_add_route(connection, NULL, "192.168.129.3");
1551 CHECK_RETURN("connection_remove_route", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1557 * @testcase utc_connection_remove_route_p
1560 * @description Removes a IPv4 route from the routing table.get the @a interface_name from connection_profile_get_network_interface_name() of opened profile.
1561 * @scenario Invoking connection_remove_route with valid parameter.
1563 int utc_connection_remove_route_p(void)
1566 char* interface_name = NULL;
1568 if (!route_supported || all_features_not_supported) {
1569 ret = connection_remove_route(connection, interface_name, "192.168.129.3");
1570 CHECK_RETURN("connection_remove_route", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1574 ret = connection_get_current_profile(connection, &profile_temp);
1575 PRINT_RETURN("connection_get_current_profile", ret);
1577 ret = connection_profile_get_network_interface_name(profile_temp, &interface_name);
1578 PRINT_RETURN("connection_profile_get_network_interface_name", ret);
1580 ret = connection_remove_route(connection, interface_name, "192.168.129.3");
1581 FREE_RESOURCE(interface_name);
1582 CHECK_RETURN("connection_remove_route", ret, CONNECTION_ERROR_NONE);
1588 * @testcase utc_connection_add_route_ipv6_n
1589 * @since_tizen 2.3.1
1591 * @description connection_add_route_ipv6 should fail with invalid parameter.
1592 * @scenario Verify connection_add_route_ipv6 by passing invalid parameter.
1594 int utc_connection_add_route_ipv6_n(void)
1598 if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) {
1599 ret = connection_add_route_ipv6(NULL, NULL, NULL, NULL);
1600 CHECK_RETURN("connection_add_route_ipv6", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1604 ret = connection_add_route_ipv6(NULL, NULL, NULL, NULL);
1605 CHECK_RETURN("connection_add_route_ipv6", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1607 ret = connection_add_route_ipv6(connection, NULL, "2001:db8:1:0::1", "fe80::");
1608 CHECK_RETURN("connection_add_route_ipv6", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1610 ret = connection_add_route_ipv6(connection, NULL, NULL, "fe80::");
1611 CHECK_RETURN("connection_add_route_ipv6", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1617 * @testcase utc_connection_add_route_ipv6_p
1618 * @since_tizen 2.3.1
1620 * @description Adds a IPv6 route to the routing table.
1621 * @scenario Invoking connection_add_route_ipv6 with valid parameter.
1623 int utc_connection_add_route_ipv6_p(void)
1626 char* interface_name = NULL;
1628 if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) {
1629 ret = connection_add_route_ipv6(connection, interface_name, "2001:db8:1:0::1", "fe80::");
1630 CHECK_RETURN("connection_add_route_ipv6", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1634 ret = connection_get_current_profile(connection, &profile_temp);
1635 PRINT_RETURN("connection_get_current_profile", ret);
1636 ret = connection_profile_get_network_interface_name(profile_temp, &interface_name);
1637 PRINT_RETURN("connection_profile_get_network_interface_name", ret);
1639 ret = connection_add_route_ipv6(connection, interface_name, "2001:db8:1:0::1", "fe80::");
1640 FREE_RESOURCE(interface_name);
1641 CHECK_RETURN("connection_add_route_ipv6", ret, CONNECTION_ERROR_NONE);
1647 * @testcase utc_connection_remove_route_ipv6_n
1648 * @since_tizen 2.3.1
1650 * @description connection_add_route_ipv6 should fail with invalid parameter.
1651 * @scenario Verify connection_add_route_ipv6 by passing invalid parameter.
1653 int utc_connection_remove_route_ipv6_n(void)
1657 if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) {
1658 ret = connection_remove_route_ipv6(NULL, NULL, NULL, NULL);
1659 CHECK_RETURN("connection_remove_route_ipv6", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1663 ret = connection_remove_route_ipv6(NULL, NULL, NULL, NULL);
1664 CHECK_RETURN("connection_remove_route_ipv6", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1666 ret = connection_remove_route_ipv6(connection, NULL, "2001:db8:1:0::1", "fe80::");
1667 CHECK_RETURN("connection_remove_route_ipv6", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1669 ret = connection_remove_route_ipv6(connection, NULL, NULL, "fe80::");
1670 CHECK_RETURN("connection_remove_route_ipv6", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1676 * @testcase utc_connection_remove_route_ipv6_p
1677 * @since_tizen 2.3.1
1679 * @description Removes a IPV6 route from the routing table.
1680 * @scenario Invoking connection_remove_route_ipv6 with valid parameter.
1682 int utc_connection_remove_route_ipv6_p(void)
1685 char* interface_name = NULL;
1687 if (!route_supported || (telephony_supported == false && wifi_supported == false && ethernet_supported == false)) {
1688 ret = connection_remove_route_ipv6(connection, interface_name, "2001:db8:1:0::1", "fe80::");
1689 FREE_RESOURCE(interface_name);
1690 CHECK_RETURN("connection_remove_route_ipv6", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1694 ret = connection_get_current_profile(connection, &profile_temp);
1695 PRINT_RETURN("connection_get_current_profile", ret);
1696 ret = connection_profile_get_network_interface_name(profile_temp, &interface_name);
1697 PRINT_RETURN("connection_profile_get_network_interface_name", ret);
1699 ret = connection_remove_route_ipv6(connection, interface_name, "2001:db8:1:0::1", "fe80::");
1700 FREE_RESOURCE(interface_name);
1701 CHECK_RETURN("connection_remove_route_ipv6", ret, CONNECTION_ERROR_NONE);
1707 * @testcase utc_connection_add_route_entry_n
1710 * @description connection_add_route_entry should fail with invalid parameter.
1711 * @scenario Verify connection_add_route_entry by passing invalid parameter.
1713 int utc_connection_add_route_entry_n(void)
1717 if (telephony_supported == false && wifi_supported == false && ethernet_supported == false) {
1718 ret = connection_add_route_entry(NULL, -1, NULL, NULL, NULL);
1719 CHECK_RETURN("connection_add_route_entry", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1723 ret = connection_add_route_entry(NULL, -1, NULL, NULL, NULL);
1724 CHECK_RETURN("connection_add_route_entry", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1726 ret = connection_add_route_entry(connection, -1, NULL, "2001:db8:1:0::1", "fe80::");
1727 CHECK_RETURN("connection_add_route_entry", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1729 ret = connection_add_route_entry(connection, -1, NULL, NULL, "fe80::");
1730 CHECK_RETURN("connection_add_route_entry", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1736 * @testcase utc_connection_add_route_entry_p
1739 * @description Adds a route to the routing table.
1740 * @scenario Invoking connection_add_route_entry with valid parameter.
1742 int utc_connection_add_route_entry_p(void)
1745 char* interface_name = NULL;
1747 if (telephony_supported == false && wifi_supported == false && ethernet_supported == false) {
1748 ret = connection_add_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV6, interface_name, "2001:db8:1:0::1", "fe80::");
1749 CHECK_RETURN("connection_add_route_entry", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1753 ret = connection_get_current_profile(connection, &profile_temp);
1754 PRINT_RETURN("connection_get_current_profile", ret);
1755 connection_profile_get_network_interface_name(profile_temp, &interface_name);
1756 PRINT_RETURN("connection_profile_get_network_interface_name", ret);
1758 ret = connection_add_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV4, interface_name, "192.168.10.30", "192.168.10.1");
1759 CHECK_RETURN("connection_add_route_entry", ret, CONNECTION_ERROR_NONE);
1761 ret = connection_add_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV6, interface_name, "2001:db8:1:0::1", "fe80::");
1762 FREE_RESOURCE(interface_name);
1763 CHECK_RETURN("connection_add_route_entry", ret, CONNECTION_ERROR_NONE);
1769 * @testcase utc_connection_remove_route_entry_n
1772 * @description connection_add_route_entry should fail with invalid parameter.
1773 * @scenario Verify connection_add_route_entry by passing invalid parameter.
1775 int utc_connection_remove_route_entry_n(void)
1779 if (all_features_not_supported) {
1780 ret = connection_remove_route_entry(NULL, -1, NULL, NULL, NULL);
1781 CHECK_RETURN("connection_remove_route_entry", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1785 ret = connection_remove_route_entry(NULL, -1, NULL, NULL, NULL);
1786 CHECK_RETURN("connection_remove_route_entry", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1788 ret = connection_remove_route_entry(connection, -1, NULL, "2001:db8:1:0::1", "fe80::");
1789 CHECK_RETURN("connection_remove_route_entry", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1791 ret = connection_remove_route_entry(connection, -1, NULL, NULL, "fe80::");
1792 CHECK_RETURN("connection_remove_route_entry", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1798 * @testcase utc_connection_remove_route_entry_p
1801 * @description Removes a route from the routing table.
1802 * @scenario Invoking connection_remove_route_entry with valid parameter.
1804 int utc_connection_remove_route_entry_p(void)
1807 char* interface_name = NULL;
1809 if (telephony_supported == false && wifi_supported == false && ethernet_supported == false) {
1810 ret = connection_remove_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV6, interface_name, "2001:db8:1:0::1", "fe80::");
1811 FREE_RESOURCE(interface_name);
1812 CHECK_RETURN("connection_remove_route_entry", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1816 ret = connection_get_current_profile(connection, &profile_temp);
1817 PRINT_RETURN("connection_get_current_profile", ret);
1818 connection_profile_get_network_interface_name(profile_temp, &interface_name);
1819 PRINT_RETURN("connection_profile_get_network_interface_name", ret);
1821 ret = connection_remove_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV4, interface_name, "192.168.10.30", "192.168.10.1");
1822 CHECK_RETURN("connection_remove_route_entry", ret, CONNECTION_ERROR_NONE);
1824 ret = connection_remove_route_entry(connection, CONNECTION_ADDRESS_FAMILY_IPV6, interface_name, "2001:db8:1:0::1", "fe80::");
1825 FREE_RESOURCE(interface_name);
1826 CHECK_RETURN("connection_remove_route_entry", ret, CONNECTION_ERROR_NONE);
1832 * @testcase utc_connection_get_profile_iterator_n
1835 * @description connection_get_profile_iterator should fail with invalid parameter.
1836 * @scenario Verify connection_get_profile_iterator by passing invalid parameter.
1838 int utc_connection_get_profile_iterator_n(void)
1841 connection_profile_iterator_h profile_iter;
1843 if (all_features_not_supported) {
1844 ret = connection_get_profile_iterator(connection, 3, &profile_iter);
1845 CHECK_RETURN("connection_get_profile_iterator", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1849 ret = connection_get_profile_iterator(NULL, 3, NULL);
1850 CHECK_RETURN("connection_get_profile_iterator", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1851 ret = connection_get_profile_iterator(NULL, CONNECTION_ITERATOR_TYPE_CONNECTED, &profile_iter);
1852 CHECK_RETURN("connection_get_profile_iterator", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1853 ret = connection_get_profile_iterator(connection, 3, &profile_iter);
1854 CHECK_RETURN("connection_get_profile_iterator", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1860 * @testcase utc_connection_get_profile_iterator_p
1863 * @description Gets a profiles iterator.
1864 * @scenario Invoking connection_get_profile_iterator with valid parameter.
1866 int utc_connection_get_profile_iterator_p(void)
1869 connection_profile_iterator_h profile_iter;
1871 if (all_features_not_supported) {
1872 ret = connection_get_profile_iterator(connection, CONNECTION_ITERATOR_TYPE_CONNECTED, &profile_iter);
1873 CHECK_RETURN("connection_get_profile_iterator", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1877 ret = connection_get_profile_iterator(connection, CONNECTION_ITERATOR_TYPE_CONNECTED, &profile_iter);
1878 CHECK_RETURN("connection_get_profile_iterator", ret, CONNECTION_ERROR_NONE);
1879 ret = connection_get_profile_iterator(connection, CONNECTION_ITERATOR_TYPE_REGISTERED, &profile_iter);
1880 CHECK_RETURN("connection_get_profile_iterator", ret, CONNECTION_ERROR_NONE);
1886 * @testcase utc_connection_destroy_profile_iterator_n
1889 * @description connection_destroy_profile_iterator should fail with invalid parameter.
1890 * @scenario Verify connection_destroy_profile_iterator by passing invalid parameter.
1892 int utc_connection_destroy_profile_iterator_n(void)
1894 int ret = connection_destroy_profile_iterator(NULL);
1896 if (all_features_not_supported)
1897 CHECK_RETURN("connection_destroy_profile_iterator", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1899 CHECK_RETURN("connection_destroy_profile_iterator", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1904 * @testcase utc_connection_destroy_profile_iterator_p
1907 * @description Destroys a profiles iterator.
1908 * @scenario Invoking connection_destroy_profile_iterator with valid parameter.
1910 int utc_connection_destroy_profile_iterator_p(void)
1913 connection_profile_iterator_h profile_iter = NULL;
1915 if (all_features_not_supported) {
1916 ret = connection_destroy_profile_iterator(profile_iter);
1917 CHECK_RETURN("connection_destroy_profile_iterator", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1921 ret = connection_get_profile_iterator(connection, CONNECTION_ITERATOR_TYPE_CONNECTED, &profile_iter);
1922 PRINT_RETURN("connection_get_profile_iterator", ret);
1924 ret = connection_destroy_profile_iterator(profile_iter);
1925 CHECK_RETURN("connection_destroy_profile_iterator", ret, CONNECTION_ERROR_NONE);
1931 * @testcase utc_connection_profile_iterator_has_next_n
1934 * @description connection_profile_iterator_has_next should fail with invalid parameter.
1935 * @scenario Verify connection_profile_iterator_has_next by passing invalid parameter.
1937 int utc_connection_profile_iterator_has_next_n(void)
1939 int ret = connection_profile_iterator_has_next(NULL);
1940 if (all_features_not_supported)
1941 CHECK_RETURN("connection_profile_iterator_has_next", get_last_result(), CONNECTION_ERROR_NOT_SUPPORTED);
1943 CHECK_RETURN("connection_profile_iterator_has_next", ret, false);
1948 * @testcase utc_connection_profile_iterator_has_next_p
1951 * @description Checks whether the next element of a profile iterator exists or not.
1952 * @scenario Invoking connection_profile_iterator_has_next with valid parameter.
1954 int utc_connection_profile_iterator_has_next_p(void)
1957 connection_profile_iterator_h profile_iter = NULL;
1959 if (all_features_not_supported) {
1960 ret = connection_profile_iterator_has_next(profile_iter);
1961 CHECK_RETURN("connection_profile_iterator_has_next", get_last_result(), CONNECTION_ERROR_NOT_SUPPORTED);
1965 ret = connection_get_profile_iterator(connection, CONNECTION_ITERATOR_TYPE_REGISTERED, &profile_iter);
1966 PRINT_RETURN("connection_get_profile_iterator", ret);
1968 ret = connection_profile_iterator_has_next(profile_iter);
1969 CHECK_RETURN("connection_profile_iterator_has_next", ret, true);
1971 ret = connection_destroy_profile_iterator(profile_iter);
1972 PRINT_RETURN("connection_destroy_profile_iterator", ret);
1978 * @testcase utc_connection_profile_iterator_next_n
1981 * @description connection_profile_iterator_next should fail with invalid parameter.
1982 * @scenario Verify connection_profile_iterator_next by passing invalid parameter.
1984 int utc_connection_profile_iterator_next_n(void)
1986 connection_profile_h profile_h;
1988 int ret = connection_profile_iterator_next(NULL, &profile_h);
1990 if (all_features_not_supported)
1991 CHECK_RETURN("connection_profile_iterator_next", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1993 CHECK_RETURN("connection_profile_iterator_next", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1998 * @testcase utc_connection_profile_iterator_next_p
2001 * @description Moves the profile iterator to the next position and gets a profile handle.
2002 * @scenario Invoking connection_profile_iterator_next with valid parameter.
2004 int utc_connection_profile_iterator_next_p(void)
2007 connection_profile_iterator_h profile_iter = NULL;
2008 connection_profile_h profile_h = NULL;
2010 if (all_features_not_supported) {
2011 ret = connection_profile_iterator_next(profile_iter, &profile_h);
2012 CHECK_RETURN("connection_profile_iterator_next", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2016 ret = connection_get_profile_iterator(connection, CONNECTION_ITERATOR_TYPE_CONNECTED, &profile_iter);
2017 PRINT_RETURN("connection_get_profile_iterator", ret);
2019 while (connection_profile_iterator_has_next(profile_iter)) {
2020 ret = connection_profile_iterator_next(profile_iter, &profile_h);
2021 CHECK_RETURN("connection_profile_iterator_next", ret, CONNECTION_ERROR_NONE);
2028 * @testcase utc_connection_add_profile_p
2031 * @description Creates a profile handle.The profile name, which you get from connection_profile_get_name(), will include the keyword you set.
2032 * @scenario Invoking connection_profile_create with valid parameter.
2034 int utc_connection_add_profile_p(void)
2036 if (telephony_supported) {
2037 int ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, CUSTOM_PROFILE_NAME, &profile_cellular);
2038 PRINT_RETURN("connection_profile_create", ret);
2039 ret = connection_profile_set_cellular_service_type(profile_cellular, CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION);
2040 PRINT_RETURN("connection_profile_set_cellular_service_type", ret);
2042 connection_cellular_state_e state;
2043 ret = connection_get_cellular_state(connection, &state);
2044 PRINT_RETURN("connection_get_cellular_state", ret);
2046 ret = connection_add_profile(connection, profile_cellular);
2047 CHECK_RETURN("connection_add_profile", ret, CONNECTION_ERROR_NONE);
2049 int ret = connection_add_profile(connection, profile_cellular);
2050 CHECK_RETURN("connection_add_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2057 * @testcase utc_connection_add_profile_n
2060 * @description connection_add_profile should fail with invalid parameter.
2061 * @scenario Verify connection_add_profile by passing invalid parameter.
2063 int utc_connection_add_profile_n(void)
2065 connection_profile_h profile = NULL;
2067 if (telephony_supported) {
2068 int ret = connection_add_profile(NULL, NULL);
2069 CHECK_RETURN("connection_add_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2070 ret = connection_add_profile(NULL, &profile);
2071 CHECK_RETURN("connection_add_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2072 ret = connection_add_profile(connection, NULL);
2073 CHECK_RETURN("connection_add_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2075 int ret = connection_add_profile(NULL, NULL);
2076 CHECK_RETURN("connection_add_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2082 * @testcase utc_connection_close_profile_p
2085 * @description Closes a connection of profile.
2086 * @scenario Invoking connection_close_profile with valid parameter.
2088 int utc_connection_close_profile_p(void)
2091 connection_cellular_state_e state;
2093 if (!telephony_supported && !wifi_supported && !bt_tethering_supported) {
2094 ret = connection_close_profile(connection, profile_temp, test_connection_closed_callback, NULL);
2095 CHECK_RETURN("connection_close_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2099 if (telephony_supported) {
2100 ret = connection_get_cellular_state(connection, &state);
2101 PRINT_RETURN("connection_get_cellular_state", ret);
2102 if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE) {
2103 fprintf(stderr, "Cellular state is out of service at %s:%d", __FILE__, __LINE__);
2108 ret = connection_get_current_profile(connection, &profile_temp);
2109 PRINT_RETURN("connection_get_current_profile", ret);
2111 ret = connection_close_profile(connection, profile_temp, test_connection_closed_callback, NULL);
2112 PRINT_RETURN("connection_close_profile", ret);
2113 test_connection_closed_callback(CONNECTION_ERROR_NONE, NULL);
2114 CHECK_RETURN(CALLBACK_RETURN, g_CallbackRet, CONNECTION_ERROR_NONE);
2120 * @testcase utc_connection_close_profile_n
2123 * @description connection_close_profile should fail with invalid parameter.
2124 * @scenario Verify connection_close_profile by passing invalid parameter.
2126 int utc_connection_close_profile_n(void)
2129 connection_profile_h profile = NULL;
2131 if (!telephony_supported && !wifi_supported && !bt_tethering_supported) {
2132 ret = connection_close_profile(NULL, NULL, NULL, NULL);
2133 CHECK_RETURN("connection_close_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2137 ret = connection_close_profile(NULL, NULL, NULL, NULL);
2138 CHECK_RETURN("connection_close_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2139 ret = connection_close_profile(NULL, profile, test_connection_closed_callback, NULL);
2140 CHECK_RETURN("connection_close_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2141 ret = connection_close_profile(connection, profile, NULL, NULL);
2142 CHECK_RETURN("connection_close_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2148 * @testcase utc_connection_remove_profile_p
2151 * @description Removes an existing profile.
2152 * @scenario Invoking connection_remove_profile with valid parameter.
2154 int utc_connection_remove_profile_p(void)
2158 if (!telephony_supported && !wifi_supported) {
2159 ret = connection_remove_profile(connection, profile_temp);
2160 CHECK_RETURN("connection_remove_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2164 ret = connection_remove_profile(connection, profile_cellular);
2165 CHECK_RETURN("connection_remove_profile", ret, CONNECTION_ERROR_NONE);
2171 * @testcase utc_connection_remove_profile_n
2174 * @description connection_remove_profile should fail with invalid parameter.
2175 * @scenario Verify connection_remove_profile by passing invalid parameter.
2177 int utc_connection_remove_profile_n(void)
2180 connection_profile_h profile = NULL;
2182 if (!telephony_supported && !wifi_supported) {
2183 ret = connection_remove_profile(NULL, NULL);
2184 CHECK_RETURN("connection_remove_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2188 ret = connection_remove_profile(NULL, NULL);
2189 CHECK_RETURN("connection_remove_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2190 ret = connection_remove_profile(NULL, profile);
2191 CHECK_RETURN("connection_remove_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2192 ret = connection_remove_profile(connection, NULL);
2193 CHECK_RETURN("connection_remove_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2199 * @testcase utc_connection_update_profile_p
2202 * @description Updates an existing profile.
2203 * @scenario Invoking connection_update_profile with valid parameter.
2205 int utc_connection_update_profile_p(void)
2207 connection_profile_h profile_h = NULL;
2208 int ret = test_get_any_profile(&profile_h);
2210 if (!telephony_supported && !wifi_supported && !ethernet_supported) {
2211 ret = connection_update_profile(connection, profile_temp);
2212 CHECK_RETURN("connection_update_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2217 profile_temp = profile_h;
2219 ret = connection_update_profile(connection, profile_temp);
2220 CHECK_RETURN("connection_update_profile", ret, CONNECTION_ERROR_NONE);
2226 * @testcase utc_connection_update_profile_n
2229 * @description connection_update_profile should fail with invalid parameter.
2230 * @scenario Verify connection_update_profile by passing invalid parameter.
2232 int utc_connection_update_profile_n(void)
2235 connection_profile_h profile = NULL;
2237 if (!telephony_supported && !wifi_supported && !ethernet_supported) {
2238 ret = connection_update_profile(NULL, NULL);
2239 CHECK_RETURN("connection_update_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2243 ret = connection_update_profile(NULL, NULL);
2244 CHECK_RETURN("connection_update_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2245 ret = connection_update_profile(NULL, profile);
2246 CHECK_RETURN("connection_update_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2247 ret = connection_update_profile(connection, NULL);
2248 CHECK_RETURN("connection_update_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2254 * @testcase utc_connection_open_profile_p
2257 * @description Opens a connection of profile, asynchronously.
2258 * @scenario Invoking connection_open_profile with valid parameter.
2260 int utc_connection_open_profile_p(void)
2262 connection_profile_h profile_h = NULL;
2263 int ret = test_get_any_profile(&profile_h);
2265 if (!telephony_supported && !wifi_supported && !bt_tethering_supported) {
2266 ret = connection_open_profile(connection, profile_temp, test_connection_opened_callback, NULL);
2267 CHECK_RETURN("connection_open_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2272 profile_temp = profile_h;
2274 ret = connection_open_profile(connection, profile_temp, test_connection_opened_callback, NULL);
2275 CHECK_RETURN("connection_open_profile", ret, CONNECTION_ERROR_NONE);
2276 test_connection_opened_callback(CONNECTION_ERROR_NONE, NULL);
2282 * @testcase utc_connection_open_profile_n
2285 * @description connection_open_profile should fail with invalid parameter.
2286 * @scenario Verify connection_open_profile by passing invalid parameter.
2288 int utc_connection_open_profile_n(void)
2291 connection_profile_h profile = NULL;
2293 if (!telephony_supported && !wifi_supported && !bt_tethering_supported) {
2294 ret = connection_open_profile(NULL, NULL, NULL, NULL);
2295 CHECK_RETURN("connection_open_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2299 ret = connection_open_profile(NULL, NULL, NULL, NULL);
2300 CHECK_RETURN("connection_open_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2301 ret = connection_open_profile(NULL, profile, test_connection_opened_callback, NULL);
2302 CHECK_RETURN("connection_open_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2303 ret = connection_open_profile(connection, profile, NULL, NULL);
2304 CHECK_RETURN("connection_open_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2310 * @testcase utc_connection_reset_profile_p
2313 * @description Resets the cellular profile.
2314 * @scenario Invoking connection_reset_profile with valid parameter.
2316 int utc_connection_reset_profile_p(void)
2318 if (telephony_supported) {
2319 connection_reset_profile(connection, CONNECTION_RESET_DEFAULT_PROFILE,
2320 0, test_connection_reset_profile_callback, NULL);
2321 CHECK_RETURN(CALLBACK_RETURN, g_CallbackRet, CONNECTION_ERROR_NONE);
2322 test_connection_reset_profile_callback(CONNECTION_ERROR_NONE, NULL);
2324 int ret = connection_reset_profile(connection, CONNECTION_RESET_DEFAULT_PROFILE,
2325 0, test_connection_reset_profile_callback, NULL);
2326 CHECK_RETURN("connection_reset_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2327 test_connection_reset_profile_callback(CONNECTION_ERROR_NONE, NULL);
2334 * @testcase utc_connection_reset_profile_n
2337 * @description connection_reset_profile should fail with invalid parameter.
2338 * @scenario Verify connection_reset_profile by passing invalid parameter.
2340 int utc_connection_reset_profile_n(void)
2342 if (telephony_supported) {
2343 int ret = connection_reset_profile(NULL, CONNECTION_RESET_DEFAULT_PROFILE,
2344 0, test_connection_reset_profile_callback, NULL);
2345 CHECK_RETURN("connection_reset_profile", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2347 int ret = connection_reset_profile(NULL, CONNECTION_RESET_DEFAULT_PROFILE,
2348 0, test_connection_reset_profile_callback, NULL);
2349 CHECK_RETURN("connection_reset_profile", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2355 * @testcase utc_connection_foreach_ipv6_address_p
2358 * @description Gets IPv6 addresses
2359 * @scenario Invoking connection_foreach_ipv6_address with valid parameter.
2361 int utc_connection_foreach_ipv6_address_p(void)
2365 if (telephony_supported) {
2366 ret = connection_foreach_ipv6_address(connection, CONNECTION_TYPE_CELLULAR,
2367 test_connection_ipv6_address_callback, NULL);
2368 CHECK_RETURN("connection_foreach_ipv6_address", ret, CONNECTION_ERROR_NONE);
2369 } else if (wifi_supported) {
2370 ret = connection_foreach_ipv6_address(connection, CONNECTION_TYPE_WIFI,
2371 test_connection_ipv6_address_callback, NULL);
2372 CHECK_RETURN("connection_foreach_ipv6_address", ret, CONNECTION_ERROR_NONE);
2373 } else if (ethernet_supported) {
2374 ret = connection_foreach_ipv6_address(connection, CONNECTION_TYPE_ETHERNET,
2375 test_connection_ipv6_address_callback, NULL);
2376 CHECK_RETURN("connection_foreach_ipv6_address", ret, CONNECTION_ERROR_NONE);
2378 ret = connection_foreach_ipv6_address(connection, CONNECTION_TYPE_WIFI,
2379 test_connection_ipv6_address_callback, NULL);
2380 CHECK_RETURN("connection_foreach_ipv6_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2387 * @testcase utc_connection_foreach_ipv6_address_n
2390 * @description connection_foreach_ipv6_address should fail with invalid parameter.
2391 * @scenario Verify connection_foreach_ipv6_address by passing invalid parameter.
2393 int utc_connection_foreach_ipv6_address_n(void)
2397 if (telephony_supported) {
2398 ret = connection_foreach_ipv6_address(NULL, CONNECTION_TYPE_CELLULAR,
2399 test_connection_ipv6_address_callback, NULL);
2400 CHECK_RETURN("connection_foreach_ipv6_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2401 } else if (wifi_supported) {
2402 ret = connection_foreach_ipv6_address(NULL, CONNECTION_TYPE_WIFI,
2403 test_connection_ipv6_address_callback, NULL);
2404 CHECK_RETURN("connection_foreach_ipv6_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2405 } else if (ethernet_supported) {
2406 ret = connection_foreach_ipv6_address(NULL, CONNECTION_TYPE_ETHERNET,
2407 test_connection_ipv6_address_callback, NULL);
2408 CHECK_RETURN("connection_foreach_ipv6_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2410 ret = connection_foreach_ipv6_address(NULL, CONNECTION_TYPE_WIFI,
2411 test_connection_ipv6_address_callback, NULL);
2412 CHECK_RETURN("connection_foreach_ipv6_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2419 * @testcase utc_connection_set_ethernet_cable_state_changed_cb_n
2422 * @description connection_set_ethernet_cable_state_changed_cb should fail with invalid parameter.
2423 * @scenario Verify connection_set_ethernet_cable_state_changed_cb by passing invalid parameter.
2425 int utc_connection_set_ethernet_cable_state_changed_cb_n(void)
2428 if (ethernet_supported == false) {
2429 ret = connection_set_ethernet_cable_state_changed_cb(NULL, NULL, NULL);
2430 CHECK_RETURN("connection_set_ethernet_cable_state_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2434 ret = connection_set_ethernet_cable_state_changed_cb(NULL,
2435 test_connection_set_ethernet_callback, NULL);
2436 CHECK_RETURN("connection_set_ethernet_cable_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2437 ret = connection_set_ethernet_cable_state_changed_cb(connection, NULL, NULL);
2438 CHECK_RETURN("connection_set_ethernet_cable_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2443 int utc_connection_set_ethernet_cable_state_changed_cb_p(void)
2446 if (ethernet_supported == false) {
2447 ret = connection_set_ethernet_cable_state_changed_cb(NULL, NULL, NULL);
2448 CHECK_RETURN("connection_set_ethernet_cable_state_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2452 ret = connection_set_ethernet_cable_state_changed_cb(connection, test_connection_set_ethernet_callback, NULL);
2453 CHECK_RETURN("connection_set_ethernet_cable_state_changed_cb", ret, CONNECTION_ERROR_NONE);
2459 * @testcase utc_connection_unset_ethernet_cable_state_changed_cb_n
2462 * @description connection_unset_ethernet_cable_state_changed_cb should fail with invalid parameter.
2463 * @scenario Verify connection_unset_ethernet_cable_state_changed_cb by passing invalid parameter.
2465 int utc_connection_unset_ethernet_cable_state_changed_cb_n(void)
2468 ret = connection_unset_ethernet_cable_state_changed_cb(NULL);
2470 if (ethernet_supported == false)
2471 CHECK_RETURN("connection_unset_ethernet_cable_state_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2473 CHECK_RETURN("connection_unset_ethernet_cable_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2477 int utc_connection_unset_ethernet_cable_state_changed_cb_p(void)
2480 ret = connection_unset_ethernet_cable_state_changed_cb(connection);
2482 if (ethernet_supported == false)
2483 CHECK_RETURN("connection_unset_ethernet_cable_state_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2485 CHECK_RETURN("connection_unset_ethernet_cable_state_changed_cb", ret, CONNECTION_ERROR_NONE);
2490 * @testcase utc_connection_set_internet_state_changed_cb_p
2493 * @description Set internet state changed callback.
2494 * @scenario Verify connection_set_internet_state_changed_cb by passing valid parameter.
2496 int utc_connection_set_internet_state_changed_cb_p(void)
2499 ret = connection_set_internet_state_changed_cb(connection,
2500 test_connection_internet_state_changed_callback, NULL);
2502 CHECK_RETURN("connection_set_internet_state_changed_cb", ret, CONNECTION_ERROR_NONE);
2508 * @testcase utc_connection_set_internet_state_changed_cb_n1
2511 * @description connection_set_internet_state_changed_cb should fail when connection is NULL.
2512 * @scenario Verify connection_set_internet_state_changed_cb by passing connection as NULL.
2514 int utc_connection_set_internet_state_changed_cb_n1(void)
2517 ret = connection_set_internet_state_changed_cb(NULL,
2518 test_connection_internet_state_changed_callback, NULL);
2520 CHECK_RETURN("connection_set_internet_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2526 * @testcase utc_connection_set_internet_state_changed_cb_n2
2529 * @description connection_set_internet_state_changed_cb should fail when callback is NULL.
2530 * @scenario Verify connection_set_internet_state_changed_cb by passing callback as NULL.
2532 int utc_connection_set_internet_state_changed_cb_n2(void)
2535 ret = connection_set_internet_state_changed_cb(connection, NULL, NULL);
2537 CHECK_RETURN("connection_set_internet_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2543 * @testcase utc_connection_unset_internet_state_changed_cb_p
2546 * @description Unset internet state changed callback.
2547 * @scenario Verify connection_unset_internet_state_changed_cb by passing valid parameter.
2549 int utc_connection_unset_internet_state_changed_cb_p(void)
2552 ret = connection_unset_internet_state_changed_cb(connection);
2554 CHECK_RETURN("connection_unset_internet_state_changed_cb", ret, CONNECTION_ERROR_NONE);
2560 * @testcase utc_connection_unset_internet_state_changed_cb_n
2563 * @description connection_unset_internet_state_changed_cb should fail when connection is NULL.
2564 * @scenario Verify connection_unset_internet_state_changed_cb by passing connection as NULL.
2566 int utc_connection_unset_internet_state_changed_cb_n(void)
2569 ret = connection_unset_internet_state_changed_cb(NULL);
2571 CHECK_RETURN("connection_unset_internet_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2577 * @testcase utc_connection_destroy_p
2580 * @description Destroys the connection handle.
2581 * @scenario Invoking connection_destroy with valid parameter.
2583 int utc_connection_destroy_p(void)
2585 int ret = connection_destroy(connection);
2587 if (all_features_not_supported)
2588 CHECK_RETURN("connection_destroy", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2590 CHECK_RETURN("connection_destroy", ret, CONNECTION_ERROR_NONE);
2595 * @testcase utc_connection_destroy_n
2598 * @description connection_destroy should fail with invalid parameter.
2599 * @scenario Verify connection_destroy by passing invalid parameter.
2601 int utc_connection_destroy_n(void)
2603 int ret = connection_destroy(NULL);
2605 if (all_features_not_supported)
2606 CHECK_RETURN("connection_destroy", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2608 CHECK_RETURN("connection_destroy", ret, CONNECTION_ERROR_INVALID_PARAMETER);