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.
16 #include "utc-connection-common.h"
18 //& set: ConnectionProfile
20 static void test_profile_state_changed_cb(connection_profile_state_e state, void* user_data)
23 connection_profile_h profile = user_data;
28 int ret = connection_profile_get_name(profile, &profile_name);
29 PRINT_RETURN("connection_profile_get_name", ret);
30 if (ret != CONNECTION_ERROR_NONE) {
31 FREE_RESOURCE(profile_name);
35 FREE_RESOURCE(profile_name);
39 * @function utc_connection_profile_startup
40 * @description Called before each test
44 void utc_connection_profile_startup(void)
46 wifi_supported = connection_check_feature_supported(FEATURE_WIFI);
47 telephony_supported = connection_check_feature_supported(FEATURE_TELEPHONY);
48 bt_tethering_supported = connection_check_feature_supported(FEATURE_BT_TETHERING);
49 ethernet_supported = connection_check_feature_supported(FEATURE_ETHERNET);
51 if (telephony_supported == false && wifi_supported == false
52 && bt_tethering_supported == false && ethernet_supported == false) {
53 all_features_not_supported = true;
57 int ret = connection_create(&connection);
58 PRINT_RETURN("connection_create", ret);
60 if (ret != CONNECTION_ERROR_NONE)
63 if (telephony_supported) {
64 if (!profile_cellular) {
65 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, "Net", &profile_cellular);
66 PRINT_RETURN("connection_profile_create", ret);
72 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_WIFI, NULL, &profile_wifi);
73 PRINT_RETURN("connection_profile_create", ret);
79 * @function utc_connection_profile_cleanup
80 * @description Called after each test
84 void utc_connection_profile_cleanup(void)
88 if (profile_cellular) {
89 ret = connection_profile_destroy(profile_cellular);
90 PRINT_RETURN("connection_profile_destroy", ret);
91 if (ret == CONNECTION_ERROR_NONE)
92 profile_cellular = NULL;
96 ret = connection_profile_destroy(profile_wifi);
97 PRINT_RETURN("connection_profile_destroy", ret);
98 if (ret == CONNECTION_ERROR_NONE)
103 ret = connection_profile_destroy(profile_temp);
104 PRINT_RETURN("connection_profile_destroy", ret);
105 if (ret == CONNECTION_ERROR_NONE)
110 ret = connection_destroy(connection);
111 PRINT_RETURN("connection_destroy", ret);
112 if (ret == CONNECTION_ERROR_NONE)
117 /* Common profile operations. */
120 * @testcase utc_connection_profile_create_p
123 * @description Creates a profile handle.
124 * @scenario Invoking connection_profile_create with valid parameter.
126 int utc_connection_profile_create_p(void)
130 if (profile_cellular) {
131 ret = connection_profile_destroy(profile_cellular);
132 PRINT_RETURN("connection_profile_destroy", ret);
133 profile_cellular = NULL;
136 if (telephony_supported) {
137 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, "Net", &profile_cellular);
138 CHECK_RETURN("connection_profile_create", ret, CONNECTION_ERROR_NONE);
140 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, "Net", &profile_cellular);
141 CHECK_RETURN("connection_profile_create", ret, CONNECTION_ERROR_NOT_SUPPORTED);
148 * @testcase utc_connection_profile_create_n
151 * @description should not creates a profile handle.
152 * @scenario Verify connection_profile_create by passing invalid parameter.
154 int utc_connection_profile_create_n(void)
157 connection_profile_h profile_temp = NULL;
159 if (telephony_supported == false && wifi_supported == false) {
160 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, "Net", NULL);
161 CHECK_RETURN("connection_profile_create", ret, CONNECTION_ERROR_NOT_SUPPORTED);
165 if (telephony_supported) {
166 ret = connection_profile_create(-1, "Net", &profile_temp);
167 CHECK_RETURN("connection_profile_create", ret, CONNECTION_ERROR_INVALID_PARAMETER);
168 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, NULL, &profile_temp);
169 CHECK_RETURN("connection_profile_create", ret, CONNECTION_ERROR_INVALID_PARAMETER);
170 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, "Net", NULL);
171 CHECK_RETURN("connection_profile_create", ret, CONNECTION_ERROR_INVALID_PARAMETER);
173 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, "Net", NULL);
174 CHECK_RETURN("connection_profile_create", ret, CONNECTION_ERROR_NOT_SUPPORTED);
181 * @testcase utc_connection_profile_clone_p
184 * @description Clones a profile handle.
185 * @scenario Verify connection_profile_clone with valid parameter and destroy it.
187 int utc_connection_profile_clone_p(void)
189 connection_profile_h profile_temp = NULL;
191 connection_profile_h profile_to_be_cloned = NULL;
193 if (all_features_not_supported) {
194 ret = connection_profile_clone(&profile_temp, profile_to_be_cloned);
195 CHECK_RETURN("connection_profile_clone", ret, CONNECTION_ERROR_NOT_SUPPORTED);
199 test_get_any_profile(&profile_to_be_cloned);
200 if (profile_to_be_cloned != NULL) {
201 ret = connection_profile_clone(&profile_temp, profile_to_be_cloned);
202 CHECK_RETURN("connection_profile_clone", ret, CONNECTION_ERROR_NONE);
204 ret = connection_profile_destroy(profile_to_be_cloned);
205 PRINT_RETURN("connection_profile_destroy", ret);
206 ret = connection_profile_destroy(profile_temp);
207 PRINT_RETURN("connection_profile_destroy", ret);
214 * @testcase utc_connection_profile_clone_n
217 * @description should not Clones a profile handle.
218 * @scenario Verify connection_profile_clone by passing invalid parameters.
220 int utc_connection_profile_clone_n(void)
223 connection_profile_h profile_temp = NULL;
224 connection_profile_h profile_inval = NULL;
226 if (all_features_not_supported) {
227 ret = connection_profile_clone(NULL, profile_inval);
228 CHECK_RETURN("connection_profile_clone", ret, CONNECTION_ERROR_NOT_SUPPORTED);
232 ret = connection_profile_clone(NULL, profile_inval);
233 CHECK_RETURN("connection_profile_clone", ret, CONNECTION_ERROR_INVALID_PARAMETER);
234 ret = connection_profile_clone(NULL, profile_cellular);
235 CHECK_RETURN("connection_profile_clone", ret, CONNECTION_ERROR_INVALID_PARAMETER);
236 ret = connection_profile_clone(&profile_temp, profile_inval);
237 CHECK_RETURN("connection_profile_clone", ret, CONNECTION_ERROR_INVALID_PARAMETER);
243 * @testcase utc_connection_profile_get_name_p
246 * @description Gets the profile name.
247 * @scenario Get the profile name by invoking connection_profile_get_name with a valid parameter.
249 int utc_connection_profile_get_name_p(void)
254 if (all_features_not_supported) {
255 ret = connection_profile_get_name(profile_temp, &name);
257 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_NOT_SUPPORTED);
261 test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_CELLULAR);
262 ret = connection_profile_get_name(profile_temp, &name);
263 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_NONE);
265 test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_WIFI);
266 ret = connection_profile_get_name(profile_temp, &name);
267 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_NONE);
269 test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
270 ret = connection_profile_get_name(profile_temp, &name);
272 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_NONE);
278 * @testcase utc_connection_profile_get_name_n
281 * @description should not return profile handle.
282 * @scenario Verify connection_profile_get_name by passing invalid profile handle.
284 int utc_connection_profile_get_name_n(void)
288 connection_profile_h profile_inval = NULL;
290 if (all_features_not_supported) {
291 ret = connection_profile_get_name(profile_inval, NULL);
293 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_NOT_SUPPORTED);
297 ret = connection_profile_get_name(profile_inval, NULL);
298 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_INVALID_PARAMETER);
299 ret = connection_profile_get_name(profile_inval, &name);
301 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_INVALID_PARAMETER);
302 ret = connection_profile_get_name(profile_cellular, NULL);
303 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_INVALID_PARAMETER);
309 * @testcase utc_connection_profile_get_id_p
312 * @description Gets the profile ID.
313 * @scenario Invoking connection_profile_get_id with valid profile handle.
315 int utc_connection_profile_get_id_p(void)
318 connection_profile_h profile_h = NULL;
319 int ret = test_get_any_profile(&profile_h);
321 if (all_features_not_supported) {
322 ret = connection_profile_get_id(profile_temp, &id);
324 CHECK_RETURN("connection_profile_get_id", ret, CONNECTION_ERROR_NOT_SUPPORTED);
328 profile_temp = profile_h;
329 assert(profile_temp);
331 ret = connection_profile_get_id(profile_temp, &id);
333 CHECK_RETURN("connection_profile_get_id", ret, CONNECTION_ERROR_NONE);
339 * @testcase utc_connection_profile_get_id_n
342 * @description should not return profile ID.
343 * @scenario Verify connection_profile_get_id by passing invalid parameter..
345 int utc_connection_profile_get_id_n(void)
349 connection_profile_h profile_inval = NULL;
351 if (all_features_not_supported) {
352 ret = connection_profile_get_id(profile_inval, NULL);
353 CHECK_RETURN("connection_profile_get_id", ret, CONNECTION_ERROR_NOT_SUPPORTED);
357 ret = connection_profile_get_id(profile_inval, NULL);
358 CHECK_RETURN("connection_profile_get_id", ret, CONNECTION_ERROR_INVALID_PARAMETER);
359 ret = connection_profile_get_id(profile_inval, &id);
360 CHECK_RETURN("connection_profile_get_id", ret, CONNECTION_ERROR_INVALID_PARAMETER);
361 ret = connection_profile_get_id(profile_cellular, NULL);
362 CHECK_RETURN("connection_profile_get_id", ret, CONNECTION_ERROR_INVALID_PARAMETER);
369 * @testcase utc_connection_profile_get_type_p
372 * @description Gets the network type.
373 * @scenario connection_profile_get_type should return profile type.
375 int utc_connection_profile_get_type_p(void)
377 connection_profile_type_e type;
378 int ret = test_get_any_profile(&profile_temp);
380 if (all_features_not_supported) {
381 ret = connection_profile_get_type(profile_temp, &type);
382 CHECK_RETURN("connection_profile_get_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
386 assert(profile_temp);
387 ret = connection_profile_get_type(profile_temp, &type);
388 CHECK_RETURN("connection_profile_get_type", ret, CONNECTION_ERROR_NONE);
394 * @testcase utc_connection_profile_get_type_n
397 * @description should not get the network type.
398 * @scenario Verify connection_profile_get_type by passing invalid parameter.
400 int utc_connection_profile_get_type_n(void)
403 connection_profile_type_e type;
404 connection_profile_h profile_inval = NULL;
406 if (all_features_not_supported) {
407 ret = connection_profile_get_type(profile_inval, NULL);
408 CHECK_RETURN("connection_profile_get_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
412 ret = connection_profile_get_type(profile_inval, NULL);
413 CHECK_RETURN("connection_profile_get_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
414 ret = connection_profile_get_type(profile_inval, &type);
415 CHECK_RETURN("connection_profile_get_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
416 ret = connection_profile_get_type(profile_cellular, NULL);
417 CHECK_RETURN("connection_profile_get_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
423 * @testcase utc_connection_profile_get_network_interface_name_p
426 * @description Gets the name of the network interface, e.g. eth0 and pdp0.
427 * @scenario Invoking connection_profile_get_network_interface_name with valid parameter.
429 int utc_connection_profile_get_network_interface_name_p(void)
432 int ret = test_get_any_profile(&profile_temp);
434 if (all_features_not_supported) {
435 ret = connection_profile_get_network_interface_name(profile_temp, &name);
437 CHECK_RETURN("connection_profile_get_network_interface_name", ret, CONNECTION_ERROR_NOT_SUPPORTED);
441 assert(profile_temp);
442 ret = connection_profile_get_network_interface_name(profile_temp, &name);
444 CHECK_RETURN("connection_profile_get_network_interface_name", ret, CONNECTION_ERROR_NONE);
450 * @testcase utc_connection_profile_get_network_interface_name_n
453 * @description should not get the name of the network interface.
454 * @scenario Verify connection_profile_get_network_interface_name by passing invalid parameter.
456 int utc_connection_profile_get_network_interface_name_n(void)
460 connection_profile_h profile_inval = NULL;
462 if (all_features_not_supported) {
463 ret = connection_profile_get_network_interface_name(profile_inval, NULL);
464 CHECK_RETURN("connection_profile_get_network_interface_name", ret, CONNECTION_ERROR_NOT_SUPPORTED);
468 ret = connection_profile_get_network_interface_name(profile_inval, NULL);
469 CHECK_RETURN("connection_profile_get_network_interface_name", ret, CONNECTION_ERROR_INVALID_PARAMETER);
470 ret = connection_profile_get_network_interface_name(profile_inval, &name);
471 CHECK_RETURN("connection_profile_get_network_interface_name", ret, CONNECTION_ERROR_INVALID_PARAMETER);
472 ret = connection_profile_get_network_interface_name(profile_cellular, NULL);
473 CHECK_RETURN("connection_profile_get_network_interface_name", ret, CONNECTION_ERROR_INVALID_PARAMETER);
479 * @testcase utc_connection_profile_get_state_p
482 * @description Gets the network type and the state of the profile.
483 * @scenario Verify connection_profile_get_state with valid parameter.
485 int utc_connection_profile_get_state_p(void)
487 connection_profile_state_e state;
488 int ret = test_get_any_profile(&profile_temp);
490 if (all_features_not_supported) {
491 ret = connection_profile_get_state(profile_temp, &state);
492 CHECK_RETURN("connection_profile_get_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
496 assert(profile_temp);
497 ret = connection_profile_get_state(profile_temp, &state);
498 CHECK_RETURN("connection_profile_get_state", ret, CONNECTION_ERROR_NONE);
504 * @testcase utc_connection_profile_get_state_n
507 * @description should not get the state of the profile.
508 * @scenario Verify connection_profile_get_state by passing invalid parameter.
510 int utc_connection_profile_get_state_n(void)
513 connection_profile_state_e state;
514 connection_profile_h profile_inval = NULL;
516 if (all_features_not_supported) {
517 ret = connection_profile_get_state(profile_inval, NULL);
518 CHECK_RETURN("connection_profile_get_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
522 ret = connection_profile_get_state(profile_inval, NULL);
523 CHECK_RETURN("connection_profile_get_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
524 ret = connection_profile_get_state(profile_inval, &state);
525 CHECK_RETURN("connection_profile_get_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
526 ret = connection_profile_get_state(profile_cellular, NULL);
527 CHECK_RETURN("connection_profile_get_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
533 * @testcase utc_connection_profile_get_ip_config_type_p
536 * @description Gets the IP config type.Should return the type of the IP config.
537 * @scenario Invoking connection_profile_get_ip_config_type with valid parameter.
539 int utc_connection_profile_get_ip_config_type_p(void)
541 connection_ip_config_type_e type;
542 int ret = test_get_any_profile(&profile_temp);
544 if (all_features_not_supported) {
545 ret = connection_profile_get_ip_config_type(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &type);
546 CHECK_RETURN("connection_profile_get_ip_config_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
550 assert(profile_temp);
551 ret = connection_profile_get_ip_config_type(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &type);
552 CHECK_RETURN("connection_profile_get_ip_config_type", ret, CONNECTION_ERROR_NONE);
558 * @testcase utc_connection_profile_get_ip_config_type_n
561 * @description should not return the type of the IP config.
562 * @scenario Verify connection_profile_get_ip_config_type by passing invalid parameter..
564 int utc_connection_profile_get_ip_config_type_n(void)
567 connection_ip_config_type_e type;
568 connection_profile_h profile_inval = NULL;
570 if (all_features_not_supported) {
571 ret = connection_profile_get_ip_config_type(profile_inval, -1, NULL);
572 CHECK_RETURN("connection_profile_get_ip_config_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
576 ret = connection_profile_get_ip_config_type(profile_inval, -1, NULL);
577 CHECK_RETURN("connection_profile_get_ip_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
578 ret = connection_profile_get_ip_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, &type);
579 CHECK_RETURN("connection_profile_get_ip_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
580 ret = connection_profile_get_ip_config_type(profile_cellular, -1, &type);
581 CHECK_RETURN("connection_profile_get_ip_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
582 ret = connection_profile_get_ip_config_type(profile_cellular, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
583 CHECK_RETURN("connection_profile_get_ip_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
584 ret = connection_profile_get_ip_config_type(profile_inval, -1, &type);
585 CHECK_RETURN("connection_profile_get_ip_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
586 ret = connection_profile_get_ip_config_type(profile_cellular, -1, NULL);
587 CHECK_RETURN("connection_profile_get_ip_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
593 * @testcase utc_connection_profile_get_ip_address_p
596 * @description Gets the IP address.Shoudl return IP Address.
597 * @scenario Invoking connection_profile_get_ip_address with valid parameter.
599 int utc_connection_profile_get_ip_address_p(void)
601 char *ip_addr = NULL;
602 int ret = test_get_any_profile(&profile_temp);
604 if (all_features_not_supported) {
605 ret = connection_profile_get_ip_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
606 FREE_RESOURCE(ip_addr);
607 CHECK_RETURN("connection_profile_get_ip_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
611 assert(profile_temp);
612 ret = connection_profile_get_ip_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
613 FREE_RESOURCE(ip_addr);
614 CHECK_RETURN("connection_profile_get_ip_address", ret, CONNECTION_ERROR_NONE);
620 * @testcase utc_connection_profile_get_ip_address_n
623 * @description should not return IP Address.
624 * @scenario Verify connection_profile_get_ip_address by passing invalid parameter.
626 int utc_connection_profile_get_ip_address_n(void)
629 char *ip_addr = NULL;
630 connection_profile_h profile_inval = NULL;
632 if (all_features_not_supported) {
633 ret = connection_profile_get_ip_address(profile_inval, -1, NULL);
634 CHECK_RETURN("connection_profile_get_ip_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
638 ret = connection_profile_get_ip_address(profile_inval, -1, NULL);
639 CHECK_RETURN("connection_profile_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
640 ret = connection_profile_get_ip_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
641 CHECK_RETURN("connection_profile_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
642 ret = connection_profile_get_ip_address(profile_cellular, -1, &ip_addr);
643 CHECK_RETURN("connection_profile_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
644 ret = connection_profile_get_ip_address(profile_cellular, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
645 CHECK_RETURN("connection_profile_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
646 ret = connection_profile_get_ip_address(profile_inval, -1, &ip_addr);
647 CHECK_RETURN("connection_profile_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
648 ret = connection_profile_get_ip_address(profile_cellular, -1, NULL);
649 CHECK_RETURN("connection_profile_get_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
655 * @testcase utc_connection_profile_get_subnet_mask_p
658 * @description Gets the Subnet Mask.
659 * @scenario Invoking connection_profile_get_subnet_mask with valid parameter.
661 int utc_connection_profile_get_subnet_mask_p(void)
663 char *ip_addr = NULL;
664 int ret = test_get_any_profile(&profile_temp);
666 if (all_features_not_supported) {
667 ret = connection_profile_get_subnet_mask(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
668 FREE_RESOURCE(ip_addr);
669 CHECK_RETURN("connection_profile_get_subnet_mask", ret, CONNECTION_ERROR_NOT_SUPPORTED);
673 assert(profile_temp);
674 ret = connection_profile_get_subnet_mask(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
675 FREE_RESOURCE(ip_addr);
676 CHECK_RETURN("connection_profile_get_subnet_mask", ret, CONNECTION_ERROR_NONE);
682 * @testcase utc_connection_profile_get_subnet_mask_n
685 * @description should not return any subnet mask.
686 * @scenario Verify connection_profile_get_subnet_mask by passing invalid parameter.
688 int utc_connection_profile_get_subnet_mask_n(void)
691 char *ip_addr = NULL;
692 connection_profile_h profile_inval = NULL;
694 if (all_features_not_supported) {
695 ret = connection_profile_get_subnet_mask(profile_inval, -1, NULL);
696 CHECK_RETURN("connection_profile_get_subnet_mask", ret, CONNECTION_ERROR_NOT_SUPPORTED);
700 ret = connection_profile_get_subnet_mask(profile_inval, -1, NULL);
701 CHECK_RETURN("connection_profile_get_subnet_mask", ret, CONNECTION_ERROR_INVALID_PARAMETER);
702 ret = connection_profile_get_subnet_mask(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
703 CHECK_RETURN("connection_profile_get_subnet_mask", ret, CONNECTION_ERROR_INVALID_PARAMETER);
704 ret = connection_profile_get_subnet_mask(profile_cellular, -1, &ip_addr);
705 CHECK_RETURN("connection_profile_get_subnet_mask", ret, CONNECTION_ERROR_INVALID_PARAMETER);
706 ret = connection_profile_get_subnet_mask(profile_cellular, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
707 CHECK_RETURN("connection_profile_get_subnet_mask", ret, CONNECTION_ERROR_INVALID_PARAMETER);
708 ret = connection_profile_get_subnet_mask(profile_inval, -1, &ip_addr);
709 CHECK_RETURN("connection_profile_get_subnet_mask", ret, CONNECTION_ERROR_INVALID_PARAMETER);
710 ret = connection_profile_get_subnet_mask(profile_cellular, -1, NULL);
711 CHECK_RETURN("connection_profile_get_subnet_mask", ret, CONNECTION_ERROR_INVALID_PARAMETER);
717 * @testcase utc_connection_profile_get_gateway_address_p
720 * @description Gets the Gateway address.
721 * @scenario Invoking connection_profile_get_gateway_address with valid parameter.
723 int utc_connection_profile_get_gateway_address_p(void)
725 char *ip_addr = NULL;
726 int ret = test_get_any_profile(&profile_temp);
728 if (all_features_not_supported) {
729 ret = connection_profile_get_gateway_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
730 FREE_RESOURCE(ip_addr);
731 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
735 assert(profile_temp);
736 ret = connection_profile_get_gateway_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
737 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_NONE);
739 ret = connection_profile_get_gateway_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV6, &ip_addr);
740 FREE_RESOURCE(ip_addr);
741 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_NONE);
747 * @testcase utc_connection_profile_get_gateway_address_n
750 * @description connection_profile_get_gateway_address should fail with invalid parameter.
751 * @scenario Verify connection_profile_get_gateway_address by passing invalid parameter.
753 int utc_connection_profile_get_gateway_address_n(void)
756 char *ip_addr = NULL;
757 connection_profile_h profile_inval = NULL;
759 if (all_features_not_supported) {
760 ret = connection_profile_get_gateway_address(profile_inval, -1, NULL);
761 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
765 ret = connection_profile_get_gateway_address(profile_inval, -1, NULL);
766 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
767 ret = connection_profile_get_gateway_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
768 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
769 ret = connection_profile_get_gateway_address(profile_cellular, -1, &ip_addr);
770 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
771 ret = connection_profile_get_gateway_address(profile_cellular, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
772 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
773 ret = connection_profile_get_gateway_address(profile_inval, -1, &ip_addr);
774 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
775 ret = connection_profile_get_gateway_address(profile_cellular, -1, NULL);
776 CHECK_RETURN("connection_profile_get_gateway_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
782 * @testcase utc_connection_profile_get_dhcp_server_address_p
785 * @description Gets the DHCP server address.
786 * @scenario Invoking connection_profile_get_dhcp_server_address with valid parameter.
788 int utc_connection_profile_get_dhcp_server_address_p(void)
790 char *ip_addr = NULL;
791 int ret = test_get_any_profile(&profile_temp);
793 if (all_features_not_supported) {
794 ret = connection_profile_get_dhcp_server_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
795 FREE_RESOURCE(ip_addr);
796 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
800 assert(profile_temp);
801 ret = connection_profile_get_dhcp_server_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV6, &ip_addr);
802 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED);
804 ret = connection_profile_get_dhcp_server_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
805 FREE_RESOURCE(ip_addr);
806 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_NONE);
812 * @testcase utc_connection_profile_get_gateway_address_n
815 * @description connection_profile_get_dhcp_server_address should fail with invalid parameter.
816 * @scenario Verify connection_profile_get_dhcp_server_address by passing invalid parameter.
818 int utc_connection_profile_get_dhcp_server_address_n(void)
821 char *ip_addr = NULL;
822 connection_profile_h profile_inval = NULL;
824 if (all_features_not_supported) {
825 ret = connection_profile_get_dhcp_server_address(profile_inval, -1, NULL);
826 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
830 ret = connection_profile_get_dhcp_server_address(profile_inval, -1, NULL);
831 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
832 ret = connection_profile_get_dhcp_server_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
833 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
834 ret = connection_profile_get_dhcp_server_address(profile_cellular, -1, &ip_addr);
835 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
836 ret = connection_profile_get_dhcp_server_address(profile_cellular, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
837 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
838 ret = connection_profile_get_dhcp_server_address(profile_inval, -1, &ip_addr);
839 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
840 ret = connection_profile_get_dhcp_server_address(profile_cellular, -1, NULL);
841 CHECK_RETURN("connection_profile_get_dhcp_server_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
847 * @testcase utc_connection_profile_get_dhcp_lease_duration_p
850 * @description Gets the DHCP lease duration.
851 * @scenario Invoking connection_profile_get_dhcp_lease_duration with valid parameter.
853 int utc_connection_profile_get_dhcp_lease_duration_p(void)
855 int dhcp_lease_duration = 0;
856 int ret = test_get_any_profile(&profile_temp);
858 if (all_features_not_supported) {
859 ret = connection_profile_get_dhcp_lease_duration(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &dhcp_lease_duration);
860 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_NOT_SUPPORTED);
864 assert(profile_temp);
865 ret = connection_profile_get_dhcp_lease_duration(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV6, &dhcp_lease_duration);
866 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED);
868 ret = connection_profile_get_dhcp_lease_duration(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &dhcp_lease_duration);
869 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_NONE);
875 * @testcase utc_connection_profile_get_dhcp_lease_duration_n
878 * @description connection_profile_get_dhcp_lease_duration should fail with invalid parameter.
879 * @scenario Verify connection_profile_get_dhcp_lease_duration by passing invalid parameter.
881 int utc_connection_profile_get_dhcp_lease_duration_n(void)
884 int dhcp_lease_duration = 0;
885 connection_profile_h profile_inval = NULL;
887 if (all_features_not_supported) {
888 ret = connection_profile_get_dhcp_lease_duration(profile_inval, -1, NULL);
889 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_NOT_SUPPORTED);
890 ret = connection_profile_get_dhcp_lease_duration(profile_wifi, CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED, &dhcp_lease_duration);
891 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_NOT_SUPPORTED);
895 ret = connection_profile_get_dhcp_lease_duration(profile_inval, -1, NULL);
896 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_INVALID_PARAMETER);
897 ret = connection_profile_get_dhcp_lease_duration(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, &dhcp_lease_duration);
898 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_INVALID_PARAMETER);
899 ret = connection_profile_get_dhcp_lease_duration(profile_cellular, -1, &dhcp_lease_duration);
900 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_INVALID_PARAMETER);
901 ret = connection_profile_get_dhcp_lease_duration(profile_cellular, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
902 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_INVALID_PARAMETER);
903 ret = connection_profile_get_dhcp_lease_duration(profile_inval, -1, &dhcp_lease_duration);
904 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_INVALID_PARAMETER);
905 ret = connection_profile_get_dhcp_lease_duration(profile_cellular, -1, NULL);
906 CHECK_RETURN("connection_profile_get_dhcp_lease_duration", ret, CONNECTION_ERROR_INVALID_PARAMETER);
912 * @testcase utc_connection_profile_get_dns_address_p
915 * @description Gets the DNS address.
916 * @scenario Invoking connection_profile_get_dns_address with valid parameter.
918 int utc_connection_profile_get_dns_address_p(void)
920 char *ip_addr = NULL;
921 int ret = test_get_any_profile(&profile_temp);
923 if (all_features_not_supported) {
924 ret = connection_profile_get_dns_address(profile_temp, 1, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
925 FREE_RESOURCE(ip_addr);
926 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
930 assert(profile_temp);
931 ret = connection_profile_get_dns_address(profile_temp, 1, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
932 FREE_RESOURCE(ip_addr);
933 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_NONE);
934 ret = connection_profile_get_dns_address(profile_temp, 2, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
935 FREE_RESOURCE(ip_addr);
936 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_NONE);
942 * @testcase utc_connection_profile_get_dns_address_n
945 * @description connection_profile_get_dns_address should fail with invalid parameter.
946 * @scenario Verify connection_profile_get_dns_address by passing invalid parameter.
948 int utc_connection_profile_get_dns_address_n(void)
951 char *ip_addr = NULL;
952 connection_profile_h profile_inval = NULL;
954 if (all_features_not_supported) {
955 ret = connection_profile_get_dns_address(profile_inval, 1, -1, NULL);
956 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
960 ret = connection_profile_get_dns_address(profile_inval, 1, -1, NULL);
961 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
962 ret = connection_profile_get_dns_address(profile_inval, 1, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
963 FREE_RESOURCE(ip_addr);
964 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
965 ret = connection_profile_get_dns_address(profile_cellular, 1, -1, &ip_addr);
966 FREE_RESOURCE(ip_addr);
967 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
968 ret = connection_profile_get_dns_address(profile_cellular, 1, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
969 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
970 ret = connection_profile_get_dns_address(profile_inval, 1, -1, &ip_addr);
971 FREE_RESOURCE(ip_addr);
972 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
973 ret = connection_profile_get_dns_address(profile_cellular, 1, -1, NULL);
974 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
975 ret = connection_profile_get_dns_address(profile_cellular, 99, CONNECTION_ADDRESS_FAMILY_IPV6, &ip_addr);
976 FREE_RESOURCE(ip_addr);
977 CHECK_RETURN("connection_profile_get_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
983 * @testcase utc_connection_profile_get_proxy_type_p
986 * @description Sets the Proxy type.
987 * @scenario Invoking connection_profile_set_proxy_type with valid parameter.
989 int utc_connection_profile_get_proxy_type_p(void)
991 connection_proxy_type_e type;
992 int ret = test_get_any_profile(&profile_temp);
994 if (all_features_not_supported) {
995 ret = connection_profile_get_proxy_type(profile_temp, &type);
996 CHECK_RETURN("connection_profile_get_proxy_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1000 assert(profile_temp);
1001 ret = connection_profile_set_proxy_type(profile_temp, CONNECTION_PROXY_TYPE_MANUAL);
1002 CHECK_RETURN("connection_profile_get_proxy_type", ret, CONNECTION_ERROR_NONE);
1003 ret = connection_profile_get_proxy_type(profile_temp, &type);
1004 CHECK_RETURN("connection_profile_get_proxy_type", ret, CONNECTION_ERROR_NONE);
1010 * @testcase utc_connection_profile_get_proxy_type_n
1013 * @description connection_profile_get_proxy_type should fail with invalid parameter.
1014 * @scenario Verify connection_profile_get_proxy_type by passing invalid parameter.
1016 int utc_connection_profile_get_proxy_type_n(void)
1019 connection_proxy_type_e type;
1020 connection_profile_h profile_inval = NULL;
1022 if (all_features_not_supported) {
1023 ret = connection_profile_get_proxy_type(profile_inval, NULL);
1024 CHECK_RETURN("connection_profile_get_proxy_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1028 ret = connection_profile_get_proxy_type(profile_inval, NULL);
1029 CHECK_RETURN("connection_profile_get_proxy_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1030 ret = connection_profile_get_proxy_type(profile_inval, &type);
1031 CHECK_RETURN("connection_profile_get_proxy_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1032 ret = connection_profile_get_proxy_type(profile_cellular, NULL);
1033 CHECK_RETURN("connection_profile_get_proxy_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1039 * @testcase utc_connection_profile_get_proxy_address_p
1042 * @description Gets the Proxy address.
1043 * @scenario Invoking connection_profile_get_proxy_address with valid parameter.
1045 int utc_connection_profile_get_proxy_address_p(void)
1047 char *ip_addr = NULL;
1048 int ret = test_get_any_profile(&profile_temp);
1050 if (all_features_not_supported) {
1051 ret = connection_profile_get_proxy_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
1052 FREE_RESOURCE(ip_addr);
1053 CHECK_RETURN("connection_profile_get_proxy_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1057 assert(profile_temp);
1058 ret = connection_profile_get_proxy_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
1059 FREE_RESOURCE(ip_addr);
1060 CHECK_RETURN("connection_profile_get_proxy_address", ret, CONNECTION_ERROR_NONE);
1066 * @testcase utc_connection_profile_get_proxy_address_n
1069 * @description connection_profile_get_proxy_address should fail with invalid parameter.
1070 * @scenario Verify connection_profile_get_proxy_address by passing invalid parameter.
1072 int utc_connection_profile_get_proxy_address_n(void)
1075 char *ip_addr = NULL;
1076 connection_profile_h profile_inval = NULL;
1078 if (all_features_not_supported) {
1079 ret = connection_profile_get_proxy_address(profile_inval, -1, NULL);
1080 CHECK_RETURN("connection_profile_get_proxy_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1084 ret = connection_profile_get_proxy_address(profile_inval, -1, NULL);
1085 CHECK_RETURN("connection_profile_get_proxy_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1086 ret = connection_profile_get_proxy_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, &ip_addr);
1087 CHECK_RETURN("connection_profile_get_proxy_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1088 ret = connection_profile_get_proxy_address(profile_cellular, -1, &ip_addr);
1089 CHECK_RETURN("connection_profile_get_proxy_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1090 ret = connection_profile_get_proxy_address(profile_cellular, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1091 CHECK_RETURN("connection_profile_get_proxy_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1092 ret = connection_profile_get_proxy_address(profile_inval, -1, &ip_addr);
1093 CHECK_RETURN("connection_profile_get_proxy_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1094 ret = connection_profile_get_proxy_address(profile_cellular, -1, NULL);
1095 CHECK_RETURN("connection_profile_get_proxy_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1101 * @testcase utc_connection_profile_set_ip_config_type_p
1104 * @description Sets the IP config type.
1105 * @scenario Invoking connection_profile_set_ip_config_type with valid parameter.
1107 int utc_connection_profile_set_ip_config_type_p(void)
1109 int ret = test_get_any_profile(&profile_temp);
1111 if (all_features_not_supported) {
1112 ret = connection_profile_set_ip_config_type(profile_temp,
1113 CONNECTION_ADDRESS_FAMILY_IPV4, CONNECTION_IP_CONFIG_TYPE_STATIC);
1114 CHECK_RETURN("connection_profile_set_ip_config_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1118 assert(profile_temp);
1119 ret = connection_profile_set_ip_config_type(profile_temp,
1120 CONNECTION_ADDRESS_FAMILY_IPV4, CONNECTION_IP_CONFIG_TYPE_STATIC);
1121 CHECK_RETURN("connection_profile_set_ip_config_type", ret, CONNECTION_ERROR_NONE);
1123 ret = connection_profile_set_ip_config_type(profile_temp,
1124 CONNECTION_ADDRESS_FAMILY_IPV6, CONNECTION_IP_CONFIG_TYPE_STATIC);
1125 CHECK_RETURN("connection_profile_set_ip_config_type", ret, CONNECTION_ERROR_NONE);
1131 * @testcase utc_connection_profile_set_ip_config_type_n
1134 * @description connection_profile_set_ip_config_type should fail with invalid parameter.
1135 * @scenario Verify connection_profile_set_ip_config_type by passing invalid parameter.
1137 int utc_connection_profile_set_ip_config_type_n(void)
1140 connection_profile_h profile_inval = NULL;
1142 if (all_features_not_supported) {
1143 ret = connection_profile_set_ip_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, -1);
1144 CHECK_RETURN("connection_profile_set_ip_config_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1148 ret = connection_profile_set_ip_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, -1);
1149 CHECK_RETURN("connection_profile_set_ip_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1150 ret = connection_profile_set_ip_config_type(profile_inval,
1151 CONNECTION_ADDRESS_FAMILY_IPV4, CONNECTION_IP_CONFIG_TYPE_STATIC);
1152 CHECK_RETURN("connection_profile_set_ip_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1153 ret = connection_profile_set_ip_config_type(profile_cellular, CONNECTION_ADDRESS_FAMILY_IPV4, -1);
1154 CHECK_RETURN("connection_profile_set_ip_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1160 * @testcase utc_connection_profile_set_ip_address_p
1163 * @description Sets the IP address.
1164 * @scenario Invoking connection_profile_set_ip_address with valid parameter.
1166 int utc_connection_profile_set_ip_address_p(void)
1168 int ret = test_get_any_profile(&profile_temp);
1170 if (all_features_not_supported) {
1171 ret = connection_profile_set_ip_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1172 CHECK_RETURN("connection_profile_set_ip_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1176 assert(profile_temp);
1177 ret = connection_profile_set_ip_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1178 CHECK_RETURN("connection_profile_set_ip_address", ret, CONNECTION_ERROR_NONE);
1180 ret = connection_profile_set_ip_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1181 CHECK_RETURN("connection_profile_set_ip_address", ret, CONNECTION_ERROR_NONE);
1187 * @testcase utc_connection_profile_set_ip_address_n
1190 * @description connection_profile_set_ip_address should fail with invalid parameter.
1191 * @scenario Verify connection_profile_set_ip_address by passing invalid parameter.
1193 int utc_connection_profile_set_ip_address_n(void)
1196 connection_profile_h profile_inval = NULL;
1198 if (all_features_not_supported) {
1199 ret = connection_profile_set_ip_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1200 CHECK_RETURN("connection_profile_set_ip_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1204 ret = connection_profile_set_ip_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1205 CHECK_RETURN("connection_profile_set_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1206 ret = connection_profile_set_ip_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1207 CHECK_RETURN("connection_profile_set_ip_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1213 * @testcase utc_connection_profile_set_subnet_mask_p
1216 * @description Sets the Subnet Mask.
1217 * @scenario Invoking connection_profile_set_subnet_mask with valid parameter.
1219 int utc_connection_profile_set_subnet_mask_p(void)
1221 int ret = test_get_any_profile(&profile_temp);
1223 if (all_features_not_supported) {
1224 ret = connection_profile_set_subnet_mask(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, "255.255.255.0");
1225 CHECK_RETURN("connection_profile_set_subnet_mask", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1229 assert(profile_temp);
1230 ret = connection_profile_set_subnet_mask(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, "255.255.255.0");
1231 CHECK_RETURN("connection_profile_set_subnet_mask", ret, CONNECTION_ERROR_NONE);
1237 * @testcase utc_connection_profile_set_subnet_mask_n
1240 * @description connection_profile_set_subnet_mask should fail with invalid parameter.
1241 * @scenario Verify connection_profile_set_subnet_mask by passing invalid parameter.
1243 int utc_connection_profile_set_subnet_mask_n(void)
1246 connection_profile_h profile_inval = NULL;
1248 if (all_features_not_supported) {
1249 ret = connection_profile_set_subnet_mask(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1250 CHECK_RETURN("connection_profile_set_subnet_mask", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1254 ret = connection_profile_set_subnet_mask(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1255 CHECK_RETURN("connection_profile_set_subnet_mask", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1256 ret = connection_profile_set_subnet_mask(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, "255.255.255.0");
1257 CHECK_RETURN("connection_profile_set_subnet_mask", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1263 * @testcase utc_connection_profile_set_gateway_address_p
1266 * @description Sets the Gateway address.
1267 * @scenario Invoking connection_profile_set_gateway_address with valid parameter.
1269 int utc_connection_profile_set_gateway_address_p(void)
1271 int ret = test_get_any_profile(&profile_temp);
1273 if (all_features_not_supported) {
1274 ret = connection_profile_set_gateway_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1275 CHECK_RETURN("connection_profile_set_gateway_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1279 assert(profile_temp);
1280 ret = connection_profile_set_gateway_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1281 CHECK_RETURN("connection_profile_set_gateway_address", ret, CONNECTION_ERROR_NONE);
1283 ret = connection_profile_set_gateway_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1284 CHECK_RETURN("connection_profile_set_gateway_address", ret, CONNECTION_ERROR_NONE);
1290 * @testcase utc_connection_profile_set_gateway_address_n
1293 * @description connection_profile_set_gateway_address should fail with invalid parameter.
1294 * @scenario Verify connection_profile_set_gateway_address by passing invalid parameter.
1296 int utc_connection_profile_set_gateway_address_n(void)
1299 connection_profile_h profile_inval = NULL;
1301 if (all_features_not_supported) {
1302 ret = connection_profile_set_gateway_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1303 CHECK_RETURN("connection_profile_set_gateway_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1307 ret = connection_profile_set_gateway_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1308 CHECK_RETURN("connection_profile_set_gateway_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1309 ret = connection_profile_set_gateway_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1310 CHECK_RETURN("connection_profile_set_gateway_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1316 * @testcase utc_connection_profile_set_dns_address_p
1319 * @description Sets the DNS address.
1320 * @scenario Invoking connection_profile_set_dns_address with valid parameter.
1322 int utc_connection_profile_set_dns_address_p(void)
1324 int ret = test_get_any_profile(&profile_temp);
1326 if (all_features_not_supported) {
1327 ret = connection_profile_set_dns_address(profile_temp, 1, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1328 CHECK_RETURN("connection_profile_set_dns_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1332 assert(profile_temp);
1333 ret = connection_profile_set_dns_address(profile_temp, 1, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1334 CHECK_RETURN("connection_profile_set_dns_address", ret, CONNECTION_ERROR_NONE);
1335 ret = connection_profile_set_dns_address(profile_temp, 2, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.2");
1336 CHECK_RETURN("connection_profile_set_dns_address", ret, CONNECTION_ERROR_NONE);
1337 ret = connection_profile_set_dns_address(profile_temp, 1, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1338 CHECK_RETURN("connection_profile_set_dns_address", ret, CONNECTION_ERROR_NONE);
1344 * @testcase utc_connection_profile_set_dns_address_n
1347 * @description connection_profile_set_dns_address should fail with invalid parameter.
1348 * @scenario Verify connection_profile_set_dns_address by passing invalid parameter.
1350 int utc_connection_profile_set_dns_address_n(void)
1353 connection_profile_h profile_inval = NULL;
1355 if (all_features_not_supported) {
1356 ret = connection_profile_set_dns_address(profile_inval, 1, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1357 CHECK_RETURN("connection_profile_set_dns_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1361 ret = connection_profile_set_dns_address(profile_inval, 1, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1362 CHECK_RETURN("connection_profile_set_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1363 ret = connection_profile_set_dns_address(profile_inval, 1, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1364 CHECK_RETURN("connection_profile_set_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1365 ret = connection_profile_set_dns_address(profile_cellular, 99, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1");
1366 CHECK_RETURN("connection_profile_set_dns_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1372 * @testcase utc_connection_profile_set_proxy_type_p
1375 * @description Sets the Proxy type.
1376 * @scenario Invoking connection_profile_set_proxy_type with valid parameter.
1378 int utc_connection_profile_set_proxy_type_p(void)
1380 int ret = test_get_any_profile(&profile_temp);
1382 if (all_features_not_supported) {
1383 ret = connection_profile_set_proxy_type(profile_temp, CONNECTION_PROXY_TYPE_MANUAL);
1384 CHECK_RETURN("connection_profile_set_proxy_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1388 assert(profile_temp);
1389 ret = connection_profile_set_proxy_type(profile_temp, CONNECTION_PROXY_TYPE_MANUAL);
1390 CHECK_RETURN("connection_profile_set_proxy_type", ret, CONNECTION_ERROR_NONE);
1396 * @testcase utc_connection_profile_set_proxy_type_n
1399 * @description connection_profile_set_proxy_type should fail with invalid parameter.
1400 * @scenario Verify connection_profile_set_proxy_type by passing invalid parameter.
1402 int utc_connection_profile_set_proxy_type_n(void)
1405 connection_profile_h profile_inval = NULL;
1407 if (all_features_not_supported) {
1408 ret = connection_profile_set_proxy_type(profile_inval, -1);
1409 CHECK_RETURN("connection_profile_set_proxy_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1413 ret = connection_profile_set_proxy_type(profile_inval, -1);
1414 CHECK_RETURN("connection_profile_set_proxy_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1415 ret = connection_profile_set_proxy_type(profile_inval, CONNECTION_PROXY_TYPE_MANUAL);
1416 CHECK_RETURN("connection_profile_set_proxy_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1417 ret = connection_profile_set_proxy_type(profile_cellular, -1);
1418 CHECK_RETURN("connection_profile_set_proxy_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1424 * @testcase utc_connection_profile_set_proxy_address_p
1427 * @description Sets the Proxy address.
1428 * @scenario Invoking connection_profile_set_proxy_address with valid parameter.
1430 int utc_connection_profile_set_proxy_address_p(void)
1432 int ret = test_get_any_profile(&profile_temp);
1434 if (all_features_not_supported) {
1435 ret = connection_profile_set_proxy_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1:8080");
1436 CHECK_RETURN("connection_profile_set_proxy_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1440 assert(profile_temp);
1441 ret = connection_profile_set_proxy_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1:8080");
1442 CHECK_RETURN("connection_profile_set_proxy_address", ret, CONNECTION_ERROR_NONE);
1443 ret = connection_profile_set_proxy_address(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1444 CHECK_RETURN("connection_profile_set_proxy_address", ret, CONNECTION_ERROR_NONE);
1450 * @testcase utc_connection_profile_set_proxy_address_n
1453 * @description connection_profile_set_proxy_address should fail with invalid parameter.
1454 * @scenario Verify connection_profile_set_proxy_address by passing invalid parameter.
1456 int utc_connection_profile_set_proxy_address_n(void)
1459 connection_profile_h profile_inval = NULL;
1461 if (all_features_not_supported) {
1462 ret = connection_profile_set_proxy_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1463 CHECK_RETURN("connection_profile_set_proxy_address", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1467 ret = connection_profile_set_proxy_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
1468 CHECK_RETURN("connection_profile_set_proxy_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1469 ret = connection_profile_set_proxy_address(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, "192.168.11.1:8080");
1470 CHECK_RETURN("connection_profile_set_proxy_address", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1476 * @testcase utc_connection_profile_set_state_changed_cb_p
1479 * @description Registers the callback that is called when the state of profile is changed.
1480 * @scenario Invoking connection_profile_set_state_changed_cb with valid parameter.
1482 int utc_connection_profile_set_state_changed_cb_p(void)
1484 int ret = test_get_any_profile(&profile_temp);
1486 if (all_features_not_supported) {
1487 ret = connection_profile_set_state_changed_cb(profile_temp, test_profile_state_changed_cb, NULL);
1488 CHECK_RETURN("connection_profile_set_state_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1492 assert(profile_temp);
1493 ret = connection_profile_set_state_changed_cb(profile_temp, test_profile_state_changed_cb, NULL);
1494 CHECK_RETURN("connection_profile_set_state_changed_cb", ret, CONNECTION_ERROR_NONE);
1496 ret = connection_profile_unset_state_changed_cb(profile_temp);
1497 PRINT_RETURN("connection_profile_unset_state_changed_cb", ret);
1503 * @testcase utc_connection_profile_set_state_changed_cb_n
1506 * @description connection_profile_set_state_changed_cb should fail with invalid parameter.
1507 * @scenario Verify connection_profile_set_state_changed_cb by passing callback and user_data as NULL.
1509 int utc_connection_profile_set_state_changed_cb_n(void)
1511 connection_profile_h profile_inval = NULL;
1512 int ret = test_get_any_profile(&profile_temp);
1514 if (all_features_not_supported) {
1515 ret = connection_profile_set_state_changed_cb(profile_inval, NULL, NULL);
1516 CHECK_RETURN("connection_profile_set_state_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1520 assert(profile_temp);
1521 ret = connection_profile_set_state_changed_cb(profile_inval, NULL, NULL);
1522 CHECK_RETURN("connection_profile_set_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1523 ret = connection_profile_set_state_changed_cb(profile_inval, test_profile_state_changed_cb, NULL);
1524 CHECK_RETURN("connection_profile_set_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1525 ret = connection_profile_set_state_changed_cb(profile_temp, NULL, NULL);
1526 CHECK_RETURN("connection_profile_set_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1532 * @testcase utc_connection_profile_unset_state_changed_cb_p
1535 * @description Unregisters the callback that is called when the state of profile is changed.
1536 * @scenario Invoking connection_profile_unset_state_changed_cb with valid parameter.
1538 int utc_connection_profile_unset_state_changed_cb_p(void)
1540 int ret = test_get_any_profile(&profile_temp);
1542 if (all_features_not_supported) {
1543 ret = connection_profile_unset_state_changed_cb(profile_temp);
1544 CHECK_RETURN("connection_profile_unset_state_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1548 assert(profile_temp);
1549 ret = connection_profile_set_state_changed_cb(profile_temp, test_profile_state_changed_cb, NULL);
1550 PRINT_RETURN("connection_profile_set_state_changed_cb", ret);
1552 ret = connection_profile_unset_state_changed_cb(profile_temp);
1553 CHECK_RETURN("connection_profile_unset_state_changed_cb", ret, CONNECTION_ERROR_NONE);
1559 * @testcase utc_connection_profile_unset_state_changed_cb_n
1562 * @description connection_profile_unset_state_changed_cb should fail with invalid parameter.
1563 * @scenario Verify connection_profile_unset_state_changed_cb by passing invalid profile handle.
1565 int utc_connection_profile_unset_state_changed_cb_n(void)
1567 connection_profile_h profile_inval = NULL;
1569 int ret = connection_profile_unset_state_changed_cb(profile_inval);
1571 if (all_features_not_supported)
1572 CHECK_RETURN("connection_profile_unset_state_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1574 CHECK_RETURN("connection_profile_unset_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1579 /* Cellular profile operations. */
1582 * @testcase utc_connection_profile_set_cellular_service_type_p
1585 * @description Sets the service type.
1586 * @scenario Invoking connection_profile_set_cellular_service_type with valid parameter.
1588 int utc_connection_profile_set_cellular_service_type_p(void)
1590 if (telephony_supported) {
1591 int ret = connection_profile_set_cellular_service_type(profile_cellular, CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET);
1592 CHECK_RETURN("connection_profile_set_cellular_service_type", ret, CONNECTION_ERROR_NONE);
1594 int ret = connection_profile_set_cellular_service_type(profile_cellular, CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET);
1595 CHECK_RETURN("connection_profile_set_cellular_service_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1602 * @testcase utc_connection_profile_set_cellular_service_type_n
1605 * @description connection_profile_set_cellular_service_type should fail with invalid parameter.
1606 * @scenario Verify connection_profile_set_cellular_service_type by passing invalid parameter.
1608 int utc_connection_profile_set_cellular_service_type_n(void)
1610 connection_profile_h profile_inval = NULL;
1612 if (telephony_supported) {
1613 int ret = connection_profile_set_cellular_service_type(profile_inval, -1);
1614 CHECK_RETURN("connection_profile_set_cellular_service_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1615 ret = connection_profile_set_cellular_service_type(profile_inval, CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET);
1616 CHECK_RETURN("connection_profile_set_cellular_service_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1617 ret = connection_profile_set_cellular_service_type(profile_cellular, -1);
1618 CHECK_RETURN("connection_profile_set_cellular_service_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1619 ret = connection_profile_set_cellular_service_type(profile_wifi, CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET);
1620 CHECK_RETURN("connection_profile_set_cellular_service_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1622 int ret = connection_profile_set_cellular_service_type(profile_inval, -1);
1623 CHECK_RETURN("connection_profile_set_cellular_service_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1630 * @testcase utc_connection_profile_set_cellular_apn_p
1633 * @description Sets the APN (Access Point Name).
1634 * @scenario Invoking connection_profile_set_cellular_apn with valid parameter.
1636 int utc_connection_profile_set_cellular_apn_p(void)
1638 if (telephony_supported) {
1639 int ret = connection_profile_set_cellular_apn(profile_cellular, "tizen.org");
1640 CHECK_RETURN("connection_profile_set_cellular_apn", ret, CONNECTION_ERROR_NONE);
1642 int ret = connection_profile_set_cellular_apn(profile_cellular, "tizen.org");
1643 CHECK_RETURN("connection_profile_set_cellular_apn", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1650 * @testcase utc_connection_profile_set_cellular_apn_n
1653 * @description connection_profile_set_cellular_apn should fail with invalid parameter.
1654 * @scenario Verify connection_profile_set_cellular_apn by passing invalid parameter.
1656 int utc_connection_profile_set_cellular_apn_n(void)
1658 connection_profile_h profile_inval = NULL;
1660 if (telephony_supported) {
1661 int ret = connection_profile_set_cellular_apn(profile_inval, NULL);
1662 CHECK_RETURN("connection_profile_set_cellular_apn", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1663 ret = connection_profile_set_cellular_apn(profile_inval, "tizen.org");
1664 CHECK_RETURN("connection_profile_set_cellular_apn", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1665 ret = connection_profile_set_cellular_apn(profile_cellular, NULL);
1666 CHECK_RETURN("connection_profile_set_cellular_apn", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1667 ret = connection_profile_set_cellular_apn(profile_wifi, "tizen.org");
1668 CHECK_RETURN("connection_profile_set_cellular_apn", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1670 int ret = connection_profile_set_cellular_apn(profile_inval, NULL);
1671 CHECK_RETURN("connection_profile_set_cellular_apn", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1677 * @testcase utc_connection_profile_set_cellular_auth_info_p
1680 * @description Sets the Authentication information.
1681 * @scenario Invoking connection_profile_set_cellular_auth_info with valid parameter.
1683 int utc_connection_profile_set_cellular_auth_info_p(void)
1685 if (telephony_supported) {
1686 int ret = connection_profile_set_cellular_auth_info(profile_cellular,
1687 CONNECTION_CELLULAR_AUTH_TYPE_PAP, "tizen", "flower");
1688 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_NONE);
1690 int ret = connection_profile_set_cellular_auth_info(profile_cellular,
1691 CONNECTION_CELLULAR_AUTH_TYPE_PAP, "tizen", "flower");
1692 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1699 * @testcase utc_connection_profile_set_cellular_auth_info_n
1702 * @description connection_profile_set_cellular_auth_info should fail with invalid parameter.
1703 * @scenario Verify connection_profile_set_cellular_auth_info by passing invalid AUTHENTICATION TYPE/parameter.
1705 int utc_connection_profile_set_cellular_auth_info_n(void)
1707 connection_profile_h profile_inval = NULL;
1709 if (telephony_supported) {
1710 int ret = connection_profile_set_cellular_auth_info(profile_inval, -1, NULL, NULL);
1711 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1712 ret = connection_profile_set_cellular_auth_info(profile_inval,
1713 CONNECTION_CELLULAR_AUTH_TYPE_PAP, "tizen", "flower");
1714 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1715 ret = connection_profile_set_cellular_auth_info(profile_cellular, -1, "tizen", "flower");
1716 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1717 ret = connection_profile_set_cellular_auth_info(profile_cellular,
1718 CONNECTION_CELLULAR_AUTH_TYPE_PAP, NULL, "flower");
1719 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1720 ret = connection_profile_set_cellular_auth_info(profile_cellular,
1721 CONNECTION_CELLULAR_AUTH_TYPE_PAP, "tizen", NULL);
1722 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1723 ret = connection_profile_set_cellular_auth_info(profile_inval,
1724 CONNECTION_CELLULAR_AUTH_TYPE_PAP, NULL, "flower");
1725 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1726 ret = connection_profile_set_cellular_auth_info(profile_cellular,
1727 CONNECTION_CELLULAR_AUTH_TYPE_PAP, NULL, NULL);
1728 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1729 ret = connection_profile_set_cellular_auth_info(profile_wifi,
1730 CONNECTION_CELLULAR_AUTH_TYPE_PAP, "tizen", "flower");
1731 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1733 int ret = connection_profile_set_cellular_auth_info(profile_inval, -1, NULL, NULL);
1734 CHECK_RETURN("connection_profile_set_cellular_auth_info", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1741 * @testcase utc_connection_profile_set_cellular_home_url_p
1744 * @description connection_profile_set_cellular_home_url.
1745 * @scenario Invoking connection_profile_set_cellular_home_url with valid parameter.
1747 int utc_connection_profile_set_cellular_home_url_p(void)
1749 if (telephony_supported) {
1750 int ret = connection_profile_set_cellular_home_url(profile_cellular, "www.tizen.org");
1751 CHECK_RETURN("connection_profile_set_cellular_home_url", ret, CONNECTION_ERROR_NONE);
1753 int ret = connection_profile_set_cellular_home_url(profile_cellular, "www.tizen.org");
1754 CHECK_RETURN("connection_profile_set_cellular_home_url", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1761 * @testcase utc_connection_profile_set_cellular_home_url_n
1764 * @description connection_profile_set_cellular_home_url should fail with invalid parameter.
1765 * @scenario Verify connection_profile_set_cellular_home_url by passing invalid profile handle.
1767 int utc_connection_profile_set_cellular_home_url_n(void)
1769 connection_profile_h profile_inval = NULL;
1771 if (telephony_supported) {
1772 int ret = connection_profile_set_cellular_home_url(profile_inval, NULL);
1773 CHECK_RETURN("connection_profile_set_cellular_home_url", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1774 ret = connection_profile_set_cellular_home_url(profile_inval, "www.tizen.org");
1775 CHECK_RETURN("connection_profile_set_cellular_home_url", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1776 ret = connection_profile_set_cellular_home_url(profile_cellular, NULL);
1777 CHECK_RETURN("connection_profile_set_cellular_home_url", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1778 ret = connection_profile_set_cellular_home_url(profile_wifi, "www.tizen.org");
1779 CHECK_RETURN("connection_profile_set_cellular_home_url", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1781 int ret = connection_profile_set_cellular_home_url(profile_inval, NULL);
1782 CHECK_RETURN("connection_profile_set_cellular_home_url", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1787 #if (defined(MOBILE) || defined(WEARABLE) || defined(TIZENIOT)) //Starts MOBILE or WEARABLE or TIZENIOT
1789 * @testcase utc_connection_profile_set_cellular_pdn_type_p
1792 * @description Sets the pdn type.
1793 * @scenario Invoking connection_profile_set_cellular_pdn_type with valid parameter.
1795 int utc_connection_profile_set_cellular_pdn_type_p(void)
1797 int ret = connection_profile_set_cellular_pdn_type(profile_cellular, CONNECTION_CELLULAR_PDN_TYPE_IPV4);
1799 if (telephony_supported)
1800 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_NONE);
1802 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1807 * @testcase utc_connection_profile_set_cellular_pdn_type_n
1810 * @description connection_profile_set_cellular_pdn_type should fail with invalid parameter.
1811 * @scenario Verify connection_profile_set_cellular_pdn_type by passing invalid profile handle.
1813 int utc_connection_profile_set_cellular_pdn_type_n(void)
1815 connection_profile_h profile_inval = NULL;
1816 connection_cellular_pdn_type_e type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
1818 if (telephony_supported) {
1819 int ret = connection_profile_set_cellular_pdn_type(profile_inval, type);
1820 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1821 ret = connection_profile_set_cellular_pdn_type(profile_wifi, type);
1822 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1824 int ret = connection_profile_set_cellular_pdn_type(profile_inval, type);
1825 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1832 * @testcase utc_connection_profile_set_cellular_roam_pdn_type_p
1835 * @description Sets the roam pdn type.
1836 * @scenario Invoking connection_profile_set_cellular_roam_pdn_type with valid parameter.
1838 int utc_connection_profile_set_cellular_roam_pdn_type_p(void)
1840 int ret = connection_profile_set_cellular_roam_pdn_type(profile_cellular, CONNECTION_CELLULAR_PDN_TYPE_IPV4);
1842 if (telephony_supported)
1843 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_NONE);
1845 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1850 * @testcase utc_connection_profile_set_cellular_roam_pdn_type_n
1853 * @description connection_profile_set_cellular_roam_pdn_type should fail with invalid parameter.
1854 * @scenario Verify connection_profile_set_cellular_roam_pdn_type by passing invalid profile handle.
1856 int utc_connection_profile_set_cellular_roam_pdn_type_n(void)
1858 connection_profile_h profile_inval = NULL;
1859 connection_cellular_pdn_type_e type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
1861 if (telephony_supported) {
1862 int ret = connection_profile_set_cellular_roam_pdn_type(profile_inval, type);
1863 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1864 ret = connection_profile_set_cellular_roam_pdn_type(profile_wifi, type);
1865 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1867 int ret = connection_profile_set_cellular_roam_pdn_type(profile_inval, type);
1868 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1873 #endif // End MOBILE or WEARABLE or TIZENIOT
1876 * @testcase utc_connection_profile_get_cellular_service_type_p
1879 * @description Sets the home URL.
1880 * @scenario Invoking connection_profile_get_cellular_service_type with valid parameter.
1882 int utc_connection_profile_get_cellular_service_type_p(void)
1884 connection_cellular_service_type_e type;
1886 if (telephony_supported) {
1887 connection_profile_set_cellular_service_type(profile_cellular, CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET);
1889 int ret = connection_profile_get_cellular_service_type(profile_cellular, &type);
1890 CHECK_RETURN("connection_profile_get_cellular_service_type", ret, CONNECTION_ERROR_NONE);
1892 int ret = connection_profile_get_cellular_service_type(profile_cellular, &type);
1893 CHECK_RETURN("connection_profile_get_cellular_service_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1900 * @testcase utc_connection_profile_get_cellular_service_type_n
1903 * @description connection_profile_get_cellular_service_type should fail with invalid parameter.
1904 * @scenario Verify connection_profile_get_cellular_service_type by passing invalid profile handle and home URL.
1906 int utc_connection_profile_get_cellular_service_type_n(void)
1908 connection_profile_h profile_inval = NULL;
1909 connection_cellular_service_type_e type;
1911 if (telephony_supported) {
1912 int ret = connection_profile_get_cellular_service_type(profile_inval, NULL);
1913 CHECK_RETURN("connection_profile_get_cellular_service_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1914 ret = connection_profile_get_cellular_service_type(profile_inval, &type);
1915 CHECK_RETURN("connection_profile_get_cellular_service_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1916 ret = connection_profile_get_cellular_service_type(profile_cellular, NULL);
1917 CHECK_RETURN("connection_profile_get_cellular_service_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1918 ret = connection_profile_get_cellular_service_type(profile_wifi, &type);
1919 CHECK_RETURN("connection_profile_get_cellular_service_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1921 int ret = connection_profile_get_cellular_service_type(profile_inval, NULL);
1922 CHECK_RETURN("connection_profile_get_cellular_service_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1929 * @testcase utc_connection_profile_get_cellular_apn_p
1932 * @description Gets the APN (access point name).
1933 * @scenario Invoking connection_profile_get_cellular_apn with valid parameter.
1935 int utc_connection_profile_get_cellular_apn_p(void)
1939 int ret = connection_profile_get_cellular_apn(profile_cellular, &apn);
1942 if (telephony_supported)
1943 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_NONE);
1945 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1950 * @testcase utc_connection_profile_get_cellular_apn_n
1953 * @description connection_profile_get_cellular_apn should fail with invalid parameter.
1954 * @scenario Verify connection_profile_get_cellular_apn by passing invalid parameter.
1956 int utc_connection_profile_get_cellular_apn_n(void)
1958 connection_profile_h profile_inval = NULL;
1961 if (telephony_supported) {
1962 int ret = connection_profile_get_cellular_apn(profile_inval, NULL);
1963 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1964 ret = connection_profile_get_cellular_apn(profile_inval, &apn);
1965 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1966 ret = connection_profile_get_cellular_apn(profile_cellular, NULL);
1967 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1968 ret = connection_profile_get_cellular_apn(profile_wifi, NULL);
1969 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1971 int ret = connection_profile_get_cellular_apn(profile_inval, NULL);
1972 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1979 * @testcase utc_connection_profile_get_cellular_auth_info_p
1982 * @description Gets the authentication information.
1983 * @scenario Invoking connection_profile_get_cellular_auth_info with valid parameter.
1985 int utc_connection_profile_get_cellular_auth_info_p(void)
1987 connection_cellular_auth_type_e type;
1991 int ret = connection_profile_get_cellular_auth_info(profile_cellular, &type, &name, &pwd);
1992 if (ret == CONNECTION_ERROR_NONE) {
1993 FREE_RESOURCE(name);
1997 if (telephony_supported)
1998 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_NONE);
2000 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2005 * @testcase utc_connection_profile_get_cellular_auth_info_n
2008 * @description connection_profile_get_cellular_auth_info should fail with invalid parameter.
2009 * @scenario Verify connection_profile_get_cellular_auth_info by passing invalid parameter.
2011 int utc_connection_profile_get_cellular_auth_info_n(void)
2013 connection_profile_h profile_inval = NULL;
2014 connection_cellular_auth_type_e type;
2018 if (telephony_supported) {
2019 int ret = connection_profile_get_cellular_auth_info(profile_inval, NULL, NULL, NULL);
2020 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2021 ret = connection_profile_get_cellular_auth_info(profile_inval, &type, &name, &pwd);
2022 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2023 ret = connection_profile_get_cellular_auth_info(profile_cellular, NULL, &name, &pwd);
2024 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2025 ret = connection_profile_get_cellular_auth_info(profile_cellular, &type, NULL, &pwd);
2026 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2027 ret = connection_profile_get_cellular_auth_info(profile_cellular, &type, &name, NULL);
2028 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2029 ret = connection_profile_get_cellular_auth_info(profile_inval, NULL, &name, &pwd);
2030 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2031 ret = connection_profile_get_cellular_auth_info(profile_inval, &type, NULL, &pwd);
2032 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2033 ret = connection_profile_get_cellular_auth_info(profile_inval, &type, &name, NULL);
2034 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2035 ret = connection_profile_get_cellular_auth_info(profile_cellular, NULL, NULL, &pwd);
2036 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2037 ret = connection_profile_get_cellular_auth_info(profile_cellular, NULL, &name, NULL);
2038 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2039 ret = connection_profile_get_cellular_auth_info(profile_cellular, &type, NULL, NULL);
2040 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2041 ret = connection_profile_get_cellular_auth_info(profile_inval, NULL, NULL, &pwd);
2042 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2043 ret = connection_profile_get_cellular_auth_info(profile_cellular, NULL, NULL, NULL);
2044 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2045 ret = connection_profile_get_cellular_auth_info(profile_wifi, &type, &name, &pwd);
2046 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2048 int ret = connection_profile_get_cellular_auth_info(profile_inval, NULL, NULL, NULL);
2049 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2056 * @testcase utc_connection_profile_get_cellular_home_url_p
2059 * @description Gets the home URL.
2060 * @scenario Invoking connection_profile_get_cellular_home_url with valid parameter.
2062 int utc_connection_profile_get_cellular_home_url_p(void)
2064 char *home_url = NULL;
2066 int ret = connection_profile_get_cellular_home_url(profile_cellular, &home_url);
2067 FREE_RESOURCE(home_url);
2069 if (telephony_supported)
2070 CHECK_RETURN("connection_profile_get_cellular_home_url", ret, CONNECTION_ERROR_NONE);
2072 CHECK_RETURN("connection_profile_get_cellular_home_url", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2077 * @testcase utc_connection_profile_get_cellular_home_url_n
2080 * @description connection_profile_get_cellular_home_url should fail with invalid parameter.
2081 * @scenario Verify connection_profile_get_cellular_home_url by passing invalid profile handle.
2083 int utc_connection_profile_get_cellular_home_url_n(void)
2085 connection_profile_h profile_inval = NULL;
2086 char *home_url = NULL;
2088 if (telephony_supported) {
2089 int ret = connection_profile_get_cellular_home_url(profile_inval, NULL);
2090 CHECK_RETURN("connection_profile_get_cellular_home_url", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2091 ret = connection_profile_get_cellular_home_url(profile_inval, &home_url);
2092 CHECK_RETURN("connection_profile_get_cellular_home_url", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2093 ret = connection_profile_get_cellular_home_url(profile_cellular, NULL);
2094 CHECK_RETURN("connection_profile_get_cellular_home_url", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2095 ret = connection_profile_get_cellular_home_url(profile_wifi, &home_url);
2096 CHECK_RETURN("connection_profile_get_cellular_home_url", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2098 int ret = connection_profile_get_cellular_home_url(profile_inval, NULL);
2099 CHECK_RETURN("connection_profile_get_cellular_home_url", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2105 #if (defined(MOBILE) || defined(WEARABLE) || defined(TIZENIOT)) //Starts MOBILE or WEARABLE or TIZENIOT
2107 * @testcase utc_connection_profile_get_cellular_pdn_type_p
2110 * @description Gets the pdn type.
2111 * @scenario Invoking connection_profile_get_cellular_pdn_type with valid parameter.
2113 int utc_connection_profile_get_cellular_pdn_type_p(void)
2115 connection_cellular_pdn_type_e type;
2117 if (telephony_supported) {
2118 int ret = connection_profile_set_cellular_pdn_type(profile_cellular, CONNECTION_CELLULAR_PDN_TYPE_IPV4);
2119 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_NONE);
2121 ret = connection_profile_get_cellular_pdn_type(profile_cellular, &type);
2122 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_NONE);
2124 int ret = connection_profile_get_cellular_pdn_type(profile_cellular, &type);
2125 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2132 * @testcase utc_connection_profile_get_cellular_pdn_type_n
2135 * @description connection_profile_get_cellular_pdn_type should fail with invalid parameter.
2136 * @scenario Verify connection_profile_get_cellular_pdn_type by passing invalid profile handle.
2138 int utc_connection_profile_get_cellular_pdn_type_n(void)
2140 connection_profile_h profile_inval = NULL;
2141 connection_cellular_pdn_type_e type;
2143 if (telephony_supported) {
2144 int ret = connection_profile_get_cellular_pdn_type(profile_inval, NULL);
2145 CHECK_RETURN("connection_profile_get_cellular_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2146 ret = connection_profile_get_cellular_pdn_type(profile_cellular, NULL);
2147 CHECK_RETURN("connection_profile_get_cellular_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2148 ret = connection_profile_get_cellular_pdn_type(profile_wifi, &type);
2149 CHECK_RETURN("connection_profile_get_cellular_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2151 int ret = connection_profile_get_cellular_pdn_type(profile_inval, NULL);
2152 CHECK_RETURN("connection_profile_get_cellular_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2159 * @testcase utc_connection_profile_get_cellular_roam_pdn_type_p
2162 * @description Gets the roam pdn type.
2163 * @scenario Invoking connection_profile_get_cellular_roam_pdn_type with valid parameter.
2165 int utc_connection_profile_get_cellular_roam_pdn_type_p(void)
2167 connection_cellular_pdn_type_e type;
2169 if (telephony_supported) {
2170 int ret = connection_profile_set_cellular_roam_pdn_type(profile_cellular, CONNECTION_CELLULAR_PDN_TYPE_IPV4);
2171 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_NONE);
2173 ret = connection_profile_get_cellular_roam_pdn_type(profile_cellular, &type);
2174 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_NONE);
2176 int ret = connection_profile_get_cellular_roam_pdn_type(profile_cellular, &type);
2177 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2184 * @testcase utc_connection_profile_get_cellular_roam_pdn_type_n
2187 * @description connection_profile_get_cellular_roam_pdn_type should fail with invalid parameter.
2188 * @scenario Verify connection_profile_get_cellular_roam_pdn_type by passing invalid profile handle.
2190 int utc_connection_profile_get_cellular_roam_pdn_type_n(void)
2192 connection_profile_h profile_inval = NULL;
2193 connection_cellular_pdn_type_e type;
2195 if (telephony_supported) {
2196 int ret = connection_profile_get_cellular_roam_pdn_type(profile_inval, NULL);
2197 CHECK_RETURN("connection_profile_get_cellular_roam_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2198 ret = connection_profile_get_cellular_roam_pdn_type(profile_cellular, NULL);
2199 CHECK_RETURN("connection_profile_get_cellular_roam_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2200 ret = connection_profile_get_cellular_roam_pdn_type(profile_wifi, &type);
2201 CHECK_RETURN("connection_profile_get_cellular_roam_pdn_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2203 int ret = connection_profile_get_cellular_roam_pdn_type(profile_inval, NULL);
2204 CHECK_RETURN("connection_profile_get_cellular_roam_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2209 #endif // End MOBILE or WEARABLE or TIZENIOT
2212 * @testcase utc_connection_profile_is_cellular_roaming_p
2215 * @description Checks wheter the connection is in roaming state.
2216 * @scenario Invoking connection_profile_is_cellular_roaming with valid parameter.
2218 int utc_connection_profile_is_cellular_roaming_p(void)
2222 if (telephony_supported) {
2223 int ret = connection_profile_is_cellular_roaming(profile_cellular, &roaming);
2224 CHECK_RETURN("connection_profile_is_cellular_roaming", ret, CONNECTION_ERROR_NONE);
2226 int ret = connection_profile_is_cellular_roaming(profile_cellular, &roaming);
2227 CHECK_RETURN("connection_profile_is_cellular_roaming", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2234 * @testcase utc_connection_profile_is_cellular_roaming_n
2237 * @description connection_profile_is_cellular_roaming should fail with invalid parameter.
2238 * @scenario Verify connection_profile_is_cellular_roaming by passing invalid parameter.
2240 int utc_connection_profile_is_cellular_roaming_n(void)
2242 connection_profile_h profile_inval = NULL;
2245 if (telephony_supported) {
2246 int ret = connection_profile_is_cellular_roaming(profile_inval, NULL);
2247 CHECK_RETURN("connection_profile_is_cellular_roaming", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2248 ret = connection_profile_is_cellular_roaming(profile_inval, &roaming);
2249 CHECK_RETURN("connection_profile_is_cellular_roaming", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2250 ret = connection_profile_is_cellular_roaming(profile_cellular, NULL);
2251 CHECK_RETURN("connection_profile_is_cellular_roaming", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2252 ret = connection_profile_is_cellular_roaming(profile_wifi, &roaming);
2253 CHECK_RETURN("connection_profile_is_cellular_roaming", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2255 int ret = connection_profile_is_cellular_roaming(profile_inval, NULL);
2256 CHECK_RETURN("connection_profile_is_cellular_roaming", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2263 * @testcase utc_connection_profile_is_cellular_hidden_p
2266 * @description Checks whether the profile is hidden.
2267 * @scenario Invoking connection_profile_is_cellular_hidden with valid parameter.
2269 int utc_connection_profile_is_cellular_hidden_p(void)
2273 if (telephony_supported) {
2274 int ret = connection_profile_is_cellular_hidden(profile_cellular, &is_hidden);
2275 CHECK_RETURN("connection_profile_is_cellular_hidden", ret, CONNECTION_ERROR_NONE);
2277 int ret = connection_profile_is_cellular_hidden(profile_cellular, &is_hidden);
2278 CHECK_RETURN("connection_profile_is_cellular_hidden", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2286 * @testcase utc_connection_profile_is_cellular_hidden_n
2289 * @description connection_profile_is_cellular_hidden should fail with invalid parameter.
2290 * @scenario Verify connection_profile_is_cellular_hidden by passing invalid parameter.
2292 int utc_connection_profile_is_cellular_hidden_n(void)
2294 connection_profile_h profile_inval = NULL;
2297 if (telephony_supported) {
2298 int ret = connection_profile_is_cellular_hidden(profile_inval, NULL);
2299 CHECK_RETURN("connection_profile_is_cellular_hidden", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2300 ret = connection_profile_is_cellular_hidden(profile_inval, &is_hidden);
2301 CHECK_RETURN("connection_profile_is_cellular_hidden", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2302 ret = connection_profile_is_cellular_hidden(profile_cellular, NULL);
2303 CHECK_RETURN("connection_profile_is_cellular_hidden", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2304 ret = connection_profile_is_cellular_hidden(profile_wifi, &is_hidden);
2305 CHECK_RETURN("connection_profile_is_cellular_hidden", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2307 int ret = connection_profile_is_cellular_hidden(profile_inval, NULL);
2308 CHECK_RETURN("connection_profile_is_cellular_hidden", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2315 * @testcase utc_connection_profile_is_cellular_editable_p
2318 * @description Checks whether the profile is editable.
2319 * @scenario Invoking connection_profile_is_cellular_editable with valid parameter.
2321 int utc_connection_profile_is_cellular_editable_p(void)
2325 if (telephony_supported) {
2326 int ret = connection_profile_is_cellular_editable(profile_cellular, &is_editable);
2327 CHECK_RETURN("connection_profile_is_cellular_editable", ret, CONNECTION_ERROR_NONE);
2329 int ret = connection_profile_is_cellular_editable(profile_cellular, &is_editable);
2330 CHECK_RETURN("connection_profile_is_cellular_editable", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2337 * @testcase utc_connection_profile_is_cellular_editable_n
2340 * @description connection_profile_is_cellular_editable should fail with invalid parameter.
2341 * @scenario Verify connection_profile_is_cellular_editable by passing invalid parameter.
2343 int utc_connection_profile_is_cellular_editable_n(void)
2345 connection_profile_h profile_inval = NULL;
2348 if (telephony_supported) {
2349 int ret = connection_profile_is_cellular_editable(profile_inval, NULL);
2350 CHECK_RETURN("connection_profile_is_cellular_editable", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2351 ret = connection_profile_is_cellular_editable(profile_inval, &is_editable);
2352 CHECK_RETURN("connection_profile_is_cellular_editable", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2353 ret = connection_profile_is_cellular_editable(profile_cellular, NULL);
2354 CHECK_RETURN("connection_profile_is_cellular_editable", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2355 ret = connection_profile_is_cellular_editable(profile_wifi, &is_editable);
2356 CHECK_RETURN("connection_profile_is_cellular_editable", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2358 int ret = connection_profile_is_cellular_editable(profile_inval, NULL);
2359 CHECK_RETURN("connection_profile_is_cellular_editable", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2366 * @testcase utc_connection_profile_is_cellular_default_p
2369 * @description Checks whether the profile is default.is_default @c true if the profile is default,
2370 otherwise @c false if the profile is not default
2371 * @scenario Invoking connection_profile_is_cellular_default with valid parameter.
2373 int utc_connection_profile_is_cellular_default_p(void)
2377 if (telephony_supported) {
2378 int ret = connection_profile_is_cellular_default(profile_cellular, &is_default);
2379 CHECK_RETURN("connection_profile_is_cellular_default", ret, CONNECTION_ERROR_NONE);
2381 int ret = connection_profile_is_cellular_default(profile_cellular, &is_default);
2382 CHECK_RETURN("connection_profile_is_cellular_default", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2389 * @testcase utc_connection_profile_is_cellular_default_n
2392 * @description connection_profile_is_cellular_default should fail with invalid parameter.
2393 * @scenario Verify connection_profile_is_cellular_default by passing invalid parameter.
2395 int utc_connection_profile_is_cellular_default_n(void)
2399 if (telephony_supported) {
2400 int ret = connection_profile_is_cellular_default(NULL, &is_editable);
2401 CHECK_RETURN("connection_profile_is_cellular_default", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2403 ret = connection_profile_is_cellular_default(profile_cellular, NULL);
2404 CHECK_RETURN("connection_profile_is_cellular_default", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2406 ret = connection_profile_is_cellular_default(profile_wifi, &is_editable);
2407 CHECK_RETURN("connection_profile_is_cellular_default", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2409 int ret = connection_profile_is_cellular_default(NULL, &is_editable);
2410 CHECK_RETURN("connection_profile_is_cellular_default", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2417 * @testcase utc_connection_profile_refresh_p
2420 * @description Refreshes the profile information.
2421 * @scenario Invoking connection_profile_refresh with valid parameter.
2423 int utc_connection_profile_refresh_p(void)
2425 int ret = test_get_any_profile(&profile_temp);
2427 if (all_features_not_supported) {
2428 ret = connection_profile_refresh(profile_temp);
2429 CHECK_RETURN("connection_profile_refresh", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2433 assert(profile_temp);
2434 ret = connection_profile_refresh(profile_temp);
2435 CHECK_RETURN("connection_profile_refresh", ret, CONNECTION_ERROR_NONE);
2441 * @testcase utc_connection_profile_refresh_n
2444 * @description connection_profile_refresh should fail with invalid parameter.
2445 * @scenario Verify connection_profile_refresh by passing invalid profile handle.
2447 int utc_connection_profile_refresh_n(void)
2449 connection_profile_h profile_inval = NULL;
2451 int ret = connection_profile_refresh(profile_inval);
2453 if (all_features_not_supported)
2454 CHECK_RETURN("connection_profile_refresh", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2456 CHECK_RETURN("connection_profile_refresh", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2460 /* Wi-Fi profile operations. */
2463 * @testcase utc_connection_profile_get_wifi_essid_p
2466 * @description Gets the ESSID (Extended Service Set Identifier).
2467 * @scenario Invoking connection_profile_get_wifi_essid with valid parameter.
2469 int utc_connection_profile_get_wifi_essid_p(void)
2473 int ret = connection_profile_get_wifi_essid(profile_wifi, &essid);
2474 FREE_RESOURCE(essid);
2477 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_NONE);
2479 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2484 * @testcase utc_connection_profile_get_wifi_essid_n
2487 * @description connection_profile_get_wifi_essid should fail with invalid parameter.
2488 * @scenario Verify connection_profile_get_wifi_essid by passing invalid parameter.
2490 int utc_connection_profile_get_wifi_essid_n(void)
2492 connection_profile_h profile_inval = NULL;
2495 if (wifi_supported) {
2496 int ret = connection_profile_get_wifi_essid(profile_inval, NULL);
2497 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2498 ret = connection_profile_get_wifi_essid(profile_inval, &essid);
2499 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2500 ret = connection_profile_get_wifi_essid(profile_wifi, NULL);
2501 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2502 ret = connection_profile_get_wifi_essid(profile_cellular, &essid);
2503 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2505 int ret = connection_profile_get_wifi_essid(profile_inval, NULL);
2506 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2513 * @testcase utc_connection_profile_get_wifi_bssid_p
2516 * @description Gets the BSSID (Basic Service Set Identifier).
2517 * @scenario Invoking connection_profile_get_wifi_bssid with valid parameter.
2519 int utc_connection_profile_get_wifi_bssid_p(void)
2523 int ret = connection_profile_get_wifi_bssid(profile_wifi, &bssid);
2524 FREE_RESOURCE(bssid);
2527 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_NONE);
2529 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2534 * @testcase utc_connection_profile_get_wifi_bssid_n
2537 * @description connection_profile_get_wifi_bssid should fail with invalid parameter.
2538 * @scenario Verify connection_profile_get_wifi_bssid by passing invalid parameter.
2540 int utc_connection_profile_get_wifi_bssid_n(void)
2542 connection_profile_h profile_inval = NULL;
2545 if (wifi_supported) {
2546 int ret = connection_profile_get_wifi_bssid(profile_inval, NULL);
2547 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2548 ret = connection_profile_get_wifi_bssid(profile_inval, &bssid);
2549 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2550 ret = connection_profile_get_wifi_bssid(profile_wifi, NULL);
2551 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2552 ret = connection_profile_get_wifi_bssid(profile_cellular, &bssid);
2553 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2555 int ret = connection_profile_get_wifi_bssid(profile_inval, NULL);
2556 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2563 * @testcase utc_connection_profile_get_wifi_rssi_p
2566 * @description Gets the RSSI.
2567 * @scenario Invoking connection_profile_get_wifi_rssi with valid parameter.
2569 int utc_connection_profile_get_wifi_rssi_p(void)
2573 if (wifi_supported) {
2574 int ret = connection_profile_get_wifi_rssi(profile_wifi, &rssi);
2575 CHECK_RETURN("connection_profile_get_wifi_rssi", ret, CONNECTION_ERROR_NONE);
2577 int ret = connection_profile_get_wifi_rssi(profile_wifi, &rssi);
2578 CHECK_RETURN("connection_profile_get_wifi_rssi", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2585 * @testcase utc_connection_profile_get_wifi_rssi_n
2588 * @description connection_profile_get_wifi_rssi should fail with invalid parameter.
2589 * @scenario Verify connection_profile_get_wifi_rssi by passing invalid parameter.
2591 int utc_connection_profile_get_wifi_rssi_n(void)
2593 connection_profile_h profile_inval = NULL;
2596 if (wifi_supported) {
2597 int ret = connection_profile_get_wifi_rssi(profile_inval, NULL);
2598 CHECK_RETURN("connection_profile_get_wifi_rssi", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2599 ret = connection_profile_get_wifi_rssi(profile_inval, &rssi);
2600 CHECK_RETURN("connection_profile_get_wifi_rssi", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2601 ret = connection_profile_get_wifi_rssi(profile_wifi, NULL);
2602 CHECK_RETURN("connection_profile_get_wifi_rssi", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2603 ret = connection_profile_get_wifi_rssi(profile_cellular, &rssi);
2604 CHECK_RETURN("connection_profile_get_wifi_rssi", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2606 int ret = connection_profile_get_wifi_rssi(profile_inval, NULL);
2607 CHECK_RETURN("connection_profile_get_wifi_rssi", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2614 * @testcase utc_connection_profile_get_wifi_frequency_p
2617 * @description Gets the frequency (MHz).
2618 * @scenario Invoking connection_profile_get_wifi_frequency with valid parameter.
2620 int utc_connection_profile_get_wifi_frequency_p(void)
2624 if (wifi_supported) {
2625 int ret = connection_profile_get_wifi_frequency(profile_wifi, &frequency);
2626 CHECK_RETURN("connection_profile_get_wifi_frequency", ret, CONNECTION_ERROR_NONE);
2628 int ret = connection_profile_get_wifi_frequency(profile_wifi, &frequency);
2629 CHECK_RETURN("connection_profile_get_wifi_frequency", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2636 * @testcase utc_connection_profile_get_wifi_frequency_n
2639 * @description connection_profile_get_wifi_frequency should fail with invalid parameter.
2640 * @scenario Verify connection_profile_get_wifi_frequency by passing invalid parameter.
2642 int utc_connection_profile_get_wifi_frequency_n(void)
2644 connection_profile_h profile_inval = NULL;
2647 if (wifi_supported) {
2648 int ret = connection_profile_get_wifi_frequency(profile_inval, NULL);
2649 CHECK_RETURN("connection_profile_get_wifi_frequency", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2650 ret = connection_profile_get_wifi_frequency(profile_inval, &frequency);
2651 CHECK_RETURN("connection_profile_get_wifi_frequency", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2652 ret = connection_profile_get_wifi_frequency(profile_wifi, NULL);
2653 CHECK_RETURN("connection_profile_get_wifi_frequency", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2654 ret = connection_profile_get_wifi_frequency(profile_cellular, &frequency);
2655 CHECK_RETURN("connection_profile_get_wifi_frequency", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2657 int ret = connection_profile_get_wifi_frequency(profile_inval, NULL);
2658 CHECK_RETURN("connection_profile_get_wifi_frequency", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2665 * @testcase utc_connection_profile_get_wifi_max_speed_p
2668 * @description Gets the max speed (Mbps).
2669 * @scenario Invoking connection_profile_get_wifi_max_speed with valid parameter.
2671 int utc_connection_profile_get_wifi_max_speed_p(void)
2675 if (wifi_supported) {
2676 int ret = connection_profile_get_wifi_max_speed(profile_wifi, &max_speed);
2677 CHECK_RETURN("connection_profile_get_wifi_max_speed", ret, CONNECTION_ERROR_NONE);
2679 int ret = connection_profile_get_wifi_max_speed(profile_wifi, &max_speed);
2680 CHECK_RETURN("connection_profile_get_wifi_max_speed", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2687 * @testcase utc_connection_profile_get_wifi_max_speed_n
2690 * @description connection_profile_get_wifi_max_speed should fail with invalid parameter.
2691 * @scenario Verify connection_profile_get_wifi_max_speed by passing invalid parameter.
2693 int utc_connection_profile_get_wifi_max_speed_n(void)
2695 connection_profile_h profile_inval = NULL;
2698 if (wifi_supported) {
2699 int ret = connection_profile_get_wifi_max_speed(profile_inval, NULL);
2700 CHECK_RETURN("connection_profile_get_wifi_max_speed", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2701 ret = connection_profile_get_wifi_max_speed(profile_inval, &max_speed);
2702 CHECK_RETURN("connection_profile_get_wifi_max_speed", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2703 ret = connection_profile_get_wifi_max_speed(profile_wifi, NULL);
2704 CHECK_RETURN("connection_profile_get_wifi_max_speed", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2705 ret = connection_profile_get_wifi_max_speed(profile_cellular, &max_speed);
2706 CHECK_RETURN("connection_profile_get_wifi_max_speed", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2708 int ret = connection_profile_get_wifi_max_speed(profile_inval, NULL);
2709 CHECK_RETURN("connection_profile_get_wifi_max_speed", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2716 * @testcase utc_connection_profile_get_wifi_security_type_p
2719 * @description Gets the security mode of Wi-Fi.
2720 * @scenario Invoking connection_profile_get_wifi_security_type with valid parameter.
2722 int utc_connection_profile_get_wifi_security_type_p(void)
2724 connection_wifi_security_type_e sec_type;
2726 if (wifi_supported) {
2727 int ret = connection_profile_get_wifi_security_type(profile_wifi, &sec_type);
2728 CHECK_RETURN("connection_profile_get_wifi_security_type", ret, CONNECTION_ERROR_NONE);
2730 int ret = connection_profile_get_wifi_security_type(profile_wifi, &sec_type);
2731 CHECK_RETURN("connection_profile_get_wifi_security_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2738 * @testcase utc_connection_profile_get_wifi_security_type_n
2741 * @description connection_profile_get_wifi_security_type should fail with invalid parameter.
2742 * @scenario Verify connection_profile_get_wifi_security_type by passing invalid parameter.
2744 int utc_connection_profile_get_wifi_security_type_n(void)
2746 connection_profile_h profile_inval = NULL;
2747 connection_wifi_security_type_e sec_type;
2749 if (wifi_supported) {
2750 int ret = connection_profile_get_wifi_security_type(profile_inval, NULL);
2751 CHECK_RETURN("connection_profile_get_wifi_security_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2752 ret = connection_profile_get_wifi_security_type(profile_inval, &sec_type);
2753 CHECK_RETURN("connection_profile_get_wifi_security_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2754 ret = connection_profile_get_wifi_security_type(profile_wifi, NULL);
2755 CHECK_RETURN("connection_profile_get_wifi_security_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2756 ret = connection_profile_get_wifi_security_type(profile_cellular, &sec_type);
2757 CHECK_RETURN("connection_profile_get_wifi_security_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2759 int ret = connection_profile_get_wifi_security_type(profile_inval, NULL);
2760 CHECK_RETURN("connection_profile_get_wifi_security_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2767 * @testcase utc_connection_profile_get_wifi_encryption_type_p
2770 * @description Gets the security mode of Wi-Fi.
2771 * @scenario Invoking connection_profile_get_wifi_encryption_type with valid parameter.
2773 int utc_connection_profile_get_wifi_encryption_type_p(void)
2775 connection_wifi_encryption_type_e enc_type;
2777 if (wifi_supported) {
2778 int ret = connection_profile_get_wifi_encryption_type(profile_wifi, &enc_type);
2779 CHECK_RETURN("connection_profile_get_wifi_encryption_type", ret, CONNECTION_ERROR_NONE);
2781 int ret = connection_profile_get_wifi_encryption_type(profile_wifi, &enc_type);
2782 CHECK_RETURN("connection_profile_get_wifi_encryption_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2789 * @testcase utc_connection_profile_get_wifi_encryption_type_n
2792 * @description connection_profile_get_wifi_encryption_type should fail with invalid parameter.
2793 * @scenario Verify connection_profile_get_wifi_encryption_type by passing invalid parameter.
2795 int utc_connection_profile_get_wifi_encryption_type_n(void)
2797 connection_profile_h profile_inval = NULL;
2798 connection_wifi_encryption_type_e enc_type;
2800 if (wifi_supported) {
2801 int ret = connection_profile_get_wifi_encryption_type(profile_inval, NULL);
2802 CHECK_RETURN("connection_profile_get_wifi_encryption_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2803 ret = connection_profile_get_wifi_encryption_type(profile_inval, &enc_type);
2804 CHECK_RETURN("connection_profile_get_wifi_encryption_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2805 ret = connection_profile_get_wifi_encryption_type(profile_wifi, NULL);
2806 CHECK_RETURN("connection_profile_get_wifi_encryption_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2807 ret = connection_profile_get_wifi_encryption_type(profile_cellular, &enc_type);
2808 CHECK_RETURN("connection_profile_get_wifi_encryption_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2810 int ret = connection_profile_get_wifi_encryption_type(profile_inval, NULL);
2811 CHECK_RETURN("connection_profile_get_wifi_encryption_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2818 * @testcase utc_connection_profile_is_wifi_passphrase_required_p
2821 * @description Checks whether passphrase is required.
2822 * @scenario Invoking connection_profile_is_wifi_passphrase_required with valid parameter.
2824 int utc_connection_profile_is_wifi_passphrase_required_p(void)
2828 if (wifi_supported) {
2829 int ret = connection_profile_is_wifi_passphrase_required(profile_wifi, &flag);
2830 CHECK_RETURN("connection_profile_is_wifi_passphrase_required", ret, CONNECTION_ERROR_NONE);
2832 int ret = connection_profile_is_wifi_passphrase_required(profile_wifi, &flag);
2833 CHECK_RETURN("connection_profile_is_wifi_passphrase_required", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2840 * @testcase utc_connection_profile_is_wifi_passphrase_required_n
2843 * @description connection_profile_is_wifi_passphrase_required should fail with invalid parameter.
2844 * @scenario Verify connection_profile_is_wifi_passphrase_required by passing invalid parameter.
2846 int utc_connection_profile_is_wifi_passphrase_required_n(void)
2848 connection_profile_h profile_inval = NULL;
2851 if (wifi_supported) {
2852 int ret = connection_profile_is_wifi_passphrase_required(profile_inval, NULL);
2853 CHECK_RETURN("connection_profile_is_wifi_passphrase_required", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2854 ret = connection_profile_is_wifi_passphrase_required(profile_inval, &flag);
2855 CHECK_RETURN("connection_profile_is_wifi_passphrase_required", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2856 ret = connection_profile_is_wifi_passphrase_required(profile_wifi, NULL);
2857 CHECK_RETURN("connection_profile_is_wifi_passphrase_required", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2858 ret = connection_profile_is_wifi_passphrase_required(profile_cellular, &flag);
2859 CHECK_RETURN("connection_profile_is_wifi_passphrase_required", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2861 int ret = connection_profile_is_wifi_passphrase_required(profile_inval, NULL);
2862 CHECK_RETURN("connection_profile_is_wifi_passphrase_required", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2869 * @testcase utc_connection_profile_set_wifi_passphrase_p
2872 * @description Sets the passphrase of the Wi-Fi WPA.
2873 * @scenario Invoking connection_profile_set_wifi_passphrase with valid parameter.
2875 int utc_connection_profile_set_wifi_passphrase_p(void)
2877 if (wifi_supported) {
2878 int ret = connection_profile_set_wifi_passphrase(profile_wifi, "keystring");
2879 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_NONE);
2881 int ret = connection_profile_set_wifi_passphrase(profile_wifi, "keystring");
2882 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2889 * @testcase utc_connection_profile_set_wifi_passphrase_n
2892 * @description connection_profile_set_wifi_passphrase should fail with invalid parameter.
2893 * @scenario Verify connection_profile_set_wifi_passphrase by passing invalid parameter.
2895 int utc_connection_profile_set_wifi_passphrase_n(void)
2897 connection_profile_h profile_inval = NULL;
2899 if (wifi_supported) {
2900 int ret = connection_profile_set_wifi_passphrase(profile_inval, NULL);
2901 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2902 ret = connection_profile_set_wifi_passphrase(profile_inval, "keystring");
2903 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2904 ret = connection_profile_set_wifi_passphrase(profile_wifi, NULL);
2905 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2906 ret = connection_profile_set_wifi_passphrase(profile_cellular, "keystring");
2907 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2909 int ret = connection_profile_set_wifi_passphrase(profile_inval, NULL);
2910 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2917 * @testcase utc_connection_profile_is_wifi_wps_supported_p
2920 * @description Checks whether the WPS (Wi-Fi Protected Setup) is supported.
2921 * @scenario Invoking connection_profile_is_wifi_wps_supported with valid parameter.
2923 int utc_connection_profile_is_wifi_wps_supported_p(void)
2927 if (wifi_supported) {
2928 int ret = connection_profile_is_wifi_wps_supported(profile_wifi, &flag);
2929 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_NONE);
2931 int ret = connection_profile_is_wifi_wps_supported(profile_wifi, &flag);
2932 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2939 * @testcase utc_connection_profile_is_wifi_wps_supported_n
2942 * @description connection_profile_is_wifi_wps_supported should fail with invalid parameter.
2943 * @scenario Verify connection_profile_is_wifi_wps_supported by passing invalid parameter.
2945 int utc_connection_profile_is_wifi_wps_supported_n(void)
2947 connection_profile_h profile_inval = NULL;
2950 if (wifi_supported) {
2951 int ret = connection_profile_is_wifi_wps_supported(profile_inval, NULL);
2952 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2953 ret = connection_profile_is_wifi_wps_supported(profile_inval, &flag);
2954 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2955 ret = connection_profile_is_wifi_wps_supported(profile_wifi, NULL);
2956 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2957 ret = connection_profile_is_wifi_wps_supported(profile_cellular, &flag);
2958 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2960 int ret = connection_profile_is_wifi_wps_supported(profile_inval, NULL);
2961 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2968 * @testcase utc_connection_profile_get_ipv6_state_p
2971 * @description Gets IPv6 state
2972 * @scenario Invoking connection_profile_get_ipv6_state with valid parameter.
2974 int utc_connection_profile_get_ipv6_state_p(void)
2976 connection_profile_state_e state;
2977 int ret = test_get_any_profile(&profile_temp);
2979 if (all_features_not_supported) {
2980 ret = connection_profile_get_ipv6_state(profile_temp, &state);
2981 CHECK_RETURN("connection_profile_get_ipv6_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2985 assert(profile_temp);
2987 ret = connection_profile_get_ipv6_state(profile_temp, &state);
2988 CHECK_RETURN("connection_profile_get_ipv6_state", ret, CONNECTION_ERROR_NONE);
2994 * @testcase utc_connection_profile_get_ipv6_state_n
2997 * @description connection_profile_get_ipv6_state should be failed with invalid parameter.
2998 * @scenario Verify connection_profile_get_ipv6_state by passing invalid parameter.
3000 int utc_connection_profile_get_ipv6_state_n(void)
3002 connection_profile_h profile_inval = NULL;
3003 connection_profile_state_e state;
3005 if (all_features_not_supported) {
3006 int ret = connection_profile_get_ipv6_state(profile_inval, NULL);
3007 CHECK_RETURN("connection_profile_get_ipv6_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3011 int ret = connection_profile_get_ipv6_state(profile_inval, NULL);
3012 CHECK_RETURN("connection_profile_get_ipv6_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3013 ret = connection_profile_get_ipv6_state(profile_inval, &state);
3014 CHECK_RETURN("connection_profile_get_ipv6_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3015 ret = connection_profile_get_ipv6_state(profile_wifi, NULL);
3016 CHECK_RETURN("connection_profile_get_ipv6_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3022 * @testcase utc_connection_profile_get_prefix_length_p
3025 * @description Gets prefix length
3026 * @scenario Invoking connection_profile_get_ipv6_state with valid parameter.
3028 int utc_connection_profile_get_prefix_length_p(void)
3032 if (all_features_not_supported) {
3033 int ret = connection_profile_get_prefix_length(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &length);
3034 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3035 ret = connection_profile_get_prefix_length(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV6, &length);
3036 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3039 int ret = connection_get_current_profile(connection, &profile_temp);
3040 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_NONE);
3041 ret = connection_profile_get_prefix_length(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &length);
3042 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_NONE);
3043 ret = connection_profile_get_prefix_length(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV6, &length);
3044 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_NONE);
3050 * @testcase utc_connection_profile_get_prefix_length_n
3053 * @description connection_profile_get_prefix_length should be failed with invalid parameter.
3054 * @scenario Verify prefix_length by passing invalid parameter.
3056 int utc_connection_profile_get_prefix_length_n(void)
3058 connection_profile_h profile_inval = NULL;
3061 if (all_features_not_supported) {
3062 int ret = connection_profile_get_prefix_length(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, &length);
3063 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3064 ret = connection_profile_get_prefix_length(profile_wifi, CONNECTION_ADDRESS_FAMILY_IPV6, NULL);
3065 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3068 int ret = connection_profile_get_prefix_length(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
3069 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3070 ret = connection_profile_get_prefix_length(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, &length);
3071 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3072 ret = connection_profile_get_prefix_length(profile_wifi, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
3073 CHECK_RETURN("connection_profile_get_prefix_length", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3079 * @testcase utc_connection_profile_set_prefix_length_p
3082 * @description Sets prefix length
3083 * @scenario Invoking connection_profile_set_ipv6_state with valid parameter.
3085 int utc_connection_profile_set_prefix_length_p(void)
3089 if (all_features_not_supported) {
3090 int ret = connection_profile_set_prefix_length(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, length);
3091 CHECK_RETURN("connection_profile_set_prefix_length", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3094 int ret = connection_get_current_profile(connection, &profile_temp);
3095 CHECK_RETURN("connection_profile_set_prefix_length", ret, CONNECTION_ERROR_NONE);
3096 ret = connection_profile_set_prefix_length(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, length);
3097 CHECK_RETURN("connection_profile_set_prefix_length", ret, CONNECTION_ERROR_NONE);
3098 ret = connection_profile_set_prefix_length(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV6, length);
3099 CHECK_RETURN("connection_profile_set_prefix_length", ret, CONNECTION_ERROR_NONE);
3105 * @testcase utc_connection_profile_set_prefix_length_n
3108 * @description connection_profile_set_prefix_length should be failed with invalid parameter.
3109 * @scenario Verify prefix_length by passing invalid parameter.
3111 int utc_connection_profile_set_prefix_length_n(void)
3113 connection_profile_h profile_inval = NULL;
3116 if (all_features_not_supported) {
3117 int ret = connection_profile_set_prefix_length(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, length);
3118 CHECK_RETURN("connection_profile_set_prefix_length", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3121 int ret = connection_profile_set_prefix_length(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, length);
3122 CHECK_RETURN("connection_profile_set_prefix_length", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3128 * @testcase utc_connection_profile_get_dns_config_type_p
3131 * @description Gets DNS configuration type
3132 * @scenario Invoking connection_profile_get_dns_config_typ with valid parameter.
3134 int utc_connection_profile_get_dns_config_type_p(void)
3136 connection_dns_config_type_e config_type;
3137 int ret = connection_get_current_profile(connection, &profile_temp);
3138 PRINT_RETURN("connection_get_current_profile", ret);
3140 if (all_features_not_supported) {
3141 ret = connection_profile_get_dns_config_type(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &config_type);
3142 CHECK_RETURN("connection_profile_get_dns_config_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3146 assert(profile_temp);
3148 ret = connection_profile_get_dns_config_type(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, &config_type);
3149 CHECK_RETURN("connection_profile_get_dns_config_type", ret, CONNECTION_ERROR_NONE);
3150 ret = connection_profile_get_dns_config_type(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV6, &config_type);
3151 CHECK_RETURN("connection_profile_get_dns_config_type", ret, CONNECTION_ERROR_NONE);
3157 * @testcase utc_connection_profile_get_dns_config_type_n
3160 * @description connection_profile_get_dns_config_typ should be failed with invalid parameter.
3161 * @scenario Verify connection_profile_get_dns_config_typ by passing invalid parameter.
3163 int utc_connection_profile_get_dns_config_type_n(void)
3165 connection_profile_h profile_inval = NULL;
3166 connection_dns_config_type_e config_type;
3168 if (all_features_not_supported) {
3169 int ret = connection_profile_get_dns_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
3170 CHECK_RETURN("connection_profile_get_dns_config_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3174 int ret = connection_profile_get_dns_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, NULL);
3175 CHECK_RETURN("connection_profile_get_dns_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3176 ret = connection_profile_get_dns_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV6, &config_type);
3177 CHECK_RETURN("connection_profile_get_dns_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3178 ret = connection_profile_get_dns_config_type(profile_wifi, CONNECTION_ADDRESS_FAMILY_IPV6, NULL);
3179 CHECK_RETURN("connection_profile_get_dns_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3185 * @testcase utc_connection_profile_set_dns_config_type_p
3188 * @description Sets DNS configuration type
3189 * @scenario Invoking connection_profile_set_dns_config_typ with valid parameter.
3191 int utc_connection_profile_set_dns_config_type_p(void)
3193 if (all_features_not_supported) {
3194 int ret = connection_profile_set_dns_config_type(profile_wifi, CONNECTION_ADDRESS_FAMILY_IPV6, CONNECTION_DNS_CONFIG_TYPE_DYNAMIC);
3195 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3198 int ret = connection_get_current_profile(connection, &profile_temp);
3199 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_NONE);
3200 ret = connection_profile_set_dns_config_type(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, CONNECTION_DNS_CONFIG_TYPE_STATIC);
3201 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_NONE);
3202 ret = connection_profile_set_dns_config_type(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV4, CONNECTION_DNS_CONFIG_TYPE_DYNAMIC);
3203 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_NONE);
3204 ret = connection_profile_set_dns_config_type(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV6, CONNECTION_DNS_CONFIG_TYPE_STATIC);
3205 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_NONE);
3206 ret = connection_profile_set_dns_config_type(profile_temp, CONNECTION_ADDRESS_FAMILY_IPV6, CONNECTION_DNS_CONFIG_TYPE_DYNAMIC);
3207 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_NONE);
3213 * @testcase utc_connection_profile_set_dns_config_type_n
3216 * @description connection_profile_set_dns_config_typ should be failed with invalid parameter.
3217 * @scenario Verify connection_profile_get_dns_config_typ by passing invalid parameter.
3219 int utc_connection_profile_set_dns_config_type_n(void)
3221 connection_profile_h profile_inval = NULL;
3223 if (all_features_not_supported) {
3224 int ret = connection_profile_set_dns_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, CONNECTION_DNS_CONFIG_TYPE_DYNAMIC);
3225 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3228 int ret = connection_profile_set_dns_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, CONNECTION_DNS_CONFIG_TYPE_STATIC);
3229 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3230 ret = connection_profile_set_dns_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV6, CONNECTION_DNS_CONFIG_TYPE_STATIC);
3231 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3232 ret = connection_profile_set_dns_config_type(profile_inval, CONNECTION_ADDRESS_FAMILY_IPV4, CONNECTION_DNS_CONFIG_TYPE_DYNAMIC);
3233 CHECK_RETURN("connection_profile_set_dns_config_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3239 * @testcase utc_connection_profile_get_internet_state_p
3242 * @description Gets internet state.
3243 * @scenario Verify connection_profile_get_internet_state by passing valid parameter.
3245 int utc_connection_profile_get_internet_state_p(void)
3247 connection_internet_state_e internet_state;
3249 if (all_features_not_supported) {
3250 int ret = connection_profile_get_internet_state(profile_wifi, &internet_state);
3251 CHECK_RETURN("connection_profile_get_internet_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3254 connection_profile_h profile_h = NULL;
3255 int ret = test_get_any_profile(&profile_h);
3256 ret = connection_profile_get_internet_state(profile_h, &internet_state);
3257 CHECK_RETURN("connection_profile_get_internet_state", ret, CONNECTION_ERROR_NONE);
3263 * @testcase utc_connection_profile_get_internet_state_n1
3266 * @description connection_profile_get_internet_state should be failed with invalid parameter.
3267 * @scenario Verify connection_profile_get_internet_state by passing profile as NULL.
3269 int utc_connection_profile_get_internet_state_n1(void)
3271 connection_internet_state_e internet_state;
3273 if (all_features_not_supported) {
3274 int ret = connection_profile_get_internet_state(NULL, &internet_state);
3275 CHECK_RETURN("connection_profile_get_internet_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3278 int ret = connection_profile_get_internet_state(NULL, &internet_state);
3279 CHECK_RETURN("connection_profile_get_internet_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3285 * @testcase utc_connection_profile_get_internet_state_n2
3288 * @description connection_profile_get_internet_state should be failed with invalid parameter.
3289 * @scenario Verify connection_profile_get_internet_state by passing invalid parameter.
3291 int utc_connection_profile_get_internet_state_n2(void)
3293 if (all_features_not_supported) {
3294 int ret = connection_profile_get_internet_state(profile_temp, NULL);
3295 CHECK_RETURN("connection_profile_get_internet_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3298 connection_profile_h profile_h = NULL;
3299 int ret = test_get_any_profile(&profile_h);
3300 ret = connection_profile_get_internet_state(profile_h, NULL);
3301 CHECK_RETURN("connection_profile_get_internet_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3307 * @testcase utc_connection_profile_destroy_p
3310 * @description Destroys a profile handle.
3311 * @scenario Invoking connection_profile_destroy with valid parameter.
3313 int utc_connection_profile_destroy_p(void)
3315 int ret = CONNECTION_ERROR_INVALID_PARAMETER;
3317 if (all_features_not_supported) {
3318 ret = connection_profile_destroy(profile_temp);
3319 CHECK_RETURN("connection_profile_destroy", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3323 test_get_any_profile(&profile_temp);
3324 assert(profile_temp);
3325 ret = connection_profile_destroy(profile_temp);
3326 CHECK_RETURN("connection_profile_destroy", ret, CONNECTION_ERROR_NONE);
3332 * @testcase utc_connection_profile_destroy_n
3335 * @description connection_profile_destroy should fail with invalid parameter.
3336 * @scenario Verify connection_profile_destroy by passing invalid parameter.
3338 int utc_connection_profile_destroy_n(void)
3340 int ret = connection_profile_destroy(NULL);
3342 if (all_features_not_supported)
3343 CHECK_RETURN("connection_profile_destroy", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3345 CHECK_RETURN("connection_profile_destroy", ret, CONNECTION_ERROR_INVALID_PARAMETER);