Merge "Add LCOV macro for coverage" into tizen
[platform/core/api/connection.git] / unittest / utc-connection-extension.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 #include "connection_extension.h"
18
19 #define EAP_USER_NAME "eap_user_name"
20 #define EAP_PASSPHRASE "eap_passphrase"
21 #define EAP_IDENTITY "eap_identity"
22 #define EAP_CA_CERT_FILE "eap_ca_cert_file"
23 #define EAP_CLIENT_CERT_FILE "eap_client_cert_file"
24 #define EAP_PRIVATE_KEY_FILENAME "eap_private_key_filename"
25 #define EAP_PRIVATE_KEY_PASSWD "eap_private_key_passwd"
26 #define EAP_ANONYMOUS_IDENTITY "eap_anonymous_identity"
27 #define EAP_PAC_FILENAME "eap_pac_filename"
28
29 void utc_connection_extension_startup(void)
30 {
31         wifi_supported = connection_check_feature_supported(FEATURE_WIFI);
32         telephony_supported = connection_check_feature_supported(FEATURE_TELEPHONY);
33         bt_tethering_supported = connection_check_feature_supported(FEATURE_BT_TETHERING);
34         ethernet_supported = connection_check_feature_supported(FEATURE_ETHERNET);
35
36         if (telephony_supported == false && wifi_supported == false
37                         && bt_tethering_supported == false && ethernet_supported == false) {
38                 all_features_not_supported = true;
39                 return;
40         }
41
42         int ret = connection_create(&connection);
43         PRINT_RETURN("connection_create", ret);
44
45         if (ret != CONNECTION_ERROR_NONE)
46                 return;
47
48         if (telephony_supported) {
49                 if (!profile_cellular) {
50                         ret = connection_profile_create(CONNECTION_PROFILE_TYPE_CELLULAR, "Net", &profile_cellular);
51                         PRINT_RETURN("connection_profile_create", ret);
52                 }
53         }
54
55         if (wifi_supported) {
56                 if (!profile_wifi) {
57                         ret = connection_profile_create(CONNECTION_PROFILE_TYPE_WIFI, NULL, &profile_wifi);
58                         PRINT_RETURN("connection_profile_create", ret);
59                 }
60         }
61 }
62
63 /**
64  * @function            utc_connection_profile_cleanup
65  * @description         Called after each test
66  * @parameter           NA
67  * @return                      NA
68  */
69 void utc_connection_extension_cleanup(void)
70 {
71         int ret;
72
73         if (profile_cellular) {
74                 ret = connection_profile_destroy(profile_cellular);
75                 PRINT_RETURN("connection_profile_destroy", ret);
76                 if (ret == CONNECTION_ERROR_NONE)
77                         profile_cellular = NULL;
78         }
79
80         if (profile_wifi) {
81                 ret = connection_profile_destroy(profile_wifi);
82                 PRINT_RETURN("connection_profile_destroy", ret);
83                 if (ret == CONNECTION_ERROR_NONE)
84                         profile_wifi = NULL;
85         }
86
87         if (profile_temp) {
88                 ret = connection_profile_destroy(profile_temp);
89                 PRINT_RETURN("connection_profile_destroy", ret);
90                 if (ret == CONNECTION_ERROR_NONE)
91                         profile_temp = NULL;
92         }
93
94         if (connection) {
95                 ret = connection_destroy(connection);
96                 PRINT_RETURN("connection_destroy", ret);
97                 if (ret == CONNECTION_ERROR_NONE)
98                         connection = NULL;
99         }
100 }
101
102 int utc_connection_profile_start_tcpdump_p(void)
103 {
104         int ret;
105
106         if (telephony_supported) {
107                 ret = connection_profile_start_tcpdump(connection);
108                 CHECK_RETURN("connection_profile_start_tcpdump", ret, CONNECTION_ERROR_NONE);
109         } else {
110                 ret = connection_profile_start_tcpdump(connection);
111                 CHECK_RETURN("connection_profile_start_tcpdump", ret, CONNECTION_ERROR_NOT_SUPPORTED);
112         }
113
114         return 0;
115 }
116
117 int utc_connection_profile_start_tcpdump_n(void)
118 {
119         int ret;
120
121         if (telephony_supported) {
122                 ret = connection_profile_start_tcpdump(NULL);
123                 CHECK_RETURN("connection_profile_start_tcpdump", ret, CONNECTION_ERROR_INVALID_PARAMETER);
124         } else {
125                 ret = connection_profile_start_tcpdump(NULL);
126                 CHECK_RETURN("connection_profile_start_tcpdump", ret, CONNECTION_ERROR_NOT_SUPPORTED);
127         }
128
129         return 0;
130 }
131
132 int utc_connection_profile_stop_tcpdump_p(void)
133 {
134         int ret;
135
136         if (telephony_supported) {
137                 ret = connection_profile_stop_tcpdump(connection);
138                 CHECK_RETURN("connection_profile_start_tcpdump", ret, CONNECTION_ERROR_NONE);
139         } else {
140                 ret = connection_profile_stop_tcpdump(connection);
141                 CHECK_RETURN("connection_profile_start_tcpdump", ret, CONNECTION_ERROR_NOT_SUPPORTED);
142         }
143
144         return 0;
145 }
146
147 int utc_connection_profile_stop_tcpdump_n(void)
148 {
149         int ret;
150
151         if (telephony_supported) {
152                 ret = connection_profile_stop_tcpdump(NULL);
153                 CHECK_RETURN("connection_profile_stop_tcpdump", ret, CONNECTION_ERROR_INVALID_PARAMETER);
154         } else {
155                 ret = connection_profile_stop_tcpdump(NULL);
156                 CHECK_RETURN("connection_profile_stop_tcpdump", ret, CONNECTION_ERROR_NOT_SUPPORTED);
157         }
158
159         return 0;
160 }
161
162 int utc_connection_profile_get_tcpdump_state_p(void)
163 {
164         int ret;
165         gboolean state;
166
167         if (telephony_supported) {
168                 ret = connection_profile_get_tcpdump_state(connection, &state);
169                 CHECK_RETURN("connection_profile_get_tcpdump_state", ret, CONNECTION_ERROR_NONE);
170         } else {
171                 ret = connection_profile_get_tcpdump_state(connection, &state);
172                 CHECK_RETURN("connection_profile_get_tcpdump_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
173         }
174
175         return 0;
176 }
177
178 int utc_connection_profile_get_tcpdump_state_n(void)
179 {
180         int ret;
181
182         if (telephony_supported) {
183                 ret = connection_profile_get_tcpdump_state(NULL, NULL);
184                 CHECK_RETURN("connection_profile_get_tcpdump_state", ret, CONNECTION_ERROR_INVALID_PARAMETER);
185         } else {
186                 ret = connection_profile_get_tcpdump_state(NULL, NULL);
187                 CHECK_RETURN("connection_profile_get_tcpdump_state", ret, CONNECTION_ERROR_NOT_SUPPORTED);
188         }
189
190         return 0;
191 }
192
193 int utc_connection_profile_save_ethernet_eap_config_p(void)
194 {
195         connection_profile_h profile_h = NULL;
196         int ret = test_get_any_profile(&profile_h);
197
198         if (!ethernet_supported) {
199                 ret = connection_profile_save_ethernet_eap_config(connection, profile_temp);
200                 CHECK_RETURN("connection_profile_save_ethernet_eap_config", ret, CONNECTION_ERROR_NOT_SUPPORTED);
201         }
202
203         assert(profile_h);
204         profile_temp = profile_h;
205
206         ret = connection_profile_save_ethernet_eap_config(connection, profile_temp);
207         CHECK_RETURN("connection_profile_save_ethernet_eap_config", ret, CONNECTION_ERROR_NONE);
208
209         return 0;
210 }
211
212 int utc_connection_profile_save_ethernet_eap_config_n(void)
213 {
214         int ret;
215
216         if (telephony_supported) {
217                 ret = connection_profile_save_ethernet_eap_config(NULL, NULL);
218                 CHECK_RETURN("connection_profile_save_ethernet_eap_config", ret, CONNECTION_ERROR_INVALID_PARAMETER);
219         } else {
220                 ret = connection_profile_save_ethernet_eap_config(NULL, NULL);
221                 CHECK_RETURN("connection_profile_save_ethernet_eap_config", ret, CONNECTION_ERROR_NOT_SUPPORTED);
222         }
223
224         return 0;
225 }
226
227 int utc_connection_mptcp_is_supported_p(void)
228 {
229         int ret;
230         bool supported;
231
232         ret = connection_mptcp_is_supported(connection, &supported);
233         CHECK_RETURN("connection_mptcp_is_supported", ret, CONNECTION_ERROR_NONE);
234
235         return 0;
236 }
237
238 int utc_connection_mptcp_is_supported_n(void)
239 {
240         int ret;
241
242         ret = connection_mptcp_is_supported(NULL, NULL);
243         CHECK_RETURN("connection_mptcp_is_supported", ret, CONNECTION_ERROR_INVALID_PARAMETER);
244
245         return 0;
246 }
247
248 int utc_connection_mptcp_enable_p(void)
249 {
250         int ret;
251
252         ret = connection_mptcp_enable(connection, CONNECTION_MPTCP_ENABLE_ALL);
253         CHECK_RETURN("connection_mptcp_enable", ret, CONNECTION_ERROR_NONE);
254
255         return 0;
256 }
257
258 int utc_connection_mptcp_enable_n(void)
259 {
260         int ret;
261
262         ret = connection_mptcp_enable(NULL, CONNECTION_MPTCP_ENABLE_ALL);
263         CHECK_RETURN("connection_mptcp_enable", ret, CONNECTION_ERROR_INVALID_PARAMETER);
264
265         ret = connection_mptcp_enable(connection, CONNECTION_MPTCP_DISABLE);
266         CHECK_RETURN("connection_mptcp_enable", ret, CONNECTION_ERROR_INVALID_PARAMETER);
267
268         return 0;
269 }
270
271 int utc_connection_mptcp_disable_p(void)
272 {
273         int ret;
274
275         ret = connection_mptcp_disable(connection);
276         CHECK_RETURN("connection_mptcp_disable", ret, CONNECTION_ERROR_NONE);
277
278         return 0;
279 }
280
281 int utc_connection_mptcp_disable_n(void)
282 {
283         int ret;
284
285         ret = connection_mptcp_disable(NULL);
286         CHECK_RETURN("connection_mptcp_disable", ret, CONNECTION_ERROR_INVALID_PARAMETER);
287
288         return 0;
289 }
290
291 int utc_connection_mptcp_get_enabled_p(void)
292 {
293         int ret;
294         connection_mptcp_enable_e enable;
295
296         ret = connection_mptcp_get_enabled(connection, &enable);
297         CHECK_RETURN("connection_mptcp_get_enabled", ret, CONNECTION_ERROR_NONE);
298
299         return 0;
300 }
301
302 int utc_connection_mptcp_get_enabled_n(void)
303 {
304         int ret;
305
306         ret = connection_mptcp_get_enabled(NULL, NULL);
307         CHECK_RETURN("connection_mptcp_get_enabled", ret, CONNECTION_ERROR_INVALID_PARAMETER);
308
309         return 0;
310 }
311
312 int utc_connection_mptcp_set_path_manager_p(void)
313 {
314         int ret;
315
316         ret = connection_mptcp_set_path_manager(connection, CONNECTION_MPTCP_PM_DEFAULT);
317         CHECK_RETURN("connection_mptcp_set_path_manager", ret, CONNECTION_ERROR_NONE);
318
319         return 0;
320 }
321
322 int utc_connection_mptcp_set_path_manager_n(void)
323 {
324         int ret;
325
326         ret = connection_mptcp_set_path_manager(NULL, CONNECTION_MPTCP_PM_DEFAULT);
327         CHECK_RETURN("connection_mptcp_set_path_manager", ret, CONNECTION_ERROR_INVALID_PARAMETER);
328
329         return 0;
330 }
331
332 int utc_connection_mptcp_get_path_manager_p(void)
333 {
334         int ret;
335         connection_mptcp_path_manager_e pm;
336
337         ret = connection_mptcp_get_path_manager(connection, &pm);
338         CHECK_RETURN("connection_mptcp_get_path_manager", ret, CONNECTION_ERROR_NONE);
339
340         return 0;
341 }
342
343 int utc_connection_mptcp_get_path_manager_n(void)
344 {
345         int ret;
346         connection_mptcp_path_manager_e pm;
347
348         ret = connection_mptcp_get_path_manager(NULL, &pm);
349         CHECK_RETURN("connection_mptcp_get_path_manager", ret, CONNECTION_ERROR_INVALID_PARAMETER);
350
351         ret = connection_mptcp_get_path_manager(connection, NULL);
352         CHECK_RETURN("connection_mptcp_get_path_manager", ret, CONNECTION_ERROR_INVALID_PARAMETER);
353
354         return 0;
355 }
356
357 int utc_connection_mptcp_set_scheduler_p(void)
358 {
359         int ret;
360
361         ret = connection_mptcp_set_scheduler(connection, CONNECTION_MPTCP_SCHEDULER_DEFAULT);
362         CHECK_RETURN("connection_mptcp_set_scheduler", ret, CONNECTION_ERROR_NONE);
363
364         return 0;
365 }
366
367 int utc_connection_mptcp_set_scheduler_n(void)
368 {
369         int ret;
370
371         ret = connection_mptcp_set_scheduler(NULL, CONNECTION_MPTCP_SCHEDULER_DEFAULT);
372         CHECK_RETURN("connection_mptcp_set_scheduler", ret, CONNECTION_ERROR_INVALID_PARAMETER);
373
374         return 0;
375 }
376
377 int utc_connection_mptcp_get_scheduler_p(void)
378 {
379         int ret;
380         connection_mptcp_scheduler_e scheduler;
381
382         ret = connection_mptcp_get_scheduler(connection, &scheduler);
383         CHECK_RETURN("connection_mptcp_get_scheduler", ret, CONNECTION_ERROR_NONE);
384
385         return 0;
386 }
387
388 int utc_connection_mptcp_get_scheduler_n(void)
389 {
390         int ret;
391         connection_mptcp_scheduler_e scheduler;
392
393         ret = connection_mptcp_get_scheduler(NULL, &scheduler);
394         CHECK_RETURN("connection_mptcp_get_scheduler", ret, CONNECTION_ERROR_INVALID_PARAMETER);
395
396         ret = connection_mptcp_get_scheduler(connection, NULL);
397         CHECK_RETURN("connection_mptcp_get_scheduler", ret, CONNECTION_ERROR_INVALID_PARAMETER);
398
399         return 0;
400 }
401
402 int utc_connection_profile_is_ethernet_eap_enabled_p(void)
403 {
404         int ret;
405         bool enabled;
406
407         if (all_features_not_supported) {
408                 ret = connection_profile_is_ethernet_eap_enabled(NULL, NULL);
409                 CHECK_RETURN("connection_profile_is_ethernet_eap_enabled", ret, CONNECTION_ERROR_NOT_SUPPORTED);
410                 return 0;
411         }
412
413         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
414         ret = connection_profile_is_ethernet_eap_enabled(profile_temp, &enabled);
415         CHECK_RETURN("connection_profile_is_ethernet_eap_enabled", ret, CONNECTION_ERROR_NONE);
416
417         return 0;
418 }
419
420 int utc_connection_profile_is_ethernet_eap_enabled_n(void)
421 {
422         int ret;
423
424         if (all_features_not_supported) {
425                 ret = connection_profile_is_ethernet_eap_enabled(NULL, NULL);
426                 CHECK_RETURN("connection_profile_is_ethernet_eap_enabled", ret, CONNECTION_ERROR_NOT_SUPPORTED);
427                 return 0;
428         }
429
430         ret = connection_profile_is_ethernet_eap_enabled(NULL, NULL);
431         CHECK_RETURN("connection_profile_is_ethernet_eap_enabled", ret, CONNECTION_ERROR_INVALID_PARAMETER);
432
433         return 0;
434 }
435
436 int utc_connection_profile_enable_ethernet_eap_p(void)
437 {
438         int ret;
439
440         if (all_features_not_supported) {
441                 ret = connection_profile_enable_ethernet_eap(NULL, NULL);
442                 CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NOT_SUPPORTED);
443                 return 0;
444         }
445
446         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
447         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
448         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
449
450         return 0;
451 }
452
453 int utc_connection_profile_enable_ethernet_eap_n(void)
454 {
455         int ret;
456
457         if (all_features_not_supported) {
458                 ret = connection_profile_enable_ethernet_eap(NULL, NULL);
459                 CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NOT_SUPPORTED);
460                 return 0;
461         }
462
463         ret = connection_profile_enable_ethernet_eap(NULL, NULL);
464         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_INVALID_PARAMETER);
465
466         return 0;
467 }
468
469 int utc_connection_profile_set_ethernet_eap_type_p(void)
470 {
471         int ret;
472
473         if (all_features_not_supported) {
474                 ret = connection_profile_set_ethernet_eap_type(NULL, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
475                 CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
476                 return 0;
477         }
478
479         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
480         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
481         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
482         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
483         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
484
485         return 0;
486 }
487
488 int utc_connection_profile_set_ethernet_eap_type_n(void)
489 {
490         int ret;
491
492         if (all_features_not_supported) {
493                 ret = connection_profile_set_ethernet_eap_type(NULL, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
494                 CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
495                 return 0;
496         }
497
498         ret = connection_profile_set_ethernet_eap_type(NULL, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
499         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
500
501         return 0;
502 }
503
504 int utc_connection_profile_get_ethernet_eap_type_p(void)
505 {
506         int ret;
507         connection_ethernet_eap_type_e type;
508
509         if (all_features_not_supported) {
510                 ret = connection_profile_get_ethernet_eap_type(NULL, NULL);
511                 CHECK_RETURN("connection_profile_get_ethernet_eap_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
512                 return 0;
513         }
514
515         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
516         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
517         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
518         ret = connection_profile_get_ethernet_eap_type(profile_temp, &type);
519         CHECK_RETURN("connection_profile_get_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
520
521         return 0;
522 }
523
524 int utc_connection_profile_get_ethernet_eap_type_n(void)
525 {
526         int ret;
527
528         if (all_features_not_supported) {
529                 ret = connection_profile_get_ethernet_eap_type(NULL, NULL);
530                 CHECK_RETURN("connection_profile_get_ethernet_eap_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
531                 return 0;
532         }
533
534         ret = connection_profile_get_ethernet_eap_type(NULL, NULL);
535         CHECK_RETURN("connection_profile_get_ethernet_eap_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
536
537         return 0;
538 }
539
540 int utc_connection_profile_set_ethernet_eap_passphrase_p(void)
541 {
542         int ret;
543
544         if (all_features_not_supported) {
545                 ret = connection_profile_set_ethernet_eap_passphrase(NULL, NULL, NULL);
546                 CHECK_RETURN("connection_profile_set_ethernet_eap_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
547                 return 0;
548         }
549
550         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
551         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
552         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
553         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_TLS);
554         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
555         ret = connection_profile_set_ethernet_eap_passphrase(profile_temp, EAP_USER_NAME, EAP_PASSPHRASE);
556         CHECK_RETURN("connection_profile_set_ethernet_eap_passphrase", ret, CONNECTION_ERROR_INVALID_OPERATION);
557         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
558         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
559         ret = connection_profile_set_ethernet_eap_passphrase(profile_temp, EAP_USER_NAME, EAP_PASSPHRASE);
560         CHECK_RETURN("connection_profile_set_ethernet_eap_passphrase", ret, CONNECTION_ERROR_NONE);
561
562         return 0;
563 }
564
565 int utc_connection_profile_set_ethernet_eap_passphrase_n(void)
566 {
567         int ret;
568
569         if (all_features_not_supported) {
570                 ret = connection_profile_set_ethernet_eap_passphrase(NULL, NULL, NULL);
571                 CHECK_RETURN("connection_profile_set_ethernet_eap_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
572                 return 0;
573         }
574
575         ret = connection_profile_set_ethernet_eap_passphrase(NULL, NULL, NULL);
576         CHECK_RETURN("connection_profile_set_ethernet_eap_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
577
578         return 0;
579 }
580
581 int utc_connection_profile_get_ethernet_eap_passphrase_p(void)
582 {
583         int ret;
584         char *user_name;
585         bool is_password_set;
586
587         if (all_features_not_supported) {
588                 ret = connection_profile_get_ethernet_eap_passphrase(NULL, NULL, NULL);
589                 CHECK_RETURN("connection_profile_get_ethernet_eap_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
590                 return 0;
591         }
592
593         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
594         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
595         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
596         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_TLS);
597         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
598         ret = connection_profile_get_ethernet_eap_passphrase(profile_temp, &user_name, &is_password_set);
599         CHECK_RETURN("connection_profile_get_ethernet_eap_passphrase", ret, CONNECTION_ERROR_INVALID_OPERATION);
600         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
601         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
602         ret = connection_profile_get_ethernet_eap_passphrase(profile_temp, &user_name, &is_password_set);
603         CHECK_RETURN("connection_profile_get_ethernet_eap_passphrase", ret, CONNECTION_ERROR_NONE);
604
605         return 0;
606 }
607
608 int utc_connection_profile_get_ethernet_eap_passphrase_n(void)
609 {
610         int ret;
611
612         if (all_features_not_supported) {
613                 ret = connection_profile_get_ethernet_eap_passphrase(NULL, NULL, NULL);
614                 CHECK_RETURN("connection_profile_get_ethernet_eap_passphrase", ret, CONNECTION_ERROR_NOT_SUPPORTED);
615                 return 0;
616         }
617
618         ret = connection_profile_get_ethernet_eap_passphrase(NULL, NULL, NULL);
619         CHECK_RETURN("connection_profile_get_ethernet_eap_passphrase", ret, CONNECTION_ERROR_INVALID_PARAMETER);
620
621         return 0;
622 }
623
624 int utc_connection_profile_set_ethernet_eap_identity_p(void)
625 {
626         int ret;
627
628         if (all_features_not_supported) {
629                 ret = connection_profile_set_ethernet_eap_identity(NULL, NULL);
630                 CHECK_RETURN("connection_profile_set_ethernet_eap_identity", ret, CONNECTION_ERROR_NOT_SUPPORTED);
631                 return 0;
632         }
633
634         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
635         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
636         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
637         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
638         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
639         ret = connection_profile_set_ethernet_eap_identity(profile_temp, EAP_IDENTITY);
640         CHECK_RETURN("connection_profile_set_ethernet_eap_identity", ret, CONNECTION_ERROR_NONE);
641
642         return 0;
643 }
644
645 int utc_connection_profile_set_ethernet_eap_identity_n(void)
646 {
647         int ret;
648
649         if (all_features_not_supported) {
650                 ret = connection_profile_set_ethernet_eap_identity(NULL, NULL);
651                 CHECK_RETURN("connection_profile_set_ethernet_eap_identity", ret, CONNECTION_ERROR_NOT_SUPPORTED);
652                 return 0;
653         }
654
655         ret = connection_profile_set_ethernet_eap_identity(NULL, NULL);
656         CHECK_RETURN("connection_profile_set_ethernet_eap_identity", ret, CONNECTION_ERROR_INVALID_PARAMETER);
657
658         return 0;
659 }
660
661 int utc_connection_profile_get_ethernet_eap_identity_p(void)
662 {
663         int ret;
664         char *identity;
665
666         if (all_features_not_supported) {
667                 ret = connection_profile_get_ethernet_eap_identity(NULL, NULL);
668                 CHECK_RETURN("connection_profile_get_ethernet_eap_identity", ret, CONNECTION_ERROR_NOT_SUPPORTED);
669                 return 0;
670         }
671
672         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
673         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
674         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
675         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
676         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
677         ret = connection_profile_get_ethernet_eap_identity(profile_temp, &identity);
678         CHECK_RETURN("connection_profile_get_ethernet_eap_identity", ret, CONNECTION_ERROR_NONE);
679
680         return 0;
681 }
682
683 int utc_connection_profile_get_ethernet_eap_identity_n(void)
684 {
685         int ret;
686
687         if (all_features_not_supported) {
688                 ret = connection_profile_get_ethernet_eap_identity(NULL, NULL);
689                 CHECK_RETURN("connection_profile_get_ethernet_eap_identity", ret, CONNECTION_ERROR_NOT_SUPPORTED);
690                 return 0;
691         }
692
693         ret = connection_profile_get_ethernet_eap_identity(NULL, NULL);
694         CHECK_RETURN("connection_profile_get_ethernet_eap_identity", ret, CONNECTION_ERROR_INVALID_PARAMETER);
695
696         return 0;
697 }
698
699 int utc_connection_profile_set_ethernet_eap_ca_cert_file_p(void)
700 {
701         int ret;
702
703         if (all_features_not_supported) {
704                 ret = connection_profile_set_ethernet_eap_ca_cert_file(NULL, NULL);
705                 CHECK_RETURN("connection_profile_set_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
706                 return 0;
707         }
708
709         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
710         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
711         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
712         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_MD5);
713         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
714         ret = connection_profile_set_ethernet_eap_ca_cert_file(profile_temp, EAP_CA_CERT_FILE);
715         CHECK_RETURN("connection_profile_set_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_INVALID_OPERATION);
716         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
717         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
718         ret = connection_profile_set_ethernet_eap_ca_cert_file(profile_temp, EAP_CA_CERT_FILE);
719         CHECK_RETURN("connection_profile_set_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_NONE);
720
721         return 0;
722 }
723
724 int utc_connection_profile_set_ethernet_eap_ca_cert_file_n(void)
725 {
726         int ret;
727
728         if (all_features_not_supported) {
729                 ret = connection_profile_set_ethernet_eap_ca_cert_file(NULL, NULL);
730                 CHECK_RETURN("connection_profile_set_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
731                 return 0;
732         }
733
734         ret = connection_profile_set_ethernet_eap_ca_cert_file(NULL, NULL);
735         CHECK_RETURN("connection_profile_set_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_INVALID_PARAMETER);
736
737         return 0;
738 }
739
740 int utc_connection_profile_get_ethernet_eap_ca_cert_file_p(void)
741 {
742         int ret;
743         char *file;
744
745         if (all_features_not_supported) {
746                 ret = connection_profile_get_ethernet_eap_ca_cert_file(NULL, NULL);
747                 CHECK_RETURN("connection_profile_get_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
748                 return 0;
749         }
750
751         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
752         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
753         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
754         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_MD5);
755         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
756         ret = connection_profile_get_ethernet_eap_ca_cert_file(profile_temp, &file);
757         CHECK_RETURN("connection_profile_get_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_INVALID_OPERATION);
758         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
759         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
760         ret = connection_profile_get_ethernet_eap_ca_cert_file(profile_temp, &file);
761         CHECK_RETURN("connection_profile_get_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_NONE);
762
763         return 0;
764 }
765
766 int utc_connection_profile_get_ethernet_eap_ca_cert_file_n(void)
767 {
768         int ret;
769
770         if (all_features_not_supported) {
771                 ret = connection_profile_get_ethernet_eap_ca_cert_file(NULL, NULL);
772                 CHECK_RETURN("connection_profile_get_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
773                 return 0;
774         }
775
776         ret = connection_profile_get_ethernet_eap_ca_cert_file(NULL, NULL);
777         CHECK_RETURN("connection_profile_get_ethernet_eap_ca_cert_file", ret, CONNECTION_ERROR_INVALID_PARAMETER);
778
779         return 0;
780 }
781
782 int utc_connection_profile_set_ethernet_eap_client_cert_file_p(void)
783 {
784         int ret;
785
786         if (all_features_not_supported) {
787                 ret = connection_profile_set_ethernet_eap_client_cert_file(NULL, NULL);
788                 CHECK_RETURN("connection_profile_set_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
789                 return 0;
790         }
791
792         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
793         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
794         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
795         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
796         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
797         ret = connection_profile_set_ethernet_eap_client_cert_file(profile_temp, EAP_CLIENT_CERT_FILE);
798         CHECK_RETURN("connection_profile_set_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_INVALID_OPERATION);
799         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_TLS);
800         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
801         ret = connection_profile_set_ethernet_eap_client_cert_file(profile_temp, EAP_CLIENT_CERT_FILE);
802         CHECK_RETURN("connection_profile_set_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_NONE);
803
804         return 0;
805 }
806
807 int utc_connection_profile_set_ethernet_eap_client_cert_file_n(void)
808 {
809         int ret;
810
811         if (all_features_not_supported) {
812                 ret = connection_profile_set_ethernet_eap_client_cert_file(NULL, NULL);
813                 CHECK_RETURN("connection_profile_set_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
814                 return 0;
815         }
816
817         ret = connection_profile_set_ethernet_eap_client_cert_file(NULL, NULL);
818         CHECK_RETURN("connection_profile_set_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_INVALID_PARAMETER);
819
820         return 0;
821 }
822
823 int utc_connection_profile_get_ethernet_eap_client_cert_file_p(void)
824 {
825         int ret;
826         char *file;
827
828         if (all_features_not_supported) {
829                 ret = connection_profile_get_ethernet_eap_client_cert_file(NULL, NULL);
830                 CHECK_RETURN("connection_profile_get_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
831                 return 0;
832         }
833
834         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
835         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
836         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
837         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
838         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
839         ret = connection_profile_get_ethernet_eap_client_cert_file(profile_temp, &file);
840         CHECK_RETURN("connection_profile_get_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_INVALID_OPERATION);
841         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_TLS);
842         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
843         ret = connection_profile_get_ethernet_eap_client_cert_file(profile_temp, &file);
844         CHECK_RETURN("connection_profile_get_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_NONE);
845
846         return 0;
847 }
848
849 int utc_connection_profile_get_ethernet_eap_client_cert_file_n(void)
850 {
851         int ret;
852
853         if (all_features_not_supported) {
854                 ret = connection_profile_get_ethernet_eap_client_cert_file(NULL, NULL);
855                 CHECK_RETURN("connection_profile_get_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
856                 return 0;
857         }
858
859         ret = connection_profile_get_ethernet_eap_client_cert_file(NULL, NULL);
860         CHECK_RETURN("connection_profile_get_ethernet_eap_client_cert_file", ret, CONNECTION_ERROR_INVALID_PARAMETER);
861
862         return 0;
863 }
864
865 int utc_connection_profile_set_ethernet_eap_private_key_info_p(void)
866 {
867         int ret;
868
869         if (all_features_not_supported) {
870                 ret = connection_profile_set_ethernet_eap_private_key_info(NULL, NULL, NULL);
871                 CHECK_RETURN("connection_profile_set_ethernet_eap_private_key_info", ret, CONNECTION_ERROR_NOT_SUPPORTED);
872                 return 0;
873         }
874
875         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
876         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
877         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
878         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
879         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
880         ret = connection_profile_set_ethernet_eap_private_key_info(profile_temp,
881                         EAP_PRIVATE_KEY_FILENAME, EAP_PRIVATE_KEY_PASSWD);
882         CHECK_RETURN("connection_profile_set_ethernet_eap_private_key_info", ret, CONNECTION_ERROR_INVALID_OPERATION);
883         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_TLS);
884         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
885         ret = connection_profile_set_ethernet_eap_private_key_info(profile_temp,
886                         EAP_PRIVATE_KEY_FILENAME, EAP_PRIVATE_KEY_PASSWD);
887         CHECK_RETURN("connection_profile_set_ethernet_eap_private_key_info", ret, CONNECTION_ERROR_NONE);
888
889         return 0;
890 }
891
892 int utc_connection_profile_set_ethernet_eap_private_key_info_n(void)
893 {
894         int ret;
895
896         if (all_features_not_supported) {
897                 ret = connection_profile_set_ethernet_eap_private_key_info(NULL, NULL, NULL);
898                 CHECK_RETURN("connection_profile_set_ethernet_eap_private_key_info", ret, CONNECTION_ERROR_NOT_SUPPORTED);
899                 return 0;
900         }
901
902         ret = connection_profile_set_ethernet_eap_private_key_info(NULL, NULL, NULL);
903         CHECK_RETURN("connection_profile_set_ethernet_eap_private_key_info", ret, CONNECTION_ERROR_INVALID_PARAMETER);
904
905         return 0;
906 }
907
908 int utc_connection_profile_get_ethernet_eap_private_key_file_p(void)
909 {
910         int ret;
911         char *file;
912
913         if (all_features_not_supported) {
914                 ret = connection_profile_get_ethernet_eap_private_key_file(NULL, NULL);
915                 CHECK_RETURN("connection_profile_get_ethernet_eap_private_key_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
916                 return 0;
917         }
918
919         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
920         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
921         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
922         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
923         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
924         ret = connection_profile_get_ethernet_eap_private_key_file(profile_temp, &file);
925         CHECK_RETURN("connection_profile_get_ethernet_eap_private_key_file", ret, CONNECTION_ERROR_INVALID_OPERATION);
926         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_TLS);
927         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
928         ret = connection_profile_get_ethernet_eap_private_key_file(profile_temp, &file);
929         CHECK_RETURN("connection_profile_get_ethernet_eap_private_key_file", ret, CONNECTION_ERROR_NONE);
930
931         return 0;
932 }
933
934 int utc_connection_profile_get_ethernet_eap_private_key_file_n(void)
935 {
936         int ret;
937
938         if (all_features_not_supported) {
939                 ret = connection_profile_get_ethernet_eap_private_key_file(NULL, NULL);
940                 CHECK_RETURN("connection_profile_get_ethernet_eap_private_key_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
941                 return 0;
942         }
943
944         ret = connection_profile_get_ethernet_eap_private_key_file(NULL, NULL);
945         CHECK_RETURN("connection_profile_get_ethernet_eap_private_key_file", ret, CONNECTION_ERROR_INVALID_PARAMETER);
946
947         return 0;
948 }
949
950 int utc_connection_profile_set_ethernet_eap_anonymous_identity_p(void)
951 {
952         int ret;
953
954         if (all_features_not_supported) {
955                 ret = connection_profile_set_ethernet_eap_anonymous_identity(NULL, NULL);
956                 CHECK_RETURN("connection_profile_set_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_NOT_SUPPORTED);
957                 return 0;
958         }
959
960         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
961         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
962         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
963         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_MD5);
964         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
965         ret = connection_profile_set_ethernet_eap_anonymous_identity(profile_temp, EAP_ANONYMOUS_IDENTITY);
966         CHECK_RETURN("connection_profile_set_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_INVALID_OPERATION);
967         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
968         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
969         ret = connection_profile_set_ethernet_eap_anonymous_identity(profile_temp, EAP_ANONYMOUS_IDENTITY);
970         CHECK_RETURN("connection_profile_set_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_NONE);
971
972         return 0;
973 }
974
975 int utc_connection_profile_set_ethernet_eap_anonymous_identity_n(void)
976 {
977         int ret;
978
979         if (all_features_not_supported) {
980                 ret = connection_profile_set_ethernet_eap_anonymous_identity(NULL, NULL);
981                 CHECK_RETURN("connection_profile_set_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_NOT_SUPPORTED);
982                 return 0;
983         }
984
985         ret = connection_profile_set_ethernet_eap_anonymous_identity(NULL, NULL);
986         CHECK_RETURN("connection_profile_set_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_INVALID_PARAMETER);
987
988         return 0;
989 }
990
991 int utc_connection_profile_get_ethernet_eap_anonymous_identity_p(void)
992 {
993         int ret;
994         char *file;
995
996         if (all_features_not_supported) {
997                 ret = connection_profile_get_ethernet_eap_anonymous_identity(NULL, NULL);
998                 CHECK_RETURN("connection_profile_get_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_NOT_SUPPORTED);
999                 return 0;
1000         }
1001
1002         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
1003         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
1004         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
1005         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_MD5);
1006         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1007         ret = connection_profile_get_ethernet_eap_anonymous_identity(profile_temp, &file);
1008         CHECK_RETURN("connection_profile_get_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_INVALID_OPERATION);
1009         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
1010         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1011         ret = connection_profile_get_ethernet_eap_anonymous_identity(profile_temp, &file);
1012         CHECK_RETURN("connection_profile_get_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_NONE);
1013
1014         return 0;
1015 }
1016
1017 int utc_connection_profile_get_ethernet_eap_anonymous_identity_n(void)
1018 {
1019         int ret;
1020
1021         if (all_features_not_supported) {
1022                 ret = connection_profile_get_ethernet_eap_anonymous_identity(NULL, NULL);
1023                 CHECK_RETURN("connection_profile_get_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1024                 return 0;
1025         }
1026
1027         ret = connection_profile_get_ethernet_eap_anonymous_identity(NULL, NULL);
1028         CHECK_RETURN("connection_profile_get_ethernet_eap_anonymous_identity", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1029
1030         return 0;
1031 }
1032
1033 int utc_connection_profile_set_ethernet_eap_pac_file_p(void)
1034 {
1035         int ret;
1036
1037         if (all_features_not_supported) {
1038                 ret = connection_profile_set_ethernet_eap_pac_file(NULL, NULL);
1039                 CHECK_RETURN("connection_profile_set_ethernet_eap_pac_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1040                 return 0;
1041         }
1042
1043         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
1044         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
1045         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
1046         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_TLS);
1047         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1048         ret = connection_profile_set_ethernet_eap_pac_file(profile_temp, EAP_PAC_FILENAME);
1049         CHECK_RETURN("connection_profile_set_ethernet_eap_pac_file", ret, CONNECTION_ERROR_INVALID_OPERATION);
1050         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_FAST);
1051         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1052         ret = connection_profile_set_ethernet_eap_pac_file(profile_temp, EAP_PAC_FILENAME);
1053         CHECK_RETURN("connection_profile_set_ethernet_eap_pac_file", ret, CONNECTION_ERROR_NONE);
1054
1055         return 0;
1056 }
1057
1058 int utc_connection_profile_set_ethernet_eap_pac_file_n(void)
1059 {
1060         int ret;
1061
1062         if (all_features_not_supported) {
1063                 ret = connection_profile_set_ethernet_eap_pac_file(NULL, NULL);
1064                 CHECK_RETURN("connection_profile_set_ethernet_eap_pac_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1065                 return 0;
1066         }
1067
1068         ret = connection_profile_set_ethernet_eap_pac_file(NULL, NULL);
1069         CHECK_RETURN("connection_profile_set_ethernet_eap_pac_file", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1070
1071         return 0;
1072 }
1073
1074 int utc_connection_profile_get_ethernet_eap_pac_file_p(void)
1075 {
1076         int ret;
1077         char *file;
1078
1079         if (all_features_not_supported) {
1080                 ret = connection_profile_get_ethernet_eap_pac_file(NULL, NULL);
1081                 CHECK_RETURN("connection_profile_get_ethernet_eap_pac_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1082                 return 0;
1083         }
1084
1085         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
1086         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
1087         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
1088         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_TLS);
1089         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1090         ret = connection_profile_get_ethernet_eap_pac_file(profile_temp, &file);
1091         CHECK_RETURN("connection_profile_get_ethernet_eap_pac_file", ret, CONNECTION_ERROR_INVALID_OPERATION);
1092         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_FAST);
1093         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1094         ret = connection_profile_get_ethernet_eap_pac_file(profile_temp, &file);
1095         CHECK_RETURN("connection_profile_get_ethernet_eap_pac_file", ret, CONNECTION_ERROR_NONE);
1096
1097         return 0;
1098 }
1099
1100 int utc_connection_profile_get_ethernet_eap_pac_file_n(void)
1101 {
1102         int ret;
1103
1104         if (all_features_not_supported) {
1105                 ret = connection_profile_get_ethernet_eap_pac_file(NULL, NULL);
1106                 CHECK_RETURN("connection_profile_get_ethernet_eap_pac_file", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1107                 return 0;
1108         }
1109
1110         ret = connection_profile_get_ethernet_eap_pac_file(NULL, NULL);
1111         CHECK_RETURN("connection_profile_get_ethernet_eap_pac_file", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1112
1113         return 0;
1114 }
1115
1116 int utc_connection_profile_set_ethernet_eap_auth_type_p(void)
1117 {
1118         int ret;
1119
1120         if (all_features_not_supported) {
1121                 ret = connection_profile_set_ethernet_eap_auth_type(NULL, CONNECTION_ETHERNET_EAP_AUTH_TYPE_MSCHAPV2);
1122                 CHECK_RETURN("connection_profile_set_ethernet_eap_auth_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1123                 return 0;
1124         }
1125
1126         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
1127         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
1128         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
1129         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_MD5);
1130         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1131         ret = connection_profile_set_ethernet_eap_auth_type(profile_temp, CONNECTION_ETHERNET_EAP_AUTH_TYPE_MSCHAPV2);
1132         CHECK_RETURN("connection_profile_set_ethernet_eap_auth_type", ret, CONNECTION_ERROR_INVALID_OPERATION);
1133         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_FAST);
1134         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1135         ret = connection_profile_set_ethernet_eap_auth_type(profile_temp, CONNECTION_ETHERNET_EAP_AUTH_TYPE_MSCHAPV2);
1136         CHECK_RETURN("connection_profile_set_ethernet_eap_auth_type", ret, CONNECTION_ERROR_NONE);
1137
1138         return 0;
1139 }
1140
1141 int utc_connection_profile_set_ethernet_eap_auth_type_n(void)
1142 {
1143         int ret;
1144
1145         if (all_features_not_supported) {
1146                 ret = connection_profile_set_ethernet_eap_auth_type(NULL, CONNECTION_ETHERNET_EAP_AUTH_TYPE_MSCHAPV2);
1147                 CHECK_RETURN("connection_profile_set_ethernet_eap_auth_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1148                 return 0;
1149         }
1150
1151         ret = connection_profile_set_ethernet_eap_auth_type(NULL, CONNECTION_ETHERNET_EAP_AUTH_TYPE_MSCHAPV2);
1152         CHECK_RETURN("connection_profile_set_ethernet_eap_auth_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1153
1154         return 0;
1155 }
1156
1157 int utc_connection_profile_get_ethernet_eap_auth_type_p(void)
1158 {
1159         int ret;
1160         connection_ethernet_eap_auth_type_e type;
1161
1162         if (all_features_not_supported) {
1163                 ret = connection_profile_get_ethernet_eap_auth_type(NULL, NULL);
1164                 CHECK_RETURN("connection_profile_get_ethernet_eap_auth_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1165                 return 0;
1166         }
1167
1168         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
1169         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
1170         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
1171         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_FAST);
1172         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1173         ret = connection_profile_get_ethernet_eap_auth_type(profile_temp, &type);
1174         CHECK_RETURN("connection_profile_get_ethernet_eap_auth_type", ret, CONNECTION_ERROR_NONE);
1175
1176         return 0;
1177 }
1178
1179 int utc_connection_profile_get_ethernet_eap_auth_type_n(void)
1180 {
1181         int ret;
1182
1183         if (all_features_not_supported) {
1184                 ret = connection_profile_get_ethernet_eap_auth_type(NULL, NULL);
1185                 CHECK_RETURN("connection_profile_get_ethernet_eap_auth_type", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1186                 return 0;
1187         }
1188
1189         ret = connection_profile_get_ethernet_eap_auth_type(NULL, NULL);
1190         CHECK_RETURN("connection_profile_get_ethernet_eap_auth_type", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1191
1192         return 0;
1193 }
1194
1195 int utc_connection_profile_set_ethernet_eap_peap_version_p(void)
1196 {
1197         int ret;
1198
1199         if (all_features_not_supported) {
1200                 ret = connection_profile_set_ethernet_eap_peap_version(NULL, CONNECTION_ETHERNET_EAP_PEAP_VERSION_0);
1201                 CHECK_RETURN("connection_profile_set_ethernet_eap_peap_version", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1202                 return 0;
1203         }
1204
1205         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
1206         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
1207         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
1208         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_MD5);
1209         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1210         ret = connection_profile_set_ethernet_eap_peap_version(profile_temp, CONNECTION_ETHERNET_EAP_PEAP_VERSION_0);
1211         CHECK_RETURN("connection_profile_set_ethernet_eap_peap_version", ret, CONNECTION_ERROR_INVALID_OPERATION);
1212         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
1213         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1214         ret = connection_profile_set_ethernet_eap_peap_version(profile_temp, CONNECTION_ETHERNET_EAP_PEAP_VERSION_0);
1215         CHECK_RETURN("connection_profile_set_ethernet_eap_peap_version", ret, CONNECTION_ERROR_NONE);
1216
1217         return 0;
1218 }
1219
1220 int utc_connection_profile_set_ethernet_eap_peap_version_n(void)
1221 {
1222         int ret;
1223
1224         if (all_features_not_supported) {
1225                 ret = connection_profile_set_ethernet_eap_peap_version(NULL, CONNECTION_ETHERNET_EAP_PEAP_VERSION_0);
1226                 CHECK_RETURN("connection_profile_set_ethernet_eap_peap_version", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1227                 return 0;
1228         }
1229
1230         ret = connection_profile_set_ethernet_eap_peap_version(NULL, CONNECTION_ETHERNET_EAP_PEAP_VERSION_0);
1231         CHECK_RETURN("connection_profile_set_ethernet_eap_peap_version", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1232
1233         return 0;
1234 }
1235
1236 int utc_connection_profile_get_ethernet_eap_peap_version_p(void)
1237 {
1238         int ret;
1239         connection_ethernet_eap_peap_version_e version;
1240
1241         if (all_features_not_supported) {
1242                 ret = connection_profile_get_ethernet_eap_peap_version(NULL, NULL);
1243                 CHECK_RETURN("connection_profile_get_ethernet_eap_peap_version", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1244                 return 0;
1245         }
1246
1247         test_get_profile_by_type(&profile_temp, CONNECTION_PROFILE_TYPE_ETHERNET);
1248         ret = connection_profile_enable_ethernet_eap(profile_temp, TRUE);
1249         CHECK_RETURN("connection_profile_enable_ethernet_eap", ret, CONNECTION_ERROR_NONE);
1250         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_TLS);
1251         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1252         ret = connection_profile_get_ethernet_eap_peap_version(profile_temp, &version);
1253         CHECK_RETURN("connection_profile_get_ethernet_eap_peap_version", ret, CONNECTION_ERROR_INVALID_OPERATION);
1254         ret = connection_profile_set_ethernet_eap_type(profile_temp, CONNECTION_ETHERNET_EAP_TYPE_PEAP);
1255         CHECK_RETURN("connection_profile_set_ethernet_eap_type", ret, CONNECTION_ERROR_NONE);
1256         ret = connection_profile_get_ethernet_eap_peap_version(profile_temp, &version);
1257         CHECK_RETURN("connection_profile_get_ethernet_eap_peap_version", ret, CONNECTION_ERROR_NONE);
1258
1259         return 0;
1260 }
1261
1262 int utc_connection_profile_get_ethernet_eap_peap_version_n(void)
1263 {
1264         int ret;
1265
1266         if (all_features_not_supported) {
1267                 ret = connection_profile_get_ethernet_eap_peap_version(NULL, NULL);
1268                 CHECK_RETURN("connection_profile_get_ethernet_eap_peap_version", ret, CONNECTION_ERROR_NOT_SUPPORTED);
1269                 return 0;
1270         }
1271
1272         ret = connection_profile_get_ethernet_eap_peap_version(NULL, NULL);
1273         CHECK_RETURN("connection_profile_get_ethernet_eap_peap_version", ret, CONNECTION_ERROR_INVALID_PARAMETER);
1274
1275         return 0;
1276 }
1277