change system header file from dd-system to dd-deviced
[platform/core/system/system-server.git] / src / shared / TC / unit / utc_SystemFW_system_conf_set_vip_func.c
1 #include <tet_api.h>
2 #include <dd-deviced.h>
3
4 static void startup(void);
5 static void cleanup(void);
6
7 void (*tet_startup)(void) = startup;
8 void (*tet_cleanup)(void) = cleanup;
9
10 static void utc_SystemFW_deviced_conf_set_vip_func_01(void);
11 static void utc_SystemFW_deviced_conf_set_vip_func_02(void);
12
13 enum {
14         POSITIVE_TC_IDX = 0x01,
15         NEGATIVE_TC_IDX,
16 };
17
18 struct tet_testlist tet_testlist[] = {
19         { utc_SystemFW_deviced_conf_set_vip_func_01, POSITIVE_TC_IDX },
20         { utc_SystemFW_deviced_conf_set_vip_func_02, NEGATIVE_TC_IDX },
21         { NULL, 0 },
22 };
23
24 static void startup(void)
25 {
26         system("mv /usr/bin/restarter /usr/bin/restarter1");
27 }
28
29 static void cleanup(void)
30 {
31 }
32
33 /**
34  * @brief Positive test case of deviced_conf_set_vip()
35  */
36 static void utc_SystemFW_deviced_conf_set_vip_func_01(void)
37 {
38         int ret_val = 0;
39         int pid = getpid();
40
41         ret_val = deviced_conf_set_vip(pid);
42         if(ret_val < 0) {
43                 tet_infoline("deviced_conf_set_vip() failed in positive test case");
44                 tet_result(TET_FAIL);
45                 return;
46         }
47         tet_result(TET_PASS);
48 }
49
50 /**
51  * @brief Negative test case of ug_init deviced_conf_set_vip()
52  */
53 static void utc_SystemFW_deviced_conf_set_vip_func_02(void)
54 {
55         int r = 0;
56
57         r = deviced_conf_set_vip(-1);
58
59         if (r>=0) {
60                 tet_infoline("deviced_conf_set_vip() failed in negative test case");
61                 tet_result(TET_FAIL);
62                 return;
63         }
64         tet_result(TET_PASS);
65 }