3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 #include <sync_agent.h>
23 POSITIVE_TC_IDX = 0x01,
27 static void startup(void);
28 static void cleanup(void);
30 void (*tet_startup) (void) = startup;
31 void (*tet_cleanup) (void) = cleanup;
33 #define TEST_FW_CONFIG_FILE "../../../testcase/fw-test-cfg/test_fw_config.xml"
35 #define API_NAME_SYNC_START_UP "startup"
37 #define API_NAME_SYNC_AGENT_EXECUTE_DEV_FUNCTION "sync_agent_execute_dev_function"
38 #define API_NAME_SYNC_AGENT_GET_DEVINFO "sync_agent_get_devinfo"
40 ////////////////////////////////////////executor.h//////////////////////////////////////////////
42 static void utc_sync_agent_framework_sync_agent_execute_dev_function_p(void);
43 static void utc_sync_agent_framework_sync_agent_execute_dev_function_n(void);
45 ////////////////////////////////////////information.h//////////////////////////////////////////////
47 static void utc_sync_agent_framework_sync_agent_get_devinfo_p(void);
48 static void utc_sync_agent_framework_sync_agent_get_devinfo_n(void);
50 struct tet_testlist tet_testlist[] = {
51 {utc_sync_agent_framework_sync_agent_execute_dev_function_p, POSITIVE_TC_IDX},
52 {utc_sync_agent_framework_sync_agent_execute_dev_function_n, NEGATIVE_TC_IDX},
53 {utc_sync_agent_framework_sync_agent_get_devinfo_p, POSITIVE_TC_IDX},
54 {utc_sync_agent_framework_sync_agent_get_devinfo_n, NEGATIVE_TC_IDX},
58 static void startup(void)
61 sync_agent_init_error_e init_error = sync_agent_init(TEST_FW_CONFIG_FILE);
62 if (init_error != SYNC_AGENT_INIT_SUCCESS) {
63 dts_message(API_NAME_SYNC_START_UP, "sync_agent_init : %d", init_error);
64 dts_fail(API_NAME_SYNC_START_UP);
66 dts_pass(API_NAME_SYNC_START_UP);
70 static void cleanup(void)
75 static void utc_sync_agent_framework_sync_agent_execute_dev_function_p(void)
77 sync_agent_dev_return_e err = SYNC_AGENT_DEV_RETURN_SUCCESS;
78 char *api_name = API_NAME_SYNC_AGENT_EXECUTE_DEV_FUNCTION;
80 char *function_name = NULL;
82 function_name = "fota_flag";
84 err = sync_agent_execute_dev_function(2, function_name, 1, memory_type);
85 if (err != SYNC_AGENT_DEV_RETURN_SUCCESS) {
86 dts_message(api_name, "sync_agent_execute_dev_function : %d", err);
93 static void utc_sync_agent_framework_sync_agent_execute_dev_function_n(void)
95 sync_agent_dev_return_e err = SYNC_AGENT_DEV_RETURN_SUCCESS;
96 char *api_name = API_NAME_SYNC_AGENT_EXECUTE_DEV_FUNCTION;
98 char *function_name = NULL;
100 err = sync_agent_execute_dev_function(2, function_name, 1, memory_type);
101 if (err != SYNC_AGENT_DEV_RETURN_SUCCESS) {
104 dts_message(api_name, "sync_agent_execute_dev_function : %d", err);
109 static void utc_sync_agent_framework_sync_agent_get_devinfo_p(void)
111 sync_agent_dev_return_e err = SYNC_AGENT_DEV_RETURN_SUCCESS;
112 char *api_name = API_NAME_SYNC_AGENT_GET_DEVINFO;
114 int device_plugin_id = 0;
115 char *info_name = NULL;
118 device_plugin_id = 2;
119 info_name = "FOTADownDir";
121 err = sync_agent_get_devinfo(device_plugin_id, info_name, &value);
122 if (err != SYNC_AGENT_DEV_RETURN_SUCCESS) {
123 dts_message(api_name, "sync_agent_get_devinfo : %d", err);
130 static void utc_sync_agent_framework_sync_agent_get_devinfo_n(void)
132 sync_agent_dev_return_e err = SYNC_AGENT_ACC_SUCCESS;
133 char *api_name = API_NAME_SYNC_AGENT_GET_DEVINFO;
135 int device_plugin_id = 0;
136 char *info_name = NULL;
139 device_plugin_id = 2;
141 err = sync_agent_get_devinfo(device_plugin_id, info_name, &value);
142 if (err != SYNC_AGENT_DEV_RETURN_SUCCESS) {
145 dts_message(api_name, "sync_agent_get_devinfo : %d", err);