Merge "Add LCOV macro for coverage" into tizen
[platform/core/api/connection.git] / unittest / utc-connection-profile.c
1 //
2 // Copyright (c) 2020 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 #include "utc-connection-common.h"
17
18 //& set: ConnectionProfile
19
20 static void test_profile_state_changed_cb(connection_profile_state_e state, void* user_data)
21 {
22         char *profile_name;
23         connection_profile_h profile = user_data;
24
25         if (profile == NULL)
26                 return;
27
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);
32                 return;
33         }
34
35         FREE_RESOURCE(profile_name);
36 }
37
38 /**
39  * @function            utc_connection_profile_startup
40  * @description         Called before each test
41  * @parameter           NA
42  * @return                      NA
43  */
44 void utc_connection_profile_startup(void)
45 {
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);
50
51         if (telephony_supported == false && wifi_supported == false
52                         && bt_tethering_supported == false && ethernet_supported == false) {
53                 all_features_not_supported = true;
54                 return;
55         }
56
57         int ret = connection_create(&connection);
58         PRINT_RETURN("connection_create", ret);
59
60         if (ret != CONNECTION_ERROR_NONE)
61                 return;
62
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);
67                 }
68         }
69
70         if (wifi_supported) {
71                 if (!profile_wifi) {
72                         ret = connection_profile_create(CONNECTION_PROFILE_TYPE_WIFI, NULL, &profile_wifi);
73                         PRINT_RETURN("connection_profile_create", ret);
74                 }
75         }
76 }
77
78 /**
79  * @function            utc_connection_profile_cleanup
80  * @description         Called after each test
81  * @parameter           NA
82  * @return                      NA
83  */
84 void utc_connection_profile_cleanup(void)
85 {
86         int ret;
87
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;
93         }
94
95         if (profile_wifi) {
96                 ret = connection_profile_destroy(profile_wifi);
97                 PRINT_RETURN("connection_profile_destroy", ret);
98                 if (ret == CONNECTION_ERROR_NONE)
99                         profile_wifi = NULL;
100         }
101
102         if (profile_temp) {
103                 ret = connection_profile_destroy(profile_temp);
104                 PRINT_RETURN("connection_profile_destroy", ret);
105                 if (ret == CONNECTION_ERROR_NONE)
106                         profile_temp = NULL;
107         }
108
109         if (connection) {
110                 ret = connection_destroy(connection);
111                 PRINT_RETURN("connection_destroy", ret);
112                 if (ret == CONNECTION_ERROR_NONE)
113                         connection = NULL;
114         }
115 }
116
117 /* Common profile operations. */
118
119 /**
120  * @testcase            utc_connection_profile_create_p
121  * @since_tizen         2.3
122  * @type                Positive
123  * @description         Creates a profile handle.
124  * @scenario            Invoking connection_profile_create with valid parameter.
125  */
126 int utc_connection_profile_create_p(void)
127 {
128         int ret;
129
130         if (profile_cellular) {
131                 ret = connection_profile_destroy(profile_cellular);
132                 PRINT_RETURN("connection_profile_destroy", ret);
133                 profile_cellular = NULL;
134         }
135
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);
139         } else {
140                 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, "Net", &profile_cellular);
141                 CHECK_RETURN("connection_profile_create", ret, CONNECTION_ERROR_NOT_SUPPORTED);
142         }
143
144         return 0;
145 }
146
147 /**
148  * @testcase            utc_connection_profile_create_n
149  * @since_tizen         2.3
150  * @type                Negative
151  * @description         should not creates a profile handle.
152  * @scenario            Verify connection_profile_create by passing invalid parameter.
153  */
154 int utc_connection_profile_create_n(void)
155 {
156         int ret;
157         connection_profile_h profile_temp = NULL;
158
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);
162                 return 0;
163         }
164
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);
172         } else {
173                 ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, "Net", NULL);
174                 CHECK_RETURN("connection_profile_create", ret, CONNECTION_ERROR_NOT_SUPPORTED);
175         }
176
177         return 0;
178 }
179
180 /**
181  * @testcase            utc_connection_profile_clone_p
182  * @since_tizen         2.3
183  * @type                Positive
184  * @description         Clones a profile handle.
185  * @scenario            Verify connection_profile_clone with valid parameter and destroy it.
186  */
187 int utc_connection_profile_clone_p(void)
188 {
189         connection_profile_h profile_temp = NULL;
190         int ret = 0;
191         connection_profile_h profile_to_be_cloned = NULL;
192
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);
196                 return 0;
197         }
198
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);
203
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);
208         }
209
210         return 0;
211 }
212
213 /**
214  * @testcase            utc_connection_profile_clone_n
215  * @since_tizen         2.3
216  * @type                Negative
217  * @description         should not Clones a profile handle.
218  * @scenario            Verify connection_profile_clone by passing invalid parameters.
219  */
220 int utc_connection_profile_clone_n(void)
221 {
222         int ret;
223         connection_profile_h profile_temp = NULL;
224         connection_profile_h profile_inval = NULL;
225
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);
229                 return 0;
230         }
231
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);
238
239         return 0;
240 }
241
242 /**
243  * @testcase            utc_connection_profile_get_name_p
244  * @since_tizen         2.3
245  * @type                Positive
246  * @description         Gets the profile name.
247  * @scenario            Get the profile name by invoking connection_profile_get_name with a valid parameter.
248  */
249 int utc_connection_profile_get_name_p(void)
250 {
251         int ret;
252         char *name = NULL;
253
254         if (all_features_not_supported) {
255                 ret = connection_profile_get_name(profile_temp, &name);
256                 FREE_RESOURCE(name);
257                 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_NOT_SUPPORTED);
258                 return 0;
259         }
260
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);
264
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);
268
269         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
270         ret = connection_profile_get_name(profile_temp, &name);
271         FREE_RESOURCE(name);
272         CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_NONE);
273
274         return 0;
275 }
276
277 /**
278  * @testcase            utc_connection_profile_get_name_n
279  * @since_tizen         2.3
280  * @type                Negative
281  * @description         should not return profile handle.
282  * @scenario            Verify connection_profile_get_name by passing invalid profile handle.
283  */
284 int utc_connection_profile_get_name_n(void)
285 {
286         int ret;
287         char *name = NULL;
288         connection_profile_h profile_inval = NULL;
289
290         if (all_features_not_supported) {
291                 ret = connection_profile_get_name(profile_inval, NULL);
292                 FREE_RESOURCE(name);
293                 CHECK_RETURN("connection_profile_get_name", ret, CONNECTION_ERROR_NOT_SUPPORTED);
294                 return 0;
295         }
296
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);
300         FREE_RESOURCE(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);
304
305         return 0;
306 }
307
308 /**
309  * @testcase            utc_connection_profile_get_id_p
310  * @since_tizen         2.3
311  * @type                Positive
312  * @description         Gets the profile ID.
313  * @scenario            Invoking connection_profile_get_id with valid profile handle.
314  */
315 int utc_connection_profile_get_id_p(void)
316 {
317         char *id = NULL;
318         connection_profile_h profile_h = NULL;
319         int ret = test_get_any_profile(&profile_h);
320
321         if (all_features_not_supported) {
322                 ret = connection_profile_get_id(profile_temp, &id);
323                 FREE_RESOURCE(id);
324                 CHECK_RETURN("connection_profile_get_id", ret, CONNECTION_ERROR_NOT_SUPPORTED);
325                 return 0;
326         }
327
328         profile_temp = profile_h;
329         assert(profile_temp);
330
331         ret = connection_profile_get_id(profile_temp, &id);
332         FREE_RESOURCE(id);
333         CHECK_RETURN("connection_profile_get_id", ret, CONNECTION_ERROR_NONE);
334
335         return 0;
336 }
337
338 /**
339  * @testcase            utc_connection_profile_get_id_n
340  * @since_tizen         2.3
341  * @type                Negative
342  * @description         should not return profile ID.
343  * @scenario            Verify connection_profile_get_id by passing invalid parameter..
344  */
345 int utc_connection_profile_get_id_n(void)
346 {
347         int ret;
348         char *id = NULL;
349         connection_profile_h profile_inval = NULL;
350
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);
354                 return 0;
355         }
356
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);
363
364         return 0;
365 }
366
367
368 /**
369  * @testcase            utc_connection_profile_get_type_p
370  * @since_tizen         2.3
371  * @type                Positive
372  * @description         Gets the network type.
373  * @scenario            connection_profile_get_type should return profile type.
374  */
375 int utc_connection_profile_get_type_p(void)
376 {
377         connection_profile_type_e type;
378         int ret = test_get_any_profile(&profile_temp);
379
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);
383                 return 0;
384         }
385
386         assert(profile_temp);
387         ret = connection_profile_get_type(profile_temp, &type);
388         CHECK_RETURN("connection_profile_get_type", ret, CONNECTION_ERROR_NONE);
389
390         return 0;
391 }
392
393 /**
394  * @testcase            utc_connection_profile_get_type_n
395  * @since_tizen         2.3
396  * @type                Negative
397  * @description         should not get the network type.
398  * @scenario            Verify connection_profile_get_type by passing invalid parameter.
399  */
400 int utc_connection_profile_get_type_n(void)
401 {
402         int ret;
403         connection_profile_type_e type;
404         connection_profile_h profile_inval = NULL;
405
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);
409                 return 0;
410         }
411
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);
418
419         return 0;
420 }
421
422 /**
423  * @testcase            utc_connection_profile_get_network_interface_name_p
424  * @since_tizen         2.3
425  * @type                Positive
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.
428  */
429 int utc_connection_profile_get_network_interface_name_p(void)
430 {
431         char *name = NULL;
432         int ret = test_get_any_profile(&profile_temp);
433
434         if (all_features_not_supported) {
435                 ret = connection_profile_get_network_interface_name(profile_temp, &name);
436                 FREE_RESOURCE(name);
437                 CHECK_RETURN("connection_profile_get_network_interface_name", ret, CONNECTION_ERROR_NOT_SUPPORTED);
438                 return 0;
439         }
440
441         assert(profile_temp);
442         ret = connection_profile_get_network_interface_name(profile_temp, &name);
443         FREE_RESOURCE(name);
444         CHECK_RETURN("connection_profile_get_network_interface_name", ret, CONNECTION_ERROR_NONE);
445
446         return 0;
447 }
448
449 /**
450  * @testcase            utc_connection_profile_get_network_interface_name_n
451  * @since_tizen         2.3
452  * @type                Negative
453  * @description         should not get the name of the network interface.
454  * @scenario            Verify connection_profile_get_network_interface_name by passing invalid parameter.
455  */
456 int utc_connection_profile_get_network_interface_name_n(void)
457 {
458         int ret;
459         char *name = NULL;
460         connection_profile_h profile_inval = NULL;
461
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);
465                 return 0;
466         }
467
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);
474
475         return 0;
476 }
477
478 /**
479  * @testcase            utc_connection_profile_get_state_p
480  * @since_tizen         2.3
481  * @type                Positive
482  * @description         Gets the network type and the state of the profile.
483  * @scenario            Verify connection_profile_get_state with valid parameter.
484  */
485 int utc_connection_profile_get_state_p(void)
486 {
487         connection_profile_state_e state;
488         int ret = test_get_any_profile(&profile_temp);
489
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);
493                 return 0;
494         }
495
496         assert(profile_temp);
497         ret = connection_profile_get_state(profile_temp, &state);
498         CHECK_RETURN("connection_profile_get_state", ret, CONNECTION_ERROR_NONE);
499
500         return 0;
501 }
502
503 /**
504  * @testcase            utc_connection_profile_get_state_n
505  * @since_tizen         2.3
506  * @type                Negative
507  * @description         should not get the state of the profile.
508  * @scenario            Verify connection_profile_get_state by passing invalid parameter.
509  */
510 int utc_connection_profile_get_state_n(void)
511 {
512         int ret;
513         connection_profile_state_e state;
514         connection_profile_h profile_inval = NULL;
515
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);
519                 return 0;
520         }
521
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);
528
529         return 0;
530 }
531
532 /**
533  * @testcase            utc_connection_profile_get_ip_config_type_p
534  * @since_tizen         2.3
535  * @type                Positive
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.
538  */
539 int utc_connection_profile_get_ip_config_type_p(void)
540 {
541         connection_ip_config_type_e type;
542         int ret = test_get_any_profile(&profile_temp);
543
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);
547                 return 0;
548         }
549
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);
553
554         return 0;
555 }
556
557 /**
558  * @testcase            utc_connection_profile_get_ip_config_type_n
559  * @since_tizen         2.3
560  * @type                Negative
561  * @description         should not return the type of the IP config.
562  * @scenario            Verify connection_profile_get_ip_config_type by passing invalid parameter..
563  */
564 int utc_connection_profile_get_ip_config_type_n(void)
565 {
566         int ret;
567         connection_ip_config_type_e type;
568         connection_profile_h profile_inval = NULL;
569
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);
573                 return 0;
574         }
575
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);
588
589         return 0;
590 }
591
592 /**
593  * @testcase            utc_connection_profile_get_ip_address_p
594  * @since_tizen         2.3
595  * @type                Positive
596  * @description         Gets the IP address.Shoudl return IP Address.
597  * @scenario            Invoking connection_profile_get_ip_address with valid parameter.
598  */
599 int utc_connection_profile_get_ip_address_p(void)
600 {
601         char *ip_addr = NULL;
602         int ret = test_get_any_profile(&profile_temp);
603
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);
608                 return 0;
609         }
610
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);
615
616         return 0;
617 }
618
619 /**
620  * @testcase            utc_connection_profile_get_ip_address_n
621  * @since_tizen         2.3
622  * @type                Negative
623  * @description         should not return IP Address.
624  * @scenario            Verify connection_profile_get_ip_address by passing invalid parameter.
625  */
626 int utc_connection_profile_get_ip_address_n(void)
627 {
628         int ret;
629         char *ip_addr = NULL;
630         connection_profile_h profile_inval = NULL;
631
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);
635                 return 0;
636         }
637
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);
650
651         return 0;
652 }
653
654 /**
655  * @testcase            utc_connection_profile_get_subnet_mask_p
656  * @since_tizen         2.3
657  * @type                Positive
658  * @description         Gets the Subnet Mask.
659  * @scenario            Invoking connection_profile_get_subnet_mask with valid parameter.
660  */
661 int utc_connection_profile_get_subnet_mask_p(void)
662 {
663         char *ip_addr = NULL;
664         int ret = test_get_any_profile(&profile_temp);
665
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);
670                 return 0;
671         }
672
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);
677
678         return 0;
679 }
680
681 /**
682  * @testcase            utc_connection_profile_get_subnet_mask_n
683  * @since_tizen         2.3
684  * @type                Negative
685  * @description         should not return any subnet mask.
686  * @scenario            Verify connection_profile_get_subnet_mask by passing invalid parameter.
687  */
688 int utc_connection_profile_get_subnet_mask_n(void)
689 {
690         int ret;
691         char *ip_addr = NULL;
692         connection_profile_h profile_inval = NULL;
693
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);
697                 return 0;
698         }
699
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);
712
713         return 0;
714 }
715
716 /**
717  * @testcase            utc_connection_profile_get_gateway_address_p
718  * @since_tizen         2.3
719  * @type                Positive
720  * @description         Gets the Gateway address.
721  * @scenario            Invoking connection_profile_get_gateway_address with valid parameter.
722  */
723 int utc_connection_profile_get_gateway_address_p(void)
724 {
725         char *ip_addr = NULL;
726         int ret = test_get_any_profile(&profile_temp);
727
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);
732                 return 0;
733         }
734
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);
738
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);
742
743         return 0;
744 }
745
746 /**
747  * @testcase            utc_connection_profile_get_gateway_address_n
748  * @since_tizen         2.3
749  * @type                Negative
750  * @description         connection_profile_get_gateway_address should fail with invalid parameter.
751  * @scenario            Verify connection_profile_get_gateway_address by passing invalid parameter.
752  */
753 int utc_connection_profile_get_gateway_address_n(void)
754 {
755         int ret;
756         char *ip_addr = NULL;
757         connection_profile_h profile_inval = NULL;
758
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);
762                 return 0;
763         }
764
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);
777
778         return 0;
779 }
780
781 /**
782  * @testcase        utc_connection_profile_get_dhcp_server_address_p
783  * @since_tizen     4.0
784  * @type            Positive
785  * @description     Gets the DHCP server address.
786  * @scenario        Invoking connection_profile_get_dhcp_server_address with valid parameter.
787  */
788 int utc_connection_profile_get_dhcp_server_address_p(void)
789 {
790         char *ip_addr = NULL;
791         int ret = test_get_any_profile(&profile_temp);
792
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);
797                 return 0;
798         }
799
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);
803
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);
807
808         return 0;
809 }
810
811 /**
812  * @testcase        utc_connection_profile_get_gateway_address_n
813  * @since_tizen     4.0
814  * @type            Negative
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.
817  */
818 int utc_connection_profile_get_dhcp_server_address_n(void)
819 {
820         int ret;
821         char *ip_addr = NULL;
822         connection_profile_h profile_inval = NULL;
823
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);
827                 return 0;
828         }
829
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);
842
843         return 0;
844 }
845
846 /**
847  * @testcase        utc_connection_profile_get_dhcp_lease_duration_p
848  * @since_tizen     4.0
849  * @type            Positive
850  * @description     Gets the DHCP lease duration.
851  * @scenario        Invoking connection_profile_get_dhcp_lease_duration with valid parameter.
852  */
853 int utc_connection_profile_get_dhcp_lease_duration_p(void)
854 {
855         int dhcp_lease_duration = 0;
856         int ret = test_get_any_profile(&profile_temp);
857
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);
861                 return 0;
862         }
863
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);
867
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);
870
871         return 0;
872 }
873
874 /**
875  * @testcase        utc_connection_profile_get_dhcp_lease_duration_n
876  * @since_tizen     4.0
877  * @type            Negative
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.
880  */
881 int utc_connection_profile_get_dhcp_lease_duration_n(void)
882 {
883         int ret;
884         int dhcp_lease_duration = 0;
885         connection_profile_h profile_inval = NULL;
886
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);
892                 return 0;
893         }
894
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);
907
908         return 0;
909 }
910
911 /**
912  * @testcase            utc_connection_profile_get_dns_address_p
913  * @since_tizen         2.3
914  * @type                Positive
915  * @description         Gets the DNS address.
916  * @scenario            Invoking connection_profile_get_dns_address with valid parameter.
917  */
918 int utc_connection_profile_get_dns_address_p(void)
919 {
920         char *ip_addr = NULL;
921         int ret = test_get_any_profile(&profile_temp);
922
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);
927                 return 0;
928         }
929
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);
937
938         return 0;
939 }
940
941 /**
942  * @testcase            utc_connection_profile_get_dns_address_n
943  * @since_tizen         2.3
944  * @type                Negative
945  * @description         connection_profile_get_dns_address should fail with invalid parameter.
946  * @scenario            Verify connection_profile_get_dns_address by passing invalid parameter.
947  */
948 int utc_connection_profile_get_dns_address_n(void)
949 {
950         int ret;
951         char *ip_addr = NULL;
952         connection_profile_h profile_inval = NULL;
953
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);
957                 return 0;
958         }
959
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);
978
979         return 0;
980 }
981
982 /**
983  * @testcase            utc_connection_profile_get_proxy_type_p
984  * @since_tizen         2.3
985  * @type                Positive
986  * @description         Sets the Proxy type.
987  * @scenario            Invoking connection_profile_set_proxy_type with valid parameter.
988  */
989 int utc_connection_profile_get_proxy_type_p(void)
990 {
991         connection_proxy_type_e type;
992         int ret = test_get_any_profile(&profile_temp);
993
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);
997                 return 0;
998         }
999
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);
1005
1006         return 0;
1007 }
1008
1009 /**
1010  * @testcase            utc_connection_profile_get_proxy_type_n
1011  * @since_tizen         2.3
1012  * @type                Negative
1013  * @description         connection_profile_get_proxy_type should fail with invalid parameter.
1014  * @scenario            Verify connection_profile_get_proxy_type by passing invalid parameter.
1015  */
1016 int utc_connection_profile_get_proxy_type_n(void)
1017 {
1018         int ret;
1019         connection_proxy_type_e type;
1020         connection_profile_h profile_inval = NULL;
1021
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);
1025                 return 0;
1026         }
1027
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);
1034
1035         return 0;
1036 }
1037
1038 /**
1039  * @testcase            utc_connection_profile_get_proxy_address_p
1040  * @since_tizen         2.3
1041  * @type                Positive
1042  * @description         Gets the Proxy address.
1043  * @scenario            Invoking connection_profile_get_proxy_address with valid parameter.
1044  */
1045 int utc_connection_profile_get_proxy_address_p(void)
1046 {
1047         char *ip_addr = NULL;
1048         int ret = test_get_any_profile(&profile_temp);
1049
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);
1054                 return 0;
1055         }
1056
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);
1061
1062         return 0;
1063 }
1064
1065 /**
1066  * @testcase            utc_connection_profile_get_proxy_address_n
1067  * @since_tizen         2.3
1068  * @type                Negative
1069  * @description         connection_profile_get_proxy_address should fail with invalid parameter.
1070  * @scenario            Verify connection_profile_get_proxy_address by passing invalid parameter.
1071  */
1072 int utc_connection_profile_get_proxy_address_n(void)
1073 {
1074         int ret;
1075         char *ip_addr = NULL;
1076         connection_profile_h profile_inval = NULL;
1077
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);
1081                 return 0;
1082         }
1083
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);
1096
1097         return 0;
1098 }
1099
1100 /**
1101  * @testcase            utc_connection_profile_set_ip_config_type_p
1102  * @since_tizen         2.3
1103  * @type                Positive
1104  * @description         Sets the IP config type.
1105  * @scenario            Invoking connection_profile_set_ip_config_type with valid parameter.
1106  */
1107 int utc_connection_profile_set_ip_config_type_p(void)
1108 {
1109         int ret = test_get_any_profile(&profile_temp);
1110
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);
1115                 return 0;
1116         }
1117
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);
1122
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);
1126
1127         return 0;
1128 }
1129
1130 /**
1131  * @testcase            utc_connection_profile_set_ip_config_type_n
1132  * @since_tizen         2.3
1133  * @type                Negative
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.
1136  */
1137 int utc_connection_profile_set_ip_config_type_n(void)
1138 {
1139         int ret;
1140         connection_profile_h profile_inval = NULL;
1141
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);
1145                 return 0;
1146         }
1147
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);
1155
1156         return 0;
1157 }
1158
1159 /**
1160  * @testcase            utc_connection_profile_set_ip_address_p
1161  * @since_tizen         2.3
1162  * @type                Positive
1163  * @description         Sets the IP address.
1164  * @scenario            Invoking connection_profile_set_ip_address with valid parameter.
1165  */
1166 int utc_connection_profile_set_ip_address_p(void)
1167 {
1168         int ret = test_get_any_profile(&profile_temp);
1169
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);
1173                 return 0;
1174         }
1175
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);
1179
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);
1182
1183         return 0;
1184 }
1185
1186 /**
1187  * @testcase            utc_connection_profile_set_ip_address_n
1188  * @since_tizen         2.3
1189  * @type                Negative
1190  * @description         connection_profile_set_ip_address should fail with invalid parameter.
1191  * @scenario            Verify connection_profile_set_ip_address by passing invalid parameter.
1192  */
1193 int utc_connection_profile_set_ip_address_n(void)
1194 {
1195         int ret;
1196         connection_profile_h profile_inval = NULL;
1197
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);
1201                 return 0;
1202         }
1203
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);
1208
1209         return 0;
1210 }
1211
1212 /**
1213  * @testcase            utc_connection_profile_set_subnet_mask_p
1214  * @since_tizen         2.3
1215  * @type                Positive
1216  * @description         Sets the Subnet Mask.
1217  * @scenario            Invoking connection_profile_set_subnet_mask with valid parameter.
1218  */
1219 int utc_connection_profile_set_subnet_mask_p(void)
1220 {
1221         int ret = test_get_any_profile(&profile_temp);
1222
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);
1226                 return 0;
1227         }
1228
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);
1232
1233         return 0;
1234 }
1235
1236 /**
1237  * @testcase            utc_connection_profile_set_subnet_mask_n
1238  * @since_tizen         2.3
1239  * @type                Negative
1240  * @description         connection_profile_set_subnet_mask should fail with invalid parameter.
1241  * @scenario            Verify connection_profile_set_subnet_mask by passing invalid parameter.
1242  */
1243 int utc_connection_profile_set_subnet_mask_n(void)
1244 {
1245         int ret;
1246         connection_profile_h profile_inval = NULL;
1247
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);
1251                 return 0;
1252         }
1253
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);
1258
1259         return 0;
1260 }
1261
1262 /**
1263  * @testcase            utc_connection_profile_set_gateway_address_p
1264  * @since_tizen         2.3
1265  * @type                Positive
1266  * @description         Sets the Gateway address.
1267  * @scenario            Invoking connection_profile_set_gateway_address with valid parameter.
1268  */
1269 int utc_connection_profile_set_gateway_address_p(void)
1270 {
1271         int ret = test_get_any_profile(&profile_temp);
1272
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);
1276                 return 0;
1277         }
1278
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);
1282
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);
1285
1286         return 0;
1287 }
1288
1289 /**
1290  * @testcase            utc_connection_profile_set_gateway_address_n
1291  * @since_tizen         2.3
1292  * @type                Negative
1293  * @description         connection_profile_set_gateway_address should fail with invalid parameter.
1294  * @scenario            Verify connection_profile_set_gateway_address by passing invalid parameter.
1295  */
1296 int utc_connection_profile_set_gateway_address_n(void)
1297 {
1298         int ret;
1299         connection_profile_h profile_inval = NULL;
1300
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);
1304                 return 0;
1305         }
1306
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);
1311
1312         return 0;
1313 }
1314
1315 /**
1316  * @testcase            utc_connection_profile_set_dns_address_p
1317  * @since_tizen         2.3
1318  * @type                Positive
1319  * @description         Sets the DNS address.
1320  * @scenario            Invoking connection_profile_set_dns_address with valid parameter.
1321  */
1322 int utc_connection_profile_set_dns_address_p(void)
1323 {
1324         int ret = test_get_any_profile(&profile_temp);
1325
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);
1329                 return 0;
1330         }
1331
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);
1339
1340         return 0;
1341 }
1342
1343 /**
1344  * @testcase            utc_connection_profile_set_dns_address_n
1345  * @since_tizen         2.3
1346  * @type                Negative
1347  * @description         connection_profile_set_dns_address should fail with invalid parameter.
1348  * @scenario            Verify connection_profile_set_dns_address by passing invalid parameter.
1349  */
1350 int utc_connection_profile_set_dns_address_n(void)
1351 {
1352         int ret;
1353         connection_profile_h profile_inval = NULL;
1354
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);
1358                 return 0;
1359         }
1360
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);
1367
1368         return 0;
1369 }
1370
1371 /**
1372  * @testcase            utc_connection_profile_set_proxy_type_p
1373  * @since_tizen         2.3
1374  * @type                Positive
1375  * @description         Sets the Proxy type.
1376  * @scenario            Invoking connection_profile_set_proxy_type with valid parameter.
1377  */
1378 int utc_connection_profile_set_proxy_type_p(void)
1379 {
1380         int ret = test_get_any_profile(&profile_temp);
1381
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);
1385                 return 0;
1386         }
1387
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);
1391
1392         return 0;
1393 }
1394
1395 /**
1396  * @testcase            utc_connection_profile_set_proxy_type_n
1397  * @since_tizen         2.3
1398  * @type                Negative
1399  * @description         connection_profile_set_proxy_type should fail with invalid parameter.
1400  * @scenario            Verify connection_profile_set_proxy_type by passing invalid parameter.
1401  */
1402 int utc_connection_profile_set_proxy_type_n(void)
1403 {
1404         int ret;
1405         connection_profile_h profile_inval = NULL;
1406
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);
1410                 return 0;
1411         }
1412
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);
1419
1420         return 0;
1421 }
1422
1423 /**
1424  * @testcase            utc_connection_profile_set_proxy_address_p
1425  * @since_tizen         2.3
1426  * @type                Positive
1427  * @description         Sets the Proxy address.
1428  * @scenario            Invoking connection_profile_set_proxy_address with valid parameter.
1429  */
1430 int utc_connection_profile_set_proxy_address_p(void)
1431 {
1432         int ret = test_get_any_profile(&profile_temp);
1433
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);
1437                 return 0;
1438         }
1439
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);
1445
1446         return 0;
1447 }
1448
1449 /**
1450  * @testcase            utc_connection_profile_set_proxy_address_n
1451  * @since_tizen         2.3
1452  * @type                Negative
1453  * @description         connection_profile_set_proxy_address should fail with invalid parameter.
1454  * @scenario            Verify connection_profile_set_proxy_address by passing invalid parameter.
1455  */
1456 int utc_connection_profile_set_proxy_address_n(void)
1457 {
1458         int ret;
1459         connection_profile_h profile_inval = NULL;
1460
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);
1464                 return 0;
1465         }
1466
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);
1471
1472         return 0;
1473 }
1474
1475 /**
1476  * @testcase            utc_connection_profile_set_state_changed_cb_p
1477  * @since_tizen         2.3
1478  * @type                Positive
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.
1481  */
1482 int utc_connection_profile_set_state_changed_cb_p(void)
1483 {
1484         int ret = test_get_any_profile(&profile_temp);
1485
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);
1489                 return 0;
1490         }
1491
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);
1495
1496         ret = connection_profile_unset_state_changed_cb(profile_temp);
1497         PRINT_RETURN("connection_profile_unset_state_changed_cb", ret);
1498
1499         return 0;
1500 }
1501
1502 /**
1503  * @testcase            utc_connection_profile_set_state_changed_cb_n
1504  * @since_tizen         2.3
1505  * @type                Negative
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.
1508  */
1509 int utc_connection_profile_set_state_changed_cb_n(void)
1510 {
1511         connection_profile_h profile_inval = NULL;
1512         int ret = test_get_any_profile(&profile_temp);
1513
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);
1517                 return 0;
1518         }
1519
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);
1527
1528         return 0;
1529 }
1530
1531 /**
1532  * @testcase            utc_connection_profile_unset_state_changed_cb_p
1533  * @since_tizen         2.3
1534  * @type                Positive
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.
1537  */
1538 int utc_connection_profile_unset_state_changed_cb_p(void)
1539 {
1540         int ret = test_get_any_profile(&profile_temp);
1541
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);
1545                 return 0;
1546         }
1547
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);
1551
1552         ret = connection_profile_unset_state_changed_cb(profile_temp);
1553         CHECK_RETURN("connection_profile_unset_state_changed_cb", ret, CONNECTION_ERROR_NONE);
1554
1555         return 0;
1556 }
1557
1558 /**
1559  * @testcase            utc_connection_profile_unset_state_changed_cb_n
1560  * @since_tizen         2.3
1561  * @type                Negative
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.
1564  */
1565 int utc_connection_profile_unset_state_changed_cb_n(void)
1566 {
1567         connection_profile_h profile_inval = NULL;
1568
1569         int ret = connection_profile_unset_state_changed_cb(profile_inval);
1570
1571         if (all_features_not_supported)
1572                 CHECK_RETURN("connection_profile_unset_state_changed_cb", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1573         else
1574                 CHECK_RETURN("connection_profile_unset_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1575         return 0;
1576 }
1577
1578
1579 /* Cellular profile operations. */
1580
1581 /**
1582  * @testcase            utc_connection_profile_set_cellular_service_type_p
1583  * @since_tizen         2.3
1584  * @type                Positive
1585  * @description         Sets the service type.
1586  * @scenario            Invoking connection_profile_set_cellular_service_type with valid parameter.
1587  */
1588 int utc_connection_profile_set_cellular_service_type_p(void)
1589 {
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);
1593         } else {
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);
1596         }
1597
1598         return 0;
1599 }
1600
1601 /**
1602  * @testcase            utc_connection_profile_set_cellular_service_type_n
1603  * @since_tizen         2.3
1604  * @type                Negative
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.
1607  */
1608 int utc_connection_profile_set_cellular_service_type_n(void)
1609 {
1610         connection_profile_h profile_inval = NULL;
1611
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);
1621         } else {
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);
1624         }
1625
1626         return 0;
1627 }
1628
1629 /**
1630  * @testcase            utc_connection_profile_set_cellular_apn_p
1631  * @since_tizen         2.3
1632  * @type                Positive
1633  * @description         Sets the APN (Access Point Name).
1634  * @scenario            Invoking connection_profile_set_cellular_apn with valid parameter.
1635  */
1636 int utc_connection_profile_set_cellular_apn_p(void)
1637 {
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);
1641         } else {
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);
1644         }
1645
1646         return 0;
1647 }
1648
1649 /**
1650  * @testcase            utc_connection_profile_set_cellular_apn_n
1651  * @since_tizen         2.3
1652  * @type                Negative
1653  * @description         connection_profile_set_cellular_apn should fail with invalid parameter.
1654  * @scenario            Verify connection_profile_set_cellular_apn by passing invalid parameter.
1655  */
1656 int utc_connection_profile_set_cellular_apn_n(void)
1657 {
1658         connection_profile_h profile_inval = NULL;
1659
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);
1669         } else {
1670                 int ret = connection_profile_set_cellular_apn(profile_inval, NULL);
1671                 CHECK_RETURN("connection_profile_set_cellular_apn", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1672         }
1673         return 0;
1674 }
1675
1676 /**
1677  * @testcase            utc_connection_profile_set_cellular_auth_info_p
1678  * @since_tizen         2.3
1679  * @type                Positive
1680  * @description         Sets the Authentication information.
1681  * @scenario            Invoking connection_profile_set_cellular_auth_info with valid parameter.
1682  */
1683 int utc_connection_profile_set_cellular_auth_info_p(void)
1684 {
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);
1689         } else {
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);
1693         }
1694
1695         return 0;
1696 }
1697
1698 /**
1699  * @testcase            utc_connection_profile_set_cellular_auth_info_n
1700  * @since_tizen         2.3
1701  * @type                Negative
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.
1704  */
1705 int utc_connection_profile_set_cellular_auth_info_n(void)
1706 {
1707         connection_profile_h profile_inval = NULL;
1708
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);
1732         } else {
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);
1735         }
1736
1737         return 0;
1738 }
1739
1740 /**
1741  * @testcase            utc_connection_profile_set_cellular_home_url_p
1742  * @since_tizen         2.3
1743  * @type                Positive
1744  * @description         connection_profile_set_cellular_home_url.
1745  * @scenario            Invoking connection_profile_set_cellular_home_url with valid parameter.
1746  */
1747 int utc_connection_profile_set_cellular_home_url_p(void)
1748 {
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);
1752         } else {
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);
1755         }
1756
1757         return 0;
1758 }
1759
1760 /**
1761  * @testcase            utc_connection_profile_set_cellular_home_url_n
1762  * @since_tizen         2.3
1763  * @type                Negative
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.
1766  */
1767 int utc_connection_profile_set_cellular_home_url_n(void)
1768 {
1769         connection_profile_h profile_inval = NULL;
1770
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);
1780         } else {
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);
1783         }
1784         return 0;
1785 }
1786
1787 #if (defined(MOBILE) || defined(WEARABLE)  || defined(TIZENIOT)) //Starts MOBILE or WEARABLE or TIZENIOT
1788 /**
1789  * @testcase            utc_connection_profile_set_cellular_pdn_type_p
1790  * @since_tizen         3.0
1791  * @type                Positive
1792  * @description         Sets the pdn type.
1793  * @scenario            Invoking connection_profile_set_cellular_pdn_type with valid parameter.
1794  */
1795 int utc_connection_profile_set_cellular_pdn_type_p(void)
1796 {
1797         int ret = connection_profile_set_cellular_pdn_type(profile_cellular, CONNECTION_CELLULAR_PDN_TYPE_IPV4);
1798
1799         if (telephony_supported)
1800                 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_NONE);
1801         else
1802                 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1803         return 0;
1804 }
1805
1806 /**
1807  * @testcase            utc_connection_profile_set_cellular_pdn_type_n
1808  * @since_tizen         3.0
1809  * @type                Negative
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.
1812  */
1813 int utc_connection_profile_set_cellular_pdn_type_n(void)
1814 {
1815         connection_profile_h profile_inval = NULL;
1816         connection_cellular_pdn_type_e type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
1817
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);
1823         } else {
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);
1826         }
1827
1828         return 0;
1829 }
1830
1831 /**
1832  * @testcase            utc_connection_profile_set_cellular_roam_pdn_type_p
1833  * @since_tizen         3.0
1834  * @type                Positive
1835  * @description         Sets the roam pdn type.
1836  * @scenario            Invoking connection_profile_set_cellular_roam_pdn_type with valid parameter.
1837  */
1838 int utc_connection_profile_set_cellular_roam_pdn_type_p(void)
1839 {
1840         int ret = connection_profile_set_cellular_roam_pdn_type(profile_cellular, CONNECTION_CELLULAR_PDN_TYPE_IPV4);
1841
1842         if (telephony_supported)
1843                 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_NONE);
1844         else
1845                 CHECK_RETURN("connection_profile_set_cellular_roam_pdn_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1846         return 0;
1847 }
1848
1849 /**
1850  * @testcase            utc_connection_profile_set_cellular_roam_pdn_type_n
1851  * @since_tizen         3.0
1852  * @type                Negative
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.
1855  */
1856 int utc_connection_profile_set_cellular_roam_pdn_type_n(void)
1857 {
1858         connection_profile_h profile_inval = NULL;
1859         connection_cellular_pdn_type_e type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
1860
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);
1866         } else {
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);
1869         }
1870
1871         return 0;
1872 }
1873 #endif  // End MOBILE or WEARABLE or TIZENIOT
1874
1875 /**
1876  * @testcase            utc_connection_profile_get_cellular_service_type_p
1877  * @since_tizen         2.3
1878  * @type                Positive
1879  * @description         Sets the home URL.
1880  * @scenario            Invoking connection_profile_get_cellular_service_type with valid parameter.
1881  */
1882 int utc_connection_profile_get_cellular_service_type_p(void)
1883 {
1884         connection_cellular_service_type_e type;
1885
1886         if (telephony_supported) {
1887                 connection_profile_set_cellular_service_type(profile_cellular, CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET);
1888
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);
1891         } else {
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);
1894         }
1895
1896         return 0;
1897 }
1898
1899 /**
1900  * @testcase            utc_connection_profile_get_cellular_service_type_n
1901  * @since_tizen         2.3
1902  * @type                Negative
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.
1905  */
1906 int utc_connection_profile_get_cellular_service_type_n(void)
1907 {
1908         connection_profile_h profile_inval = NULL;
1909         connection_cellular_service_type_e type;
1910
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);
1920         } else {
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);
1923         }
1924
1925         return 0;
1926 }
1927
1928 /**
1929  * @testcase            utc_connection_profile_get_cellular_apn_p
1930  * @since_tizen         2.3
1931  * @type                Positive
1932  * @description         Gets the APN (access point name).
1933  * @scenario            Invoking connection_profile_get_cellular_apn with valid parameter.
1934  */
1935 int utc_connection_profile_get_cellular_apn_p(void)
1936 {
1937         char *apn = NULL;
1938
1939         int ret = connection_profile_get_cellular_apn(profile_cellular, &apn);
1940         FREE_RESOURCE(apn);
1941
1942         if (telephony_supported)
1943                 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_NONE);
1944         else
1945                 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1946         return 0;
1947 }
1948
1949 /**
1950  * @testcase            utc_connection_profile_get_cellular_apn_n
1951  * @since_tizen         2.3
1952  * @type                Negative
1953  * @description         connection_profile_get_cellular_apn should fail with invalid parameter.
1954  * @scenario            Verify connection_profile_get_cellular_apn by passing invalid parameter.
1955  */
1956 int utc_connection_profile_get_cellular_apn_n(void)
1957 {
1958         connection_profile_h profile_inval = NULL;
1959         char *apn = NULL;
1960
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);
1970         } else {
1971                 int ret = connection_profile_get_cellular_apn(profile_inval, NULL);
1972                 CHECK_RETURN("connection_profile_get_cellular_apn", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1973         }
1974
1975         return 0;
1976 }
1977
1978 /**
1979  * @testcase            utc_connection_profile_get_cellular_auth_info_p
1980  * @since_tizen         2.3
1981  * @type                Positive
1982  * @description         Gets the authentication information.
1983  * @scenario            Invoking connection_profile_get_cellular_auth_info with valid parameter.
1984  */
1985 int utc_connection_profile_get_cellular_auth_info_p(void)
1986 {
1987         connection_cellular_auth_type_e type;
1988         char *name = NULL;
1989         char *pwd = NULL;
1990
1991         int ret = connection_profile_get_cellular_auth_info(profile_cellular, &type, &name, &pwd);
1992         if (ret == CONNECTION_ERROR_NONE) {
1993                 FREE_RESOURCE(name);
1994                 FREE_RESOURCE(pwd);
1995         }
1996
1997         if (telephony_supported)
1998                 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_NONE);
1999         else
2000                 CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2001         return 0;
2002 }
2003
2004 /**
2005  * @testcase            utc_connection_profile_get_cellular_auth_info_n
2006  * @since_tizen         2.3
2007  * @type                Negative
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.
2010  */
2011 int utc_connection_profile_get_cellular_auth_info_n(void)
2012 {
2013         connection_profile_h profile_inval = NULL;
2014         connection_cellular_auth_type_e type;
2015         char *name = NULL;
2016         char *pwd = NULL;
2017
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);
2047         } else {
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);
2050         }
2051
2052         return 0;
2053 }
2054
2055 /**
2056  * @testcase            utc_connection_profile_get_cellular_home_url_p
2057  * @since_tizen         2.3
2058  * @type                Positive
2059  * @description         Gets the home URL.
2060  * @scenario            Invoking connection_profile_get_cellular_home_url with valid parameter.
2061  */
2062 int utc_connection_profile_get_cellular_home_url_p(void)
2063 {
2064         char *home_url = NULL;
2065
2066         int ret = connection_profile_get_cellular_home_url(profile_cellular, &home_url);
2067         FREE_RESOURCE(home_url);
2068
2069         if (telephony_supported)
2070                 CHECK_RETURN("connection_profile_get_cellular_home_url", ret, CONNECTION_ERROR_NONE);
2071         else
2072                 CHECK_RETURN("connection_profile_get_cellular_home_url", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2073         return 0;
2074 }
2075
2076 /**
2077  * @testcase            utc_connection_profile_get_cellular_home_url_n
2078  * @since_tizen         2.3
2079  * @type                Negative
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.
2082  */
2083 int utc_connection_profile_get_cellular_home_url_n(void)
2084 {
2085         connection_profile_h profile_inval = NULL;
2086         char *home_url = NULL;
2087
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);
2097         } else {
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);
2100         }
2101
2102         return 0;
2103 }
2104
2105 #if (defined(MOBILE) || defined(WEARABLE)  || defined(TIZENIOT)) //Starts MOBILE or WEARABLE or TIZENIOT
2106 /**
2107  * @testcase            utc_connection_profile_get_cellular_pdn_type_p
2108  * @since_tizen         3.0
2109  * @type                Positive
2110  * @description         Gets the pdn type.
2111  * @scenario            Invoking connection_profile_get_cellular_pdn_type with valid parameter.
2112  */
2113 int utc_connection_profile_get_cellular_pdn_type_p(void)
2114 {
2115         connection_cellular_pdn_type_e type;
2116
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);
2120
2121                 ret = connection_profile_get_cellular_pdn_type(profile_cellular, &type);
2122                 CHECK_RETURN("connection_profile_set_cellular_pdn_type", ret, CONNECTION_ERROR_NONE);
2123         } else {
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);
2126         }
2127
2128         return 0;
2129 }
2130
2131 /**
2132  * @testcase            utc_connection_profile_get_cellular_pdn_type_n
2133  * @since_tizen         3.0
2134  * @type                Negative
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.
2137  */
2138 int utc_connection_profile_get_cellular_pdn_type_n(void)
2139 {
2140         connection_profile_h profile_inval = NULL;
2141         connection_cellular_pdn_type_e type;
2142
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);
2150         } else {
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);
2153         }
2154
2155         return 0;
2156 }
2157
2158 /**
2159  * @testcase            utc_connection_profile_get_cellular_roam_pdn_type_p
2160  * @since_tizen         3.0
2161  * @type                Positive
2162  * @description         Gets the roam pdn type.
2163  * @scenario            Invoking connection_profile_get_cellular_roam_pdn_type with valid parameter.
2164  */
2165 int utc_connection_profile_get_cellular_roam_pdn_type_p(void)
2166 {
2167         connection_cellular_pdn_type_e type;
2168
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);
2172
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);
2175         } else {
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);
2178         }
2179
2180         return 0;
2181 }
2182
2183 /**
2184  * @testcase            utc_connection_profile_get_cellular_roam_pdn_type_n
2185  * @since_tizen         3.0
2186  * @type                Negative
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.
2189  */
2190 int utc_connection_profile_get_cellular_roam_pdn_type_n(void)
2191 {
2192         connection_profile_h profile_inval = NULL;
2193         connection_cellular_pdn_type_e type;
2194
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);
2202         } else {
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);
2205         }
2206
2207         return 0;
2208 }
2209 #endif  // End MOBILE or WEARABLE or TIZENIOT
2210
2211 /**
2212  * @testcase            utc_connection_profile_is_cellular_roaming_p
2213  * @since_tizen         2.3
2214  * @type                Positive
2215  * @description         Checks wheter the connection is in roaming state.
2216  * @scenario            Invoking connection_profile_is_cellular_roaming with valid parameter.
2217  */
2218 int utc_connection_profile_is_cellular_roaming_p(void)
2219 {
2220         bool roaming;
2221
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);
2225         } else {
2226                 int ret = connection_profile_is_cellular_roaming(profile_cellular, &roaming);
2227                 CHECK_RETURN("connection_profile_is_cellular_roaming", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2228         }
2229
2230         return 0;
2231 }
2232
2233 /**
2234  * @testcase            utc_connection_profile_is_cellular_roaming_n
2235  * @since_tizen         2.3
2236  * @type                Negative
2237  * @description         connection_profile_is_cellular_roaming should fail with invalid parameter.
2238  * @scenario            Verify connection_profile_is_cellular_roaming by passing invalid parameter.
2239  */
2240 int utc_connection_profile_is_cellular_roaming_n(void)
2241 {
2242         connection_profile_h profile_inval = NULL;
2243         bool roaming;
2244
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);
2254         } else {
2255                 int ret = connection_profile_is_cellular_roaming(profile_inval, NULL);
2256                 CHECK_RETURN("connection_profile_is_cellular_roaming", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2257         }
2258
2259         return 0;
2260 }
2261
2262 /**
2263  * @testcase            utc_connection_profile_is_cellular_hidden_p
2264  * @since_tizen         2.3
2265  * @type                Positive
2266  * @description         Checks whether the profile is hidden.
2267  * @scenario            Invoking connection_profile_is_cellular_hidden with valid parameter.
2268  */
2269 int utc_connection_profile_is_cellular_hidden_p(void)
2270 {
2271         bool is_hidden;
2272
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);
2276         } else {
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);
2279         }
2280
2281         return 0;
2282
2283 }
2284
2285 /**
2286  * @testcase            utc_connection_profile_is_cellular_hidden_n
2287  * @since_tizen         2.3
2288  * @type                Negative
2289  * @description         connection_profile_is_cellular_hidden should fail with invalid parameter.
2290  * @scenario            Verify connection_profile_is_cellular_hidden by passing invalid parameter.
2291  */
2292 int utc_connection_profile_is_cellular_hidden_n(void)
2293 {
2294         connection_profile_h profile_inval = NULL;
2295         bool is_hidden;
2296
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);
2306         } else {
2307                 int ret = connection_profile_is_cellular_hidden(profile_inval, NULL);
2308                 CHECK_RETURN("connection_profile_is_cellular_hidden", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2309         }
2310
2311         return 0;
2312 }
2313
2314 /**
2315  * @testcase            utc_connection_profile_is_cellular_editable_p
2316  * @since_tizen         2.3
2317  * @type                Positive
2318  * @description         Checks whether the profile is editable.
2319  * @scenario            Invoking connection_profile_is_cellular_editable with valid parameter.
2320  */
2321 int utc_connection_profile_is_cellular_editable_p(void)
2322 {
2323         bool is_editable;
2324
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);
2328         } else {
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);
2331         }
2332
2333         return 0;
2334 }
2335
2336 /**
2337  * @testcase            utc_connection_profile_is_cellular_editable_n
2338  * @since_tizen         2.3
2339  * @type                Negative
2340  * @description         connection_profile_is_cellular_editable should fail with invalid parameter.
2341  * @scenario            Verify connection_profile_is_cellular_editable by passing invalid parameter.
2342  */
2343 int utc_connection_profile_is_cellular_editable_n(void)
2344 {
2345         connection_profile_h profile_inval = NULL;
2346         bool is_editable;
2347
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);
2357         } else {
2358                 int ret = connection_profile_is_cellular_editable(profile_inval, NULL);
2359                 CHECK_RETURN("connection_profile_is_cellular_editable", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2360         }
2361
2362         return 0;
2363 }
2364
2365 /**
2366  * @testcase            utc_connection_profile_is_cellular_default_p
2367  * @since_tizen         2.3
2368  * @type                Positive
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.
2372  */
2373 int utc_connection_profile_is_cellular_default_p(void)
2374 {
2375         bool is_default;
2376
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);
2380         } else {
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);
2383         }
2384
2385         return 0;
2386 }
2387
2388 /**
2389  * @testcase            utc_connection_profile_is_cellular_default_n
2390  * @since_tizen         2.3
2391  * @type                Negative
2392  * @description         connection_profile_is_cellular_default should fail with invalid parameter.
2393  * @scenario            Verify connection_profile_is_cellular_default by passing invalid parameter.
2394  */
2395 int utc_connection_profile_is_cellular_default_n(void)
2396 {
2397         bool is_editable;
2398
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);
2402
2403                 ret = connection_profile_is_cellular_default(profile_cellular, NULL);
2404                 CHECK_RETURN("connection_profile_is_cellular_default", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2405
2406                 ret = connection_profile_is_cellular_default(profile_wifi, &is_editable);
2407                 CHECK_RETURN("connection_profile_is_cellular_default", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2408         } else {
2409                 int ret = connection_profile_is_cellular_default(NULL, &is_editable);
2410                 CHECK_RETURN("connection_profile_is_cellular_default", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2411         }
2412
2413         return 0;
2414 }
2415
2416 /**
2417  * @testcase            utc_connection_profile_refresh_p
2418  * @since_tizen         2.3
2419  * @type                Positive
2420  * @description         Refreshes the profile information.
2421  * @scenario            Invoking connection_profile_refresh with valid parameter.
2422  */
2423 int utc_connection_profile_refresh_p(void)
2424 {
2425         int ret = test_get_any_profile(&profile_temp);
2426
2427         if (all_features_not_supported) {
2428                 ret = connection_profile_refresh(profile_temp);
2429                 CHECK_RETURN("connection_profile_refresh", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2430                 return 0;
2431         }
2432
2433         assert(profile_temp);
2434         ret = connection_profile_refresh(profile_temp);
2435         CHECK_RETURN("connection_profile_refresh", ret, CONNECTION_ERROR_NONE);
2436
2437         return 0;
2438 }
2439
2440 /**
2441  * @testcase            utc_connection_profile_refresh_n
2442  * @since_tizen         2.3
2443  * @type                Negative
2444  * @description         connection_profile_refresh should fail with invalid parameter.
2445  * @scenario            Verify connection_profile_refresh by passing invalid profile handle.
2446  */
2447 int utc_connection_profile_refresh_n(void)
2448 {
2449         connection_profile_h profile_inval = NULL;
2450
2451         int ret = connection_profile_refresh(profile_inval);
2452
2453         if (all_features_not_supported)
2454                 CHECK_RETURN("connection_profile_refresh", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2455         else
2456                 CHECK_RETURN("connection_profile_refresh", ret, CONNECTION_ERROR_INVALID_PARAMETER);
2457         return 0;
2458 }
2459
2460 /* Wi-Fi profile operations. */
2461
2462 /**
2463  * @testcase            utc_connection_profile_get_wifi_essid_p
2464  * @since_tizen         2.3
2465  * @type                Positive
2466  * @description         Gets the ESSID (Extended Service Set Identifier).
2467  * @scenario            Invoking connection_profile_get_wifi_essid with valid parameter.
2468  */
2469 int utc_connection_profile_get_wifi_essid_p(void)
2470 {
2471         char *essid = NULL;
2472
2473         int ret = connection_profile_get_wifi_essid(profile_wifi, &essid);
2474         FREE_RESOURCE(essid);
2475
2476         if (wifi_supported)
2477                 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_NONE);
2478         else
2479                 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2480         return 0;
2481 }
2482
2483 /**
2484  * @testcase            utc_connection_profile_get_wifi_essid_n
2485  * @since_tizen         2.3
2486  * @type                Negative
2487  * @description         connection_profile_get_wifi_essid should fail with invalid parameter.
2488  * @scenario            Verify connection_profile_get_wifi_essid by passing invalid parameter.
2489  */
2490 int utc_connection_profile_get_wifi_essid_n(void)
2491 {
2492         connection_profile_h profile_inval = NULL;
2493         char *essid = NULL;
2494
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);
2504         } else {
2505                 int ret = connection_profile_get_wifi_essid(profile_inval, NULL);
2506                 CHECK_RETURN("connection_profile_get_wifi_essid", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2507         }
2508
2509         return 0;
2510 }
2511
2512 /**
2513  * @testcase            utc_connection_profile_get_wifi_bssid_p
2514  * @since_tizen         2.3
2515  * @type                Positive
2516  * @description         Gets the BSSID (Basic Service Set Identifier).
2517  * @scenario            Invoking connection_profile_get_wifi_bssid with valid parameter.
2518  */
2519 int utc_connection_profile_get_wifi_bssid_p(void)
2520 {
2521         char *bssid = NULL;
2522
2523         int ret = connection_profile_get_wifi_bssid(profile_wifi, &bssid);
2524         FREE_RESOURCE(bssid);
2525
2526         if (wifi_supported)
2527                 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_NONE);
2528         else
2529                 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2530         return 0;
2531 }
2532
2533 /**
2534  * @testcase            utc_connection_profile_get_wifi_bssid_n
2535  * @since_tizen         2.3
2536  * @type                Negative
2537  * @description         connection_profile_get_wifi_bssid should fail with invalid parameter.
2538  * @scenario            Verify connection_profile_get_wifi_bssid by passing invalid parameter.
2539  */
2540 int utc_connection_profile_get_wifi_bssid_n(void)
2541 {
2542         connection_profile_h profile_inval = NULL;
2543         char *bssid = NULL;
2544
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);
2554         } else {
2555                 int ret = connection_profile_get_wifi_bssid(profile_inval, NULL);
2556                 CHECK_RETURN("connection_profile_get_wifi_bssid", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2557         }
2558
2559         return 0;
2560 }
2561
2562 /**
2563  * @testcase            utc_connection_profile_get_wifi_rssi_p
2564  * @since_tizen         2.3
2565  * @type                Positive
2566  * @description         Gets the RSSI.
2567  * @scenario            Invoking connection_profile_get_wifi_rssi with valid parameter.
2568  */
2569 int utc_connection_profile_get_wifi_rssi_p(void)
2570 {
2571         int rssi;
2572
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);
2576         } else {
2577                 int ret = connection_profile_get_wifi_rssi(profile_wifi, &rssi);
2578                 CHECK_RETURN("connection_profile_get_wifi_rssi", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2579         }
2580
2581         return 0;
2582 }
2583
2584 /**
2585  * @testcase            utc_connection_profile_get_wifi_rssi_n
2586  * @since_tizen         2.3
2587  * @type                Negative
2588  * @description         connection_profile_get_wifi_rssi should fail with invalid parameter.
2589  * @scenario            Verify connection_profile_get_wifi_rssi by passing invalid parameter.
2590  */
2591 int utc_connection_profile_get_wifi_rssi_n(void)
2592 {
2593         connection_profile_h profile_inval = NULL;
2594         int rssi;
2595
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);
2605         } else {
2606                 int ret = connection_profile_get_wifi_rssi(profile_inval, NULL);
2607                 CHECK_RETURN("connection_profile_get_wifi_rssi", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2608         }
2609
2610         return 0;
2611 }
2612
2613 /**
2614  * @testcase            utc_connection_profile_get_wifi_frequency_p
2615  * @since_tizen         2.3
2616  * @type                Positive
2617  * @description         Gets the frequency (MHz).
2618  * @scenario            Invoking connection_profile_get_wifi_frequency with valid parameter.
2619  */
2620 int utc_connection_profile_get_wifi_frequency_p(void)
2621 {
2622         int frequency;
2623
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);
2627         } else {
2628                 int ret = connection_profile_get_wifi_frequency(profile_wifi, &frequency);
2629                 CHECK_RETURN("connection_profile_get_wifi_frequency", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2630         }
2631
2632         return 0;
2633 }
2634
2635 /**
2636  * @testcase            utc_connection_profile_get_wifi_frequency_n
2637  * @since_tizen         2.3
2638  * @type                Negative
2639  * @description         connection_profile_get_wifi_frequency should fail with invalid parameter.
2640  * @scenario            Verify connection_profile_get_wifi_frequency by passing invalid parameter.
2641  */
2642 int utc_connection_profile_get_wifi_frequency_n(void)
2643 {
2644         connection_profile_h profile_inval = NULL;
2645         int frequency;
2646
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);
2656         } else {
2657                 int ret = connection_profile_get_wifi_frequency(profile_inval, NULL);
2658                 CHECK_RETURN("connection_profile_get_wifi_frequency", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2659         }
2660
2661         return 0;
2662 }
2663
2664 /**
2665  * @testcase            utc_connection_profile_get_wifi_max_speed_p
2666  * @since_tizen         2.3
2667  * @type                Positive
2668  * @description         Gets the max speed (Mbps).
2669  * @scenario            Invoking connection_profile_get_wifi_max_speed with valid parameter.
2670  */
2671 int utc_connection_profile_get_wifi_max_speed_p(void)
2672 {
2673         int max_speed;
2674
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);
2678         } else {
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);
2681         }
2682
2683         return 0;
2684 }
2685
2686 /**
2687  * @testcase            utc_connection_profile_get_wifi_max_speed_n
2688  * @since_tizen         2.3
2689  * @type                Negative
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.
2692  */
2693 int utc_connection_profile_get_wifi_max_speed_n(void)
2694 {
2695         connection_profile_h profile_inval = NULL;
2696         int max_speed;
2697
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);
2707         } else {
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);
2710         }
2711
2712         return 0;
2713 }
2714
2715 /**
2716  * @testcase            utc_connection_profile_get_wifi_security_type_p
2717  * @since_tizen         2.3
2718  * @type                Positive
2719  * @description         Gets the security mode of Wi-Fi.
2720  * @scenario            Invoking connection_profile_get_wifi_security_type with valid parameter.
2721  */
2722 int utc_connection_profile_get_wifi_security_type_p(void)
2723 {
2724         connection_wifi_security_type_e sec_type;
2725
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);
2729         } else {
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);
2732         }
2733
2734         return 0;
2735 }
2736
2737 /**
2738  * @testcase            utc_connection_profile_get_wifi_security_type_n
2739  * @since_tizen         2.3
2740  * @type                Negative
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.
2743  */
2744 int utc_connection_profile_get_wifi_security_type_n(void)
2745 {
2746         connection_profile_h profile_inval = NULL;
2747         connection_wifi_security_type_e sec_type;
2748
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);
2758         } else {
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);
2761         }
2762
2763         return 0;
2764 }
2765
2766 /**
2767  * @testcase            utc_connection_profile_get_wifi_encryption_type_p
2768  * @since_tizen         2.3
2769  * @type                Positive
2770  * @description         Gets the security mode of Wi-Fi.
2771  * @scenario            Invoking connection_profile_get_wifi_encryption_type with valid parameter.
2772  */
2773 int utc_connection_profile_get_wifi_encryption_type_p(void)
2774 {
2775         connection_wifi_encryption_type_e enc_type;
2776
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);
2780         } else {
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);
2783         }
2784
2785         return 0;
2786 }
2787
2788 /**
2789  * @testcase            utc_connection_profile_get_wifi_encryption_type_n
2790  * @since_tizen         2.3
2791  * @type                Negative
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.
2794  */
2795 int utc_connection_profile_get_wifi_encryption_type_n(void)
2796 {
2797         connection_profile_h profile_inval = NULL;
2798         connection_wifi_encryption_type_e enc_type;
2799
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);
2809         } else {
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);
2812         }
2813
2814         return 0;
2815 }
2816
2817 /**
2818  * @testcase            utc_connection_profile_is_wifi_passphrase_required_p
2819  * @since_tizen         2.3
2820  * @type                Positive
2821  * @description         Checks whether passphrase is required.
2822  * @scenario            Invoking connection_profile_is_wifi_passphrase_required with valid parameter.
2823  */
2824 int utc_connection_profile_is_wifi_passphrase_required_p(void)
2825 {
2826         bool flag;
2827
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);
2831         } else {
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);
2834         }
2835
2836         return 0;
2837 }
2838
2839 /**
2840  * @testcase            utc_connection_profile_is_wifi_passphrase_required_n
2841  * @since_tizen         2.3
2842  * @type                Negative
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.
2845  */
2846 int utc_connection_profile_is_wifi_passphrase_required_n(void)
2847 {
2848         connection_profile_h profile_inval = NULL;
2849         bool flag;
2850
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);
2860         } else {
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);
2863         }
2864
2865         return 0;
2866 }
2867
2868 /**
2869  * @testcase            utc_connection_profile_set_wifi_passphrase_p
2870  * @since_tizen         2.3
2871  * @type                Positive
2872  * @description         Sets the passphrase of the Wi-Fi WPA.
2873  * @scenario            Invoking connection_profile_set_wifi_passphrase with valid parameter.
2874  */
2875 int utc_connection_profile_set_wifi_passphrase_p(void)
2876 {
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);
2880         } else {
2881                 int ret = connection_profile_set_wifi_passphrase(profile_wifi, "keystring");
2882                 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2883         }
2884
2885         return 0;
2886 }
2887
2888 /**
2889  * @testcase            utc_connection_profile_set_wifi_passphrase_n
2890  * @since_tizen         2.3
2891  * @type                Negative
2892  * @description         connection_profile_set_wifi_passphrase should fail with invalid parameter.
2893  * @scenario            Verify connection_profile_set_wifi_passphrase by passing invalid parameter.
2894  */
2895 int utc_connection_profile_set_wifi_passphrase_n(void)
2896 {
2897         connection_profile_h profile_inval = NULL;
2898
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);
2908         } else {
2909                 int ret = connection_profile_set_wifi_passphrase(profile_inval, NULL);
2910                 CHECK_RETURN("connection_profile_set_wifi_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
2911         }
2912
2913         return 0;
2914 }
2915
2916 /**
2917  * @testcase            utc_connection_profile_is_wifi_wps_supported_p
2918  * @since_tizen         2.3
2919  * @type                Positive
2920  * @description         Checks whether the WPS (Wi-Fi Protected Setup) is supported.
2921  * @scenario            Invoking connection_profile_is_wifi_wps_supported with valid parameter.
2922  */
2923 int utc_connection_profile_is_wifi_wps_supported_p(void)
2924 {
2925         bool flag;
2926
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);
2930         } else {
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);
2933         }
2934
2935         return 0;
2936 }
2937
2938 /**
2939  * @testcase            utc_connection_profile_is_wifi_wps_supported_n
2940  * @since_tizen         2.3
2941  * @type                Negative
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.
2944  */
2945 int utc_connection_profile_is_wifi_wps_supported_n(void)
2946 {
2947         connection_profile_h profile_inval = NULL;
2948         bool flag;
2949
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);
2959         } else {
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);
2962         }
2963
2964         return 0;
2965 }
2966
2967 /**
2968  * @testcase            utc_connection_profile_get_ipv6_state_p
2969  * @since_tizen         4.0
2970  * @type                Positive
2971  * @description         Gets IPv6 state
2972  * @scenario            Invoking connection_profile_get_ipv6_state with valid parameter.
2973  */
2974 int utc_connection_profile_get_ipv6_state_p(void)
2975 {
2976         connection_profile_state_e state;
2977         int ret = test_get_any_profile(&profile_temp);
2978
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);
2982                 return 0;
2983         }
2984
2985         assert(profile_temp);
2986
2987         ret = connection_profile_get_ipv6_state(profile_temp, &state);
2988         CHECK_RETURN("connection_profile_get_ipv6_state", ret, CONNECTION_ERROR_NONE);
2989
2990         return 0;
2991 }
2992
2993 /**
2994  * @testcase            utc_connection_profile_get_ipv6_state_n
2995  * @since_tizen         4.0
2996  * @type                Negative
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.
2999  */
3000 int utc_connection_profile_get_ipv6_state_n(void)
3001 {
3002         connection_profile_h profile_inval = NULL;
3003         connection_profile_state_e state;
3004
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);
3008                 return 0;
3009         }
3010
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);
3017
3018         return 0;
3019 }
3020
3021 /**
3022  * @testcase            utc_connection_profile_get_prefix_length_p
3023  * @since_tizen         4.0
3024  * @type                Positive
3025  * @description         Gets prefix length
3026  * @scenario            Invoking connection_profile_get_ipv6_state with valid parameter.
3027  */
3028 int utc_connection_profile_get_prefix_length_p(void)
3029 {
3030         int length;
3031
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);
3037         }
3038
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);
3045
3046         return 0;
3047 }
3048
3049 /**
3050  * @testcase        utc_connection_profile_get_prefix_length_n
3051  * @since_tizen     4.0
3052  * @type            Negative
3053  * @description     connection_profile_get_prefix_length should be failed with invalid parameter.
3054  * @scenario        Verify prefix_length by passing invalid parameter.
3055  */
3056 int utc_connection_profile_get_prefix_length_n(void)
3057 {
3058         connection_profile_h profile_inval = NULL;
3059         int length;
3060
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);
3066         }
3067
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);
3074
3075         return 0;
3076 }
3077
3078 /**
3079  * @testcase        utc_connection_profile_set_prefix_length_p
3080  * @since_tizen     4.0
3081  * @type            Positive
3082  * @description     Sets prefix length
3083  * @scenario        Invoking connection_profile_set_ipv6_state with valid parameter.
3084  */
3085 int utc_connection_profile_set_prefix_length_p(void)
3086 {
3087         int length = 32;
3088
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);
3092         }
3093
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);
3100
3101         return 0;
3102 }
3103
3104 /**
3105  * @testcase        utc_connection_profile_set_prefix_length_n
3106  * @since_tizen     4.0
3107  * @type            Negative
3108  * @description     connection_profile_set_prefix_length should be failed with invalid parameter.
3109  * @scenario        Verify prefix_length by passing invalid parameter.
3110  */
3111 int utc_connection_profile_set_prefix_length_n(void)
3112 {
3113         connection_profile_h profile_inval = NULL;
3114         int length = 32;
3115
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);
3119         }
3120
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);
3123
3124         return 0;
3125 }
3126
3127 /**
3128  * @testcase            utc_connection_profile_get_dns_config_type_p
3129  * @since_tizen         4.0
3130  * @type                Positive
3131  * @description         Gets DNS configuration type
3132  * @scenario            Invoking connection_profile_get_dns_config_typ with valid parameter.
3133  */
3134 int utc_connection_profile_get_dns_config_type_p(void)
3135 {
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);
3139
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);
3143                 return 0;
3144         }
3145
3146         assert(profile_temp);
3147
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);
3152
3153         return 0;
3154 }
3155
3156 /**
3157  * @testcase            utc_connection_profile_get_dns_config_type_n
3158  * @since_tizen         4.0
3159  * @type                Negative
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.
3162  */
3163 int utc_connection_profile_get_dns_config_type_n(void)
3164 {
3165         connection_profile_h profile_inval = NULL;
3166         connection_dns_config_type_e config_type;
3167
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);
3171                 return 0;
3172         }
3173
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);
3180
3181         return 0;
3182 }
3183
3184 /**
3185  * @testcase            utc_connection_profile_set_dns_config_type_p
3186  * @since_tizen         4.0
3187  * @type                Positive
3188  * @description         Sets DNS configuration type
3189  * @scenario            Invoking connection_profile_set_dns_config_typ with valid parameter.
3190  */
3191 int utc_connection_profile_set_dns_config_type_p(void)
3192 {
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);
3196         }
3197
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);
3208
3209         return 0;
3210 }
3211
3212 /**
3213  * @testcase            utc_connection_profile_set_dns_config_type_n
3214  * @since_tizen         4.0
3215  * @type                Negative
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.
3218  */
3219 int utc_connection_profile_set_dns_config_type_n(void)
3220 {
3221         connection_profile_h profile_inval = NULL;
3222
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);
3226         }
3227
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);
3234
3235         return 0;
3236 }
3237
3238 /**
3239  * @testcase            utc_connection_profile_get_internet_state_p
3240  * @since_tizen         5.5
3241  * @type                Positive
3242  * @description         Gets internet state.
3243  * @scenario            Verify connection_profile_get_internet_state by passing valid parameter.
3244  */
3245 int utc_connection_profile_get_internet_state_p(void)
3246 {
3247         connection_internet_state_e internet_state;
3248
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);
3252         }
3253
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);
3258
3259         return 0;
3260 }
3261
3262 /**
3263  * @testcase            utc_connection_profile_get_internet_state_n1
3264  * @since_tizen         5.5
3265  * @type                Negative
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.
3268  */
3269 int utc_connection_profile_get_internet_state_n1(void)
3270 {
3271         connection_internet_state_e internet_state;
3272
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);
3276         }
3277
3278         int ret = connection_profile_get_internet_state(NULL, &internet_state);
3279         CHECK_RETURN("connection_profile_get_internet_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3280
3281         return 0;
3282 }
3283
3284 /**
3285  * @testcase            utc_connection_profile_get_internet_state_n2
3286  * @since_tizen         5.5
3287  * @type                Negative
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.
3290  */
3291 int utc_connection_profile_get_internet_state_n2(void)
3292 {
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);
3296         }
3297
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);
3302
3303         return 0;
3304 }
3305
3306 /**
3307  * @testcase            utc_connection_profile_destroy_p
3308  * @since_tizen         2.3
3309  * @type                Positive
3310  * @description         Destroys a profile handle.
3311  * @scenario            Invoking connection_profile_destroy with valid parameter.
3312  */
3313 int utc_connection_profile_destroy_p(void)
3314 {
3315         int ret = CONNECTION_ERROR_INVALID_PARAMETER;
3316
3317         if (all_features_not_supported) {
3318                 ret = connection_profile_destroy(profile_temp);
3319                 CHECK_RETURN("connection_profile_destroy", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3320                 return 0;
3321         }
3322
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);
3327
3328         return 0;
3329 }
3330
3331 /**
3332  * @testcase            utc_connection_profile_destroy_n
3333  * @since_tizen         2.3
3334  * @type                Negative
3335  * @description         connection_profile_destroy should fail with invalid parameter.
3336  * @scenario            Verify connection_profile_destroy by passing invalid parameter.
3337  */
3338 int utc_connection_profile_destroy_n(void)
3339 {
3340         int ret = connection_profile_destroy(NULL);
3341
3342         if (all_features_not_supported)
3343                 CHECK_RETURN("connection_profile_destroy", ret, CONNECTION_ERROR_NOT_SUPPORTED);
3344         else
3345                 CHECK_RETURN("connection_profile_destroy", ret, CONNECTION_ERROR_INVALID_PARAMETER);
3346         return 0;
3347 }