# libdeviced
SET(DEVICED_SRCS
src/shared/battery.c
+ src/shared/deviced-conf.c
+ src/shared/deviced-noti.c
+ src/shared/deviced-util.c
src/shared/display.c
src/shared/haptic.c
src/shared/led.c
- src/shared/system-conf.c
- src/shared/system-noti.c
- src/shared/system-util.c
)
SET(DEVICED_HEADERS
src/deviced/dd-battery.h
+ src/deviced/dd-deviced.h
+ src/deviced/dd-deviced-managed.h
src/deviced/dd-display.h
src/deviced/dd-haptic.h
src/deviced/dd-led.h
- src/deviced/dd-system.h
- src/deviced/dd-system-managed.h
src/deviced/haptic-module.h
src/deviced/haptic-plugin-intf.h
)
%files -n libdeviced-devel
%defattr(-,root,root,-)
%{_includedir}/deviced/dd-battery.h
+%{_includedir}/deviced/dd-deviced.h
+%{_includedir}/deviced/dd-deviced-managed.h
%{_includedir}/deviced/dd-display.h
%{_includedir}/deviced/dd-haptic.h
%{_includedir}/deviced/dd-led.h
-%{_includedir}/deviced/dd-system.h
-%{_includedir}/deviced/dd-system-managed.h
%{_includedir}/deviced/haptic-module.h
%{_includedir}/deviced/haptic-plugin-intf.h
%{_libdir}/libdeviced.so
*/
-#ifndef __DD_SYSTEM_MANAGED__
-#define __DD_SYSTEM_MANAGED__
+#ifndef __DD_DEVICED_MANAGED__
+#define __DD_DEVICED_MANAGED__
#include <sys/time.h>
/**
- * @file dd-system-managed.h
- * @ingroup libdeviced System Native library
+ * @file dd-deviced-managed.h
+ * @ingroup libdeviced Device Daemon library
* @brief This library provides APIs related with memory, performance, processes, and so on.
* @author SLP2.0
* @date 2010-01-24
#endif
/**
- * @fn int system_get_pid(const char *execpath)
+ * @fn int deviced_get_pid(const char *execpath)
* @brief This API is used to get the pid of the process which has the specified execpath.\n
* Internally, this API searches /proc/{pid}/cmdline and compares the parameter execpath with 1st argument of cmdline. \n
* If there is no process that has same execpath in /proc/{pid}/cmdline, it will return -1.
* @param[in] execpath program path which you want to know whether it is run or not
* @return pid when the program is running, -1 if it is not.
*/
-int system_get_pid(const char *execpath);
+int deviced_get_pid(const char *execpath);
/**
- * @fn int system_set_datetime(time_t timet)
+ * @fn int deviced_set_datetime(time_t timet)
* @brief This API is used to set date time.\n
* Internally, this API call predefined action API. That is send a notify message. \n
* @param[in] time_t type of time which you want to set.
* @return pid when the program is running, -1 if param is less than 0 or when failed set datetime.
*/
-int system_set_datetime(time_t timet);
+int deviced_set_datetime(time_t timet);
/**
* @brief This structure defines the data for receive result of mmc operations(mount/unmount/format)
};
/**
- * @fn int system_request_mount_mmc(struct system_mmc_contents *mmc_data)
+ * @fn int deviced_request_mount_mmc(struct deviced_mmc_contents *mmc_data)
* @brief This API is used to mount mmc.\n
* Internally, this API call predefined action API. That is send a notify message. \n
- * and when mount operation is finished, cb of system_mmc_content struct is called with cb's param1(result). \n
+ * and when mount operation is finished, cb of deviced_mmc_content struct is called with cb's param1(result). \n
* means of param1 - 0(mount success) , -2(already mounted), non-zero except (-2) (mount fail) \n
* [mount fail value] \n
* 1 : operation not permmitted \n
* @param[in] mmc_data for receive result of mount operation
* @return non-zero on success message sending, -1 if message sending is failed.
*/
-int system_request_mount_mmc(struct mmc_contents *mmc_data);
+int deviced_request_mount_mmc(struct mmc_contents *mmc_data);
/**
- * @fn int system_request_unmount_mmc(struct system_mmc_contents *mmc_data,int option)
+ * @fn int deviced_request_unmount_mmc(struct deviced_mmc_contents *mmc_data,int option)
* @brief This API is used to unmount mmc.\n
* Internally, this API call predefined action API. That is send a notify message. \n
- * and when unmount opeation is finished, cb of system_mmc_content struct is called with cb's param1(result). \n
+ * and when unmount opeation is finished, cb of deviced_mmc_content struct is called with cb's param1(result). \n
* means of param1 - 0(unmount success) , non-zero(unmount fail) \n
* [unmount fail value] \n
* 1 : operation not permmitted \n
* @param[in] option is must be 1(just only support for force unmount)
* @return non-zero on success message sending, -1 if message sending is failed.
*/
-int system_request_unmount_mmc(struct mmc_contents *mmc_data, int option);
+int deviced_request_unmount_mmc(struct mmc_contents *mmc_data, int option);
/**
- * @fn int system_request_format_mmc(struct system_mmc_contents *mmc_data)
+ * @fn int deviced_request_format_mmc(struct deviced_mmc_contents *mmc_data)
* @brief This API is used to format mmc.\n
* Internally, this API call predefined action API. That is send a notify message. \n
- * and when format opeation is finished, cb of system_mmc_content struct is called with cb's param1(result). \n
+ * and when format opeation is finished, cb of deviced_mmc_content struct is called with cb's param1(result). \n
* means of param1 - 0(format success) , -1(format fail)
* @param[in] mmc_data for receive result of format operation
* @return non-zero on success message sending, -1 if message sending is failed.
*/
-int system_request_format_mmc(struct mmc_contents *mmc_data);
+int deviced_request_format_mmc(struct mmc_contents *mmc_data);
#ifdef __cplusplus
}
#endif
-#endif /* __DD_SYSTEM_MANAGED__ */
+#endif /* __DD_DEVICED_MANAGED__ */
*/
-#ifndef __DD_SYSTEM__
-#define __DD_SYSTEM__
+#ifndef __DD_DEVICED__
+#define __DD_DEVICED__
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
-#include "dd-system-managed.h"
+#include "dd-deviced-managed.h"
#ifndef DEPRECATED
#define DEPRECATED __attribute__((deprecated))
#endif
/**
- * @file dd-system.h
- * @ingroup libdeviced System Manager library
+ * @file dd-deviced.h
+ * @ingroup libdeviced Deviced Daemon library
* @brief This library provides APIs related with memory, performance, processes, and so on.
* @author SLP2.0
* @date 2010-01-24
*/
/**
- * @defgroup libdeviced System Manager library
- * @ingroup SYSTEM_FRAMEWORK
+ * @defgroup libdeviced Deviced Daemon library
+ * @ingroup deviced_FRAMEWORK
* @brief System manager library
*
* This library provides APIs related with memory, performance, processes, and so on.
* <br> Please use libslp-system-dev debian package and dd-deviced.pc file for development.
- * <br> And include dd-system.h file at your source codes as following.
- * @addtogroup libdeviced System Manager library
+ * <br> And include dd-deviced.h file at your source codes as following.
+ * @addtogroup libdeviced Deviced Daemon library
* @{
*/
OOM_IGNORE /**< For daemons */
};
-/* system_util */
+/* deviced_util */
/**
- * @fn int system_get_cmdline_name(pid_t pid, char *cmdline, size_t cmdline_size)
+ * @fn int deviced_get_cmdline_name(pid_t pid, char *cmdline, size_t cmdline_size)
* @brief This API is used to get the file name of command line of the process from the proc fs.
* Caller process MUST allocate enough memory for the cmdline parameter. \n
* Its size should be assigned to cmdline_size. \n
* @return 0 on success, -1 if failed. If the size of cmdline is smaller than the result,
* it will return -1 and errno will be set as EOVERFLOW.
*/
-int system_get_cmdline_name(pid_t pid, char *cmdline,
+int deviced_get_cmdline_name(pid_t pid, char *cmdline,
size_t cmdline_size);
/**
- * @fn char *system_get_apppath(pid_t pid, char *app_path, size_t app_path_size)
+ * @fn char *deviced_get_apppath(pid_t pid, char *app_path, size_t app_path_size)
* @brief This API is used to get the execution path of the process specified by the pid parameter.\n
* Caller process MUST allocate enough memory for the app_path parameter. \n
* Its size should be assigned to app_path_size. \n
* @return 0 on success, -1 if failed. If the size of app_path is smaller than the result,
* it will return -1 and errno will be set as EOVERFLOW.
*/
-int system_get_apppath(pid_t pid, char *app_path, size_t app_path_size);
+int deviced_get_apppath(pid_t pid, char *app_path, size_t app_path_size);
/* sysconf */
/**
- * @fn int system_conf_set_mempolicy(enum mem_policy mempol)
+ * @fn int deviced_conf_set_mempolicy(enum mem_policy mempol)
* @brief This API is used to set the policy of the caller process when the phone has low available memory.
* @param[in] mempol oom adjust value which you want to set
* @return 0 on success, -1 if failed.
- * @see system_conf_set_mempolicy_bypid()
+ * @see deviced_conf_set_mempolicy_bypid()
*/
-int system_conf_set_mempolicy(enum mem_policy mempol);
+int deviced_conf_set_mempolicy(enum mem_policy mempol);
/**
- * @fn int system_conf_set_mempolicy_bypid(pid_t pid, enum mem_policy mempol)
+ * @fn int deviced_conf_set_mempolicy_bypid(pid_t pid, enum mem_policy mempol)
* @brief This API is used to set the policy of the process when the phone has low available memory.
* @param[in] pid process id which you want to set
* @param[in] mempol oom adjust value which you want to set
* @return 0 on success, -1 if failed.
*/
-int system_conf_set_mempolicy_bypid(pid_t pid, enum mem_policy mempol);
+int deviced_conf_set_mempolicy_bypid(pid_t pid, enum mem_policy mempol);
/**
- * @fn int system_conf_set_permanent(void)
+ * @fn int deviced_conf_set_permanent(void)
* @brief This API is used to set itself as a permanent process.\n
* If the permanent process is dead, system server will relaunch the process automatically.
* @return 0 on success, -1 if failed.
- * @see system_conf_set_permanent_bypid()
+ * @see deviced_conf_set_permanent_bypid()
* @par Example
* @code
* ...
- * ret = system_conf_set_permanent();
+ * ret = deviced_conf_set_permanent();
* if( ret < 0 )
* printf("Fail to set a process as permanent\n");
* ...
* @endcode
*/
-int system_conf_set_permanent(void);
+int deviced_conf_set_permanent(void);
/**
- * @fn int system_conf_set_permanent_bypid(pid_t pid)
+ * @fn int deviced_conf_set_permanent_bypid(pid_t pid)
* @brief This API is used to set a process which has pid as a permanent process.\n
* If the permanent process is dead, system server will relaunch the process automatically.
* @return 0 on success, -1 if failed.
* @par Example
* @code
* ...
- * ret = system_conf_set_permanent_bypid(pid);
+ * ret = deviced_conf_set_permanent_bypid(pid);
* if( ret < 0 )
* printf("Fail to set a process(%d) as permanent\n",pid);
* ...
* @endcode
*/
-int system_conf_set_permanent_bypid(pid_t pid);
+int deviced_conf_set_permanent_bypid(pid_t pid);
/**
- * @fn int system_conf_set_vip(pid_t pid)
+ * @fn int deviced_conf_set_vip(pid_t pid)
* @brief This API is used to set a process which has pid as Very Important Process(VIP) .\n
* If the VIP process is dead, restarter program will be run. \n
* Restarter program may kill almost processes and run rc.local scripts again.
* @par Example
* @code
* ...
- * ret = system_conf_set_vip(pid);
+ * ret = deviced_conf_set_vip(pid);
* if( ret < 0 )
* printf("Fail to set a process(%d) as VIP\n",pid);
* ...
* @endcode
*/
-int system_conf_set_vip(pid_t pid);
+int deviced_conf_set_vip(pid_t pid);
/**
- * @fn int system_conf_is_vip(pid_t pid)
+ * @fn int deviced_conf_is_vip(pid_t pid)
* @brief This API is used to verify that process which has pid is Very Important Process(VIP) or not.
* @param[in] pid process id to be vip
* @return 1 on success, 0 if failed.
- * @see system_conf_set_vip
+ * @see deviced_conf_set_vip
* @par Example
* @code
* ...
- * ret = system_conf_is_vip(pid);
+ * ret = deviced_conf_is_vip(pid);
* if(ret)
* printf("process(%d) is Very Important Process\n",pid);
* ...
* @endcode
*/
-int system_conf_is_vip(pid_t pid);
+int deviced_conf_is_vip(pid_t pid);
-int system_set_timezone(char *tzpath_str);
+int deviced_set_timezone(char *tzpath_str);
-int system_call_predef_action(const char *type, int num, ...);
+int deviced_call_predef_action(const char *type, int num, ...);
-int system_inform_foregrd(void);
-int system_inform_backgrd(void);
-int system_inform_active(pid_t pid);
-int system_inform_inactive(pid_t pid);
+int deviced_inform_foregrd(void);
+int deviced_inform_backgrd(void);
+int deviced_inform_active(pid_t pid);
+int deviced_inform_inactive(pid_t pid);
-int system_request_poweroff(void);
-int system_request_entersleep(void);
-int system_request_leavesleep(void);
-int system_request_reboot(void);
+int deviced_request_poweroff(void);
+int deviced_request_entersleep(void);
+int deviced_request_leavesleep(void);
+int deviced_request_reboot(void);
-int system_request_set_cpu_max_frequency(int val);
-int system_request_set_cpu_min_frequency(int val);
+int deviced_request_set_cpu_max_frequency(int val);
+int deviced_request_set_cpu_min_frequency(int val);
-int system_release_cpu_max_frequency(void);
-int system_release_cpu_min_frequency(void);
+int deviced_release_cpu_max_frequency(void);
+int deviced_release_cpu_min_frequency(void);
/**
* @}
#ifdef __cplusplus
}
#endif
-#endif /* __DD_SYSTEM__ */
+#endif /* __DD_DEVICED__ */
CC ?= gcc
-TARGETS = utc_SystemFW_sysconf_is_vip_func \
- utc_SystemFW_sysconf_set_mempolicy_bypid_func \
- utc_SystemFW_sysconf_set_mempolicy_func \
- utc_SystemFW_sysconf_set_permanent_bypid_func \
- utc_SystemFW_sysconf_set_permanent_func \
- utc_SystemFW_sysconf_set_vip_func \
- utc_SystemFW_sysman_get_apppath_func \
- utc_SystemFW_sysman_get_cmdline_name_func \
- utc_SystemFW_sysman_get_pid_func \
- utc_SystemFW_sysman_set_datetime_func \
+TARGETS = utc_SystemFW_system_conf_is_vip_func \
+ utc_SystemFW_system_conf_set_mempolicy_bypid_func \
+ utc_SystemFW_system_conf_set_mempolicy_func \
+ utc_SystemFW_system_conf_set_permanent_bypid_func \
+ utc_SystemFW_system_conf_set_permanent_func \
+ utc_SystemFW_system_conf_set_vip_func \
+ utc_SystemFW_system_get_apppath_func \
+ utc_SystemFW_system_get_cmdline_name_func \
+ utc_SystemFW_system_get_pid_func \
+ utc_SystemFW_system_set_datetime_func \
-PKGS = sysman
+PKGS = deviced
LDFLAGS = `pkg-config --libs $(PKGS)`
LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
-/unit/utc_SystemFW_sysconf_is_vip_func
-/unit/utc_SystemFW_sysconf_set_permanent_bypid_func
-/unit/utc_SystemFW_sysconf_set_permanent_func
-/unit/utc_SystemFW_sysman_get_apppath_func
-/unit/utc_SystemFW_sysman_get_cmdline_name_func
-/unit/utc_SystemFW_sysman_get_pid_func
-/unit/utc_SystemFW_sysman_set_datetime_func
+/unit/utc_SystemFW_system_conf_is_vip_func
+/unit/utc_SystemFW_system_conf_set_permanent_bypid_func
+/unit/utc_SystemFW_system_conf_set_permanent_func
+/unit/utc_SystemFW_system_get_apppath_func
+/unit/utc_SystemFW_system_get_cmdline_name_func
+/unit/utc_SystemFW_system_get_pid_func
+/unit/utc_SystemFW_system_set_datetime_func
int r = 0;
/*
- r = @API@(...);
+ r = @API@(...);
*/
if (r) {
tet_infoline("@API@() failed in positive test case");
int r = 0;
/*
- r = @API@(...);
+ r = @API@(...);
*/
if (r) {
tet_infoline("@API@() failed in negative test case");
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysconf_is_vip_func_01(void);
-static void utc_SystemFW_sysconf_is_vip_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysconf_is_vip_func_01, POSITIVE_TC_IDX },
- { utc_SystemFW_sysconf_is_vip_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysconf_is_vip()
- */
-static void utc_SystemFW_sysconf_is_vip_func_01(void)
-{
- int ret_val = 0;
- int pid = getpid();
-
- ret_val = sysconf_is_vip(pid);
- if(ret_val < 0) {
- tet_infoline("sysconf_is_vip() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysconf_is_vip()
- */
-static void utc_SystemFW_sysconf_is_vip_func_02(void)
-{
- int r = 0;
-
- r = sysconf_is_vip(-1);
-
- if (r>=0) {
- tet_infoline("sysconf_is_vip() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysconf_set_mempolicy_bypid_func_01(void);
-static void utc_SystemFW_sysconf_set_mempolicy_bypid_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysconf_set_mempolicy_bypid_func_01, POSITIVE_TC_IDX },
- { utc_SystemFW_sysconf_set_mempolicy_bypid_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysconf_set_mempolicy_bypid()
- */
-static void utc_SystemFW_sysconf_set_mempolicy_bypid_func_01(void)
-{
- int ret_val = 0;
- int pid = getpid();
- int mempol = OOM_NORMAL;
-
- ret_val = sysconf_set_mempolicy_bypid(pid, mempol);
- if(ret_val < 0) {
- tet_infoline("sysconf_set_mempolicy_bypid() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysconf_set_mempolicy_bypid()
- */
-static void utc_SystemFW_sysconf_set_mempolicy_bypid_func_02(void)
-{
- int r = 0;
- int mempol = OOM_NORMAL;
-
- r = sysconf_set_mempolicy_bypid(-1, mempol);
-
- if (r>=0) {
- tet_infoline("sysconf_set_mempolicy_bypid() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysconf_set_mempolicy_func_01(void);
-static void utc_SystemFW_sysconf_set_mempolicy_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysconf_set_mempolicy_func_01, POSITIVE_TC_IDX },
- { utc_SystemFW_sysconf_set_mempolicy_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysconf_set_mempolicy()
- */
-static void utc_SystemFW_sysconf_set_mempolicy_func_01(void)
-{
- int ret_val = 0;
- int mempol = OOM_NORMAL;
-
- ret_val = sysconf_set_mempolicy(mempol);
- if(ret_val < 0) {
- tet_infoline("sysconf_set_mempolicy() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysconf_set_mempolicy()
- */
-static void utc_SystemFW_sysconf_set_mempolicy_func_02(void)
-{
- int r = 0;
-
- r = sysconf_set_mempolicy(-1);
-
- if (r>=0) {
- tet_infoline("sysconf_set_mempolicy() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysconf_set_permanent_bypid_func_01(void);
-static void utc_SystemFW_sysconf_set_permanent_bypid_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysconf_set_permanent_bypid_func_01, POSITIVE_TC_IDX },
- { utc_SystemFW_sysconf_set_permanent_bypid_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysconf_set_permanent_bypid()
- */
-static void utc_SystemFW_sysconf_set_permanent_bypid_func_01(void)
-{
- int ret_val = 0;
- int pid = getpid();
-
- ret_val = sysconf_set_permanent_bypid(pid);
- if(ret_val < 0) {
- tet_infoline("sysconf_set_permanent_bypid() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysconf_set_permanent_bypid()
- */
-static void utc_SystemFW_sysconf_set_permanent_bypid_func_02(void)
-{
- int r = 0;
-
- r = sysconf_set_permanent_bypid(-1);
-
- if (r>=0) {
- tet_infoline("sysconf_set_permanent_bypid() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysconf_set_permanent_func_01(void);
-//static void utc_SystemFW_sysconf_set_permanent_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysconf_set_permanent_func_01, POSITIVE_TC_IDX },
-// { utc_SystemFW_sysconf_set_permanent_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysconf_set_permanent()
- */
-static void utc_SystemFW_sysconf_set_permanent_func_01(void)
-{
-
- int r = 0;
-
- r = sysconf_set_permanent();
-
- if (r<0) {
- tet_infoline("sysconf_set_permanent() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysconf_set_permanent()
-
-static void utc_SystemFW_sysconf_set_permanent_func_02(void)
-{
- int r = 0;
-
- r = sysconf_set_permanent();
-
- if (r>=0) {
- tet_infoline("sysconf_set_permanent() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}*/
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysconf_set_vip_func_01(void);
-static void utc_SystemFW_sysconf_set_vip_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysconf_set_vip_func_01, POSITIVE_TC_IDX },
- { utc_SystemFW_sysconf_set_vip_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
- system("mv /usr/bin/restarter /usr/bin/restarter1");
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysconf_set_vip()
- */
-static void utc_SystemFW_sysconf_set_vip_func_01(void)
-{
- int ret_val = 0;
- int pid = getpid();
-
- ret_val = sysconf_set_vip(pid);
- if(ret_val < 0) {
- tet_infoline("sysconf_set_vip() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysconf_set_vip()
- */
-static void utc_SystemFW_sysconf_set_vip_func_02(void)
-{
- int r = 0;
-
- r = sysconf_set_vip(-1);
-
- if (r>=0) {
- tet_infoline("sysconf_set_vip() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysman_get_apppath_func_01(void);
-static void utc_SystemFW_sysman_get_apppath_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysman_get_apppath_func_01, POSITIVE_TC_IDX },
- { utc_SystemFW_sysman_get_apppath_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysman_get_apppath()
- */
-static void utc_SystemFW_sysman_get_apppath_func_01(void)
-{
- int ret_val = 0;
- char* app_path[255] = {'\0',};
-
- ret_val = sysman_get_apppath(1, app_path, 100);
- if(ret_val <0) {
- tet_infoline("sysman_get_apppath() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysman_get_apppath()
- */
-static void utc_SystemFW_sysman_get_apppath_func_02(void)
-{
- int ret_val = 0;
- char* app_path[255] = {'\0',};
-
- int pid = -1;
-
- ret_val = sysman_get_apppath(pid, app_path, 100);
- if(ret_val >= 0) {
- tet_infoline("sysman_get_apppath() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysman_get_cmdline_name_func_01(void);
-static void utc_SystemFW_sysman_get_cmdline_name_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysman_get_cmdline_name_func_01, POSITIVE_TC_IDX },
- { utc_SystemFW_sysman_get_cmdline_name_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysman_get_cmdline_name()
- */
-static void utc_SystemFW_sysman_get_cmdline_name_func_01(void)
-{
- char name[50]={'\0',};
- int ret_val = 0;
-
- ret_val = sysman_get_cmdline_name(1,name,50);
- if(ret_val < 0) {
- tet_infoline("sysman_get_cmdline_name() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysman_get_cmdline_name()
- */
-static void utc_SystemFW_sysman_get_cmdline_name_func_02(void)
-{
- char name[50]={'\0',};
- int ret_val = 0;
-
- ret_val = sysman_get_cmdline_name(-1,name,50);
- if(ret_val >= 0) {
- tet_infoline("sysman_get_cmdline_name() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysman_get_pid_func_01(void);
-static void utc_SystemFW_sysman_get_pid_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysman_get_pid_func_01, POSITIVE_TC_IDX },
- { utc_SystemFW_sysman_get_pid_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysman_get_pid()
- */
-static void utc_SystemFW_sysman_get_pid_func_01(void)
-{
- int ret_val = 0;
- char* execpath = "init";
-
- ret_val = sysman_get_pid(execpath);
- if(ret_val < 0) {
- tet_infoline("sysman_get_pid() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysman_get_pid()
- */
-static void utc_SystemFW_sysman_get_pid_func_02(void)
-{
- int ret_val = 0;
- char* execpath = "xxxyyyzzz";
-
- ret_val = sysman_get_pid(execpath);
- if(ret_val >= 0) {
- tet_infoline("sysman_get_pid() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
+++ /dev/null
-#include <tet_api.h>
-#include <sysman.h>
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-static void utc_SystemFW_sysman_set_datetime_func_01(void);
-static void utc_SystemFW_sysman_set_datetime_func_02(void);
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-struct tet_testlist tet_testlist[] = {
- { utc_SystemFW_sysman_set_datetime_func_01, POSITIVE_TC_IDX },
- { utc_SystemFW_sysman_set_datetime_func_02, NEGATIVE_TC_IDX },
- { NULL, 0 },
-};
-
-static void startup(void)
-{
-}
-
-static void cleanup(void)
-{
-}
-
-/**
- * @brief Positive test case of sysman_set_datetime()
- */
-static void utc_SystemFW_sysman_set_datetime_func_01(void)
-{
- int ret_val = 0;
- time_t timet = time(NULL);
-
- ret_val = sysman_set_datetime(timet);
- if(ret_val < 0) {
- tet_infoline("sysman_set_datetime() failed in positive test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
-
-/**
- * @brief Negative test case of ug_init sysman_set_datetime()
- */
-static void utc_SystemFW_sysman_set_datetime_func_02(void)
-{
- int r = 0;
-
- r = sysman_set_datetime(NULL);
-
- if (r>=0) {
- tet_infoline("sysman_set_datetime() failed in negative test case");
- tet_result(TET_FAIL);
- return;
- }
- tet_result(TET_PASS);
-}
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_conf_is_vip_func_01(void);
+static void utc_SystemFW_deviced_conf_is_vip_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_conf_is_vip_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_deviced_conf_is_vip_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_conf_is_vip()
+ */
+static void utc_SystemFW_deviced_conf_is_vip_func_01(void)
+{
+ int ret_val = 0;
+ int pid = getpid();
+
+ ret_val = deviced_conf_is_vip(pid);
+ if(ret_val < 0) {
+ tet_infoline("deviced_conf_is_vip() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_conf_is_vip()
+ */
+static void utc_SystemFW_deviced_conf_is_vip_func_02(void)
+{
+ int r = 0;
+
+ r = deviced_conf_is_vip(-1);
+
+ if (r>=0) {
+ tet_infoline("deviced_conf_is_vip() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_conf_set_mempolicy_bypid_func_01(void);
+static void utc_SystemFW_deviced_conf_set_mempolicy_bypid_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_conf_set_mempolicy_bypid_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_deviced_conf_set_mempolicy_bypid_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_conf_set_mempolicy_bypid()
+ */
+static void utc_SystemFW_deviced_conf_set_mempolicy_bypid_func_01(void)
+{
+ int ret_val = 0;
+ int pid = getpid();
+ int mempol = OOM_NORMAL;
+
+ ret_val = deviced_conf_set_mempolicy_bypid(pid, mempol);
+ if(ret_val < 0) {
+ tet_infoline("deviced_conf_set_mempolicy_bypid() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_conf_set_mempolicy_bypid()
+ */
+static void utc_SystemFW_deviced_conf_set_mempolicy_bypid_func_02(void)
+{
+ int r = 0;
+ int mempol = OOM_NORMAL;
+
+ r = deviced_conf_set_mempolicy_bypid(-1, mempol);
+
+ if (r>=0) {
+ tet_infoline("deviced_conf_set_mempolicy_bypid() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_conf_set_mempolicy_func_01(void);
+static void utc_SystemFW_deviced_conf_set_mempolicy_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_conf_set_mempolicy_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_deviced_conf_set_mempolicy_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_conf_set_mempolicy()
+ */
+static void utc_SystemFW_deviced_conf_set_mempolicy_func_01(void)
+{
+ int ret_val = 0;
+ int mempol = OOM_NORMAL;
+
+ ret_val = deviced_conf_set_mempolicy(mempol);
+ if(ret_val < 0) {
+ tet_infoline("sysconf_set_mempolicy() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_conf_set_mempolicy()
+ */
+static void utc_SystemFW_deviced_conf_set_mempolicy_func_02(void)
+{
+ int r = 0;
+
+ r = deviced_conf_set_mempolicy(-1);
+
+ if (r>=0) {
+ tet_infoline("deviced_conf_set_mempolicy() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_conf_set_permanent_bypid_func_01(void);
+static void utc_SystemFW_deviced_conf_set_permanent_bypid_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_conf_set_permanent_bypid_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_deviced_conf_set_permanent_bypid_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_conf_set_permanent_bypid()
+ */
+static void utc_SystemFW_deviced_conf_set_permanent_bypid_func_01(void)
+{
+ int ret_val = 0;
+ int pid = getpid();
+
+ ret_val = deviced_conf_set_permanent_bypid(pid);
+ if(ret_val < 0) {
+ tet_infoline("deviced_conf_set_permanent_bypid() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_conf_set_permanent_bypid()
+ */
+static void utc_SystemFW_deviced_conf_set_permanent_bypid_func_02(void)
+{
+ int r = 0;
+
+ r = deviced_conf_set_permanent_bypid(-1);
+
+ if (r>=0) {
+ tet_infoline("deviced_conf_set_permanent_bypid() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_conf_set_permanent_func_01(void);
+//static void utc_SystemFW_deviced_conf_set_permanent_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_conf_set_permanent_func_01, POSITIVE_TC_IDX },
+// { utc_SystemFW_deviced_conf_set_permanent_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_conf_set_permanent()
+ */
+static void utc_SystemFW_deviced_conf_set_permanent_func_01(void)
+{
+
+ int r = 0;
+
+ r = deviced_conf_set_permanent();
+
+ if (r<0) {
+ tet_infoline("deviced_conf_set_permanent() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_conf_set_permanent()
+
+static void utc_SystemFW_deviced_conf_set_permanent_func_02(void)
+{
+ int r = 0;
+
+ r = deviced_conf_set_permanent();
+
+ if (r>=0) {
+ tet_infoline("deviced_conf_set_permanent() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}*/
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_conf_set_vip_func_01(void);
+static void utc_SystemFW_deviced_conf_set_vip_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_conf_set_vip_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_deviced_conf_set_vip_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+ system("mv /usr/bin/restarter /usr/bin/restarter1");
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_conf_set_vip()
+ */
+static void utc_SystemFW_deviced_conf_set_vip_func_01(void)
+{
+ int ret_val = 0;
+ int pid = getpid();
+
+ ret_val = deviced_conf_set_vip(pid);
+ if(ret_val < 0) {
+ tet_infoline("deviced_conf_set_vip() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_conf_set_vip()
+ */
+static void utc_SystemFW_deviced_conf_set_vip_func_02(void)
+{
+ int r = 0;
+
+ r = deviced_conf_set_vip(-1);
+
+ if (r>=0) {
+ tet_infoline("deviced_conf_set_vip() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_get_apppath_func_01(void);
+static void utc_SystemFW_deviced_get_apppath_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_get_apppath_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_deviced_get_apppath_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_get_apppath()
+ */
+static void utc_SystemFW_deviced_get_apppath_func_01(void)
+{
+ int ret_val = 0;
+ char* app_path[255] = {'\0',};
+
+ ret_val = deviced_get_apppath(1, app_path, 100);
+ if(ret_val <0) {
+ tet_infoline("deviced_get_apppath() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_get_apppath()
+ */
+static void utc_SystemFW_deviced_get_apppath_func_02(void)
+{
+ int ret_val = 0;
+ char* app_path[255] = {'\0',};
+
+ int pid = -1;
+
+ ret_val = deviced_get_apppath(pid, app_path, 100);
+ if(ret_val >= 0) {
+ tet_infoline("deviced_get_apppath() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_get_cmdline_name_func_01(void);
+static void utc_SystemFW_deviced_get_cmdline_name_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_get_cmdline_name_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_deviced_get_cmdline_name_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_get_cmdline_name()
+ */
+static void utc_SystemFW_deviced_get_cmdline_name_func_01(void)
+{
+ char name[50]={'\0',};
+ int ret_val = 0;
+
+ ret_val = deviced_get_cmdline_name(1,name,50);
+ if(ret_val < 0) {
+ tet_infoline("deviced_get_cmdline_name() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_get_cmdline_name()
+ */
+static void utc_SystemFW_deviced_get_cmdline_name_func_02(void)
+{
+ char name[50]={'\0',};
+ int ret_val = 0;
+
+ ret_val = deviced_get_cmdline_name(-1,name,50);
+ if(ret_val >= 0) {
+ tet_infoline("deviced_get_cmdline_name() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_get_pid_func_01(void);
+static void utc_SystemFW_deviced_get_pid_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_get_pid_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_deviced_get_pid_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_get_pid()
+ */
+static void utc_SystemFW_deviced_get_pid_func_01(void)
+{
+ int ret_val = 0;
+ char* execpath = "init";
+
+ ret_val = deviced_get_pid(execpath);
+ if(ret_val < 0) {
+ tet_infoline("deviced_get_pid() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_get_pid()
+ */
+static void utc_SystemFW_deviced_get_pid_func_02(void)
+{
+ int ret_val = 0;
+ char* execpath = "xxxyyyzzz";
+
+ ret_val = deviced_get_pid(execpath);
+ if(ret_val >= 0) {
+ tet_infoline("deviced_get_pid() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
--- /dev/null
+#include <tet_api.h>
+#include <dd-deviced.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_deviced_set_datetime_func_01(void);
+static void utc_SystemFW_deviced_set_datetime_func_02(void);
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+ { utc_SystemFW_deviced_set_datetime_func_01, POSITIVE_TC_IDX },
+ { utc_SystemFW_deviced_set_datetime_func_02, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of deviced_set_datetime()
+ */
+static void utc_SystemFW_deviced_set_datetime_func_01(void)
+{
+ int ret_val = 0;
+ time_t timet = time(NULL);
+
+ ret_val = deviced_set_datetime(timet);
+ if(ret_val < 0) {
+ tet_infoline("deviced_set_datetime() failed in positive test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init deviced_set_datetime()
+ */
+static void utc_SystemFW_deviced_set_datetime_func_02(void)
+{
+ int r = 0;
+
+ r = deviced_set_datetime(NULL);
+
+ if (r>=0) {
+ tet_infoline("deviced_set_datetime() failed in negative test case");
+ tet_result(TET_FAIL);
+ return;
+ }
+ tet_result(TET_PASS);
+}
#include <limits.h>
#include "log.h"
-#include "system-priv.h"
-#include "dd-system.h"
+#include "deviced-priv.h"
+#include "dd-deviced.h"
#define PERMANENT_DIR "/tmp/permanent"
#define VIP_DIR "/tmp/vip"
snprintf(buf1, sizeof(buf1), "%d", pid);
snprintf(buf2, sizeof(buf2), "%d", oomadj_val);
- return system_call_predef_action(OOMADJ_SET, 2, buf1, buf2);
+ return deviced_call_predef_action(OOMADJ_SET, 2, buf1, buf2);
}
int util_process_group_set(const char* name, int pid)
snprintf(buf, sizeof(buf), "%d", pid);
PRT_TRACE_ERR("pid(%d) is inserted at vip", pid);
- return system_call_predef_action(PROCESS_GROUP_SET, 2, buf, name);
+ return deviced_call_predef_action(PROCESS_GROUP_SET, 2, buf, name);
}
-API int system_conf_set_mempolicy_bypid(int pid, enum mem_policy mempol)
+API int deviced_conf_set_mempolicy_bypid(int pid, enum mem_policy mempol)
{
if (pid < 1)
return -1;
return util_oomadj_set(pid, oomadj_val);
}
-API int system_conf_set_mempolicy(enum mem_policy mempol)
+API int deviced_conf_set_mempolicy(enum mem_policy mempol)
{
- return system_conf_set_mempolicy_bypid(getpid(), mempol);
+ return deviced_conf_set_mempolicy_bypid(getpid(), mempol);
}
static int already_permanent(int pid)
return 0;
}
-API int system_conf_set_vip(int pid)
+API int deviced_conf_set_vip(int pid)
{
char buf[BUFF_MAX];
int fd;
return 0;
}
-API int system_conf_is_vip(int pid)
+API int deviced_conf_is_vip(int pid)
{
if (pid < 1)
return -1;
return 0;
}
-API int system_conf_set_permanent_bypid(int pid)
+API int deviced_conf_set_permanent_bypid(int pid)
{
int fd;
if (already_permanent(pid))
return 0;
}
-API int system_conf_set_permanent()
+API int deviced_conf_set_permanent()
{
pid_t pid = getpid();
- return system_conf_set_permanent_bypid(pid);
+ return deviced_conf_set_permanent_bypid(pid);
}
*/
-#ifndef ___SYSTEM_INTERNAL___
-#define ___SYSTEM_INTERNAL___
+#ifndef __DEVICED_INTERNAL__
+#define __DEVICED_INTERNAL__
#include <sys/types.h>
-#include "dd-system.h"
+#include "dd-deviced.h"
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
}
#endif
-#endif /* ___SYSTEM_INTERNAL___ */
+#endif /* __DEVICED_INTERNAL__ */
#include <vconf.h>
#include <vconf-keys.h>
-#include "dd-system.h"
-#include "system-priv.h"
+#include "dd-deviced.h"
+#include "deviced-priv.h"
#include "log.h"
#define PREDEF_PWROFF_POPUP "pwroff-popup"
#define PREDEF_RELEASE_MAX_FREQUENCY "release_max_frequency"
#define PREDEF_RELEASE_MIN_FREQUENCY "release_min_frequency"
-enum system_noti_cmd {
- ADD_SYSTEM_ACTION,
- CALL_SYSTEM_ACTION
+enum deviced_noti_cmd {
+ ADD_DEVICED_ACTION,
+ CALL_DEVICED_ACTION
};
#define SYSTEM_NOTI_SOCKET_PATH "/tmp/sn"
return ret;
}
-static int system_noti_send(struct sysnoti *msg)
+static int deviced_noti_send(struct sysnoti *msg)
{
PRT_TRACE_ERR("--- %s: start", __FUNCTION__);
int client_len;
return result;
}
-API int system_call_predef_action(const char *type, int num, ...)
+API int deviced_call_predef_action(const char *type, int num, ...)
{
PRT_TRACE_ERR("--- %s: start", __FUNCTION__);
struct sysnoti *msg;
}
msg->pid = getpid();
- msg->cmd = CALL_SYSTEM_ACTION;
+ msg->cmd = CALL_DEVICED_ACTION;
msg->type = (char *)type;
msg->path = NULL;
va_end(argptr);
PRT_TRACE_ERR("--- %s: send msg", __FUNCTION__);
- ret = system_noti_send(msg);
+ ret = deviced_noti_send(msg);
free(msg);
PRT_TRACE_ERR("--- %s: end", __FUNCTION__);
return ret;
}
-API int system_inform_foregrd(void)
+API int deviced_inform_foregrd(void)
{
char buf[255];
snprintf(buf, sizeof(buf), "%d", getpid());
- return system_call_predef_action(PREDEF_FOREGRD, 1, buf);
+ return deviced_call_predef_action(PREDEF_FOREGRD, 1, buf);
}
-API int system_inform_backgrd(void)
+API int deviced_inform_backgrd(void)
{
char buf[255];
snprintf(buf, sizeof(buf), "%d", getpid());
- return system_call_predef_action(PREDEF_BACKGRD, 1, buf);
+ return deviced_call_predef_action(PREDEF_BACKGRD, 1, buf);
}
-API int system_inform_active(pid_t pid)
+API int deviced_inform_active(pid_t pid)
{
char buf[255];
snprintf(buf, sizeof(buf), "%d", pid);
- return system_call_predef_action(PREDEF_ACTIVE, 1, buf);
+ return deviced_call_predef_action(PREDEF_ACTIVE, 1, buf);
}
-API int system_inform_inactive(pid_t pid)
+API int deviced_inform_inactive(pid_t pid)
{
char buf[255];
snprintf(buf, sizeof(buf), "%d", pid);
- return system_call_predef_action(PREDEF_INACTIVE, 1, buf);
+ return deviced_call_predef_action(PREDEF_INACTIVE, 1, buf);
}
-API int system_request_poweroff(void)
+API int deviced_request_poweroff(void)
{
- return system_call_predef_action(PREDEF_PWROFF_POPUP, 0);
+ return deviced_call_predef_action(PREDEF_PWROFF_POPUP, 0);
}
-API int system_request_entersleep(void)
+API int deviced_request_entersleep(void)
{
- return system_call_predef_action(PREDEF_ENTERSLEEP, 0);
+ return deviced_call_predef_action(PREDEF_ENTERSLEEP, 0);
}
-API int system_request_leavesleep(void)
+API int deviced_request_leavesleep(void)
{
- return system_call_predef_action(PREDEF_LEAVESLEEP, 0);
+ return deviced_call_predef_action(PREDEF_LEAVESLEEP, 0);
}
-API int system_request_reboot(void)
+API int deviced_request_reboot(void)
{
- return system_call_predef_action(PREDEF_REBOOT, 0);
+ return deviced_call_predef_action(PREDEF_REBOOT, 0);
}
-API int system_set_datetime(time_t timet)
+API int deviced_set_datetime(time_t timet)
{
if (timet < 0L)
return -1;
char buf[255] = { 0 };
snprintf(buf, sizeof(buf), "%ld", timet);
- return system_call_predef_action(PREDEF_SET_DATETIME, 1, buf);
+ return deviced_call_predef_action(PREDEF_SET_DATETIME, 1, buf);
}
-API int system_set_timezone(char *tzpath_str)
+API int deviced_set_timezone(char *tzpath_str)
{
if (tzpath_str == NULL)
return -1;
char buf[255];
snprintf(buf, sizeof(buf), "%s", tzpath_str);
- return system_call_predef_action(PREDEF_SET_TIMEZONE, 1, buf);
+ return deviced_call_predef_action(PREDEF_SET_TIMEZONE, 1, buf);
}
-static int system_noti_mount_mmc_cb(keynode_t *key_nodes, void *data)
+static int deviced_noti_mount_mmc_cb(keynode_t *key_nodes, void *data)
{
struct mmc_contents *mmc_data;
int mmc_err = 0;
(mmc_data->mmc_cb)(mmc_err, mmc_data->user_data);
}
vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_MOUNT,
- (void *)system_noti_mount_mmc_cb);
+ (void *)deviced_noti_mount_mmc_cb);
return 0;
}
-API int system_request_mount_mmc(struct mmc_contents *mmc_data)
+API int deviced_request_mount_mmc(struct mmc_contents *mmc_data)
{
if (mmc_data != NULL && mmc_data->mmc_cb != NULL)
vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_MOUNT,
- (void *)system_noti_mount_mmc_cb, (void *)mmc_data);
- return system_call_predef_action(PREDEF_MOUNT_MMC, 0);
+ (void *)deviced_noti_mount_mmc_cb, (void *)mmc_data);
+ return deviced_call_predef_action(PREDEF_MOUNT_MMC, 0);
}
-static int system_noti_unmount_mmc_cb(keynode_t *key_nodes, void *data)
+static int deviced_noti_unmount_mmc_cb(keynode_t *key_nodes, void *data)
{
struct mmc_contents *mmc_data;
int mmc_err = 0;
(mmc_data->mmc_cb)(mmc_err, mmc_data->user_data);
}
vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_UNMOUNT,
- (void *)system_noti_unmount_mmc_cb);
+ (void *)deviced_noti_unmount_mmc_cb);
return 0;
}
-API int system_request_unmount_mmc(struct mmc_contents *mmc_data, int option)
+API int deviced_request_unmount_mmc(struct mmc_contents *mmc_data, int option)
{
char buf[255];
if (option != 1 && option != 2) {
if (mmc_data != NULL && mmc_data->mmc_cb != NULL)
vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_UNMOUNT,
- (void *)system_noti_unmount_mmc_cb,
+ (void *)deviced_noti_unmount_mmc_cb,
(void *)mmc_data);
- return system_call_predef_action(PREDEF_UNMOUNT_MMC, 1, buf);
+ return deviced_call_predef_action(PREDEF_UNMOUNT_MMC, 1, buf);
}
-static int system_noti_format_mmc_cb(keynode_t *key_nodes, void *data)
+static int deviced_noti_format_mmc_cb(keynode_t *key_nodes, void *data)
{
struct mmc_contents *mmc_data;
mmc_data = (struct mmc_contents *)data;
(mmc_data->mmc_cb)(-1, mmc_data->user_data);
}
vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_FORMAT,
- (void *)system_noti_format_mmc_cb);
+ (void *)deviced_noti_format_mmc_cb);
return 0;
}
-API int system_request_format_mmc(struct mmc_contents *mmc_data)
+API int deviced_request_format_mmc(struct mmc_contents *mmc_data)
{
if (mmc_data != NULL && mmc_data->mmc_cb != NULL)
vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_FORMAT,
- (void *)system_noti_format_mmc_cb,
+ (void *)deviced_noti_format_mmc_cb,
(void *)mmc_data);
- return system_call_predef_action(PREDEF_FORMAT_MMC, 0);
+ return deviced_call_predef_action(PREDEF_FORMAT_MMC, 0);
}
-API int system_request_set_cpu_max_frequency(int val)
+API int deviced_request_set_cpu_max_frequency(int val)
{
char buf_pid[8];
char buf_freq[256];
snprintf(buf_pid, sizeof(buf_pid), "%d", getpid());
snprintf(buf_freq, sizeof(buf_freq), "%d", val * 1000);
- return system_call_predef_action(PREDEF_SET_MAX_FREQUENCY, 2, buf_pid, buf_freq);
+ return deviced_call_predef_action(PREDEF_SET_MAX_FREQUENCY, 2, buf_pid, buf_freq);
}
-API int system_request_set_cpu_min_frequency(int val)
+API int deviced_request_set_cpu_min_frequency(int val)
{
char buf_pid[8];
char buf_freq[256];
snprintf(buf_pid, sizeof(buf_pid), "%d", getpid());
snprintf(buf_freq, sizeof(buf_freq), "%d", val * 1000);
- return system_call_predef_action(PREDEF_SET_MIN_FREQUENCY, 2, buf_pid, buf_freq);
+ return deviced_call_predef_action(PREDEF_SET_MIN_FREQUENCY, 2, buf_pid, buf_freq);
}
-API int system_release_cpu_max_frequency()
+API int deviced_release_cpu_max_frequency()
{
char buf_pid[8];
snprintf(buf_pid, sizeof(buf_pid), "%d", getpid());
- return system_call_predef_action(PREDEF_RELEASE_MAX_FREQUENCY, 1, buf_pid);
+ return deviced_call_predef_action(PREDEF_RELEASE_MAX_FREQUENCY, 1, buf_pid);
}
-API int system_release_cpu_min_frequency()
+API int deviced_release_cpu_min_frequency()
{
char buf_pid[8];
snprintf(buf_pid, sizeof(buf_pid), "%d", getpid());
- return system_call_predef_action(PREDEF_RELEASE_MIN_FREQUENCY, 1, buf_pid);
+ return deviced_call_predef_action(PREDEF_RELEASE_MIN_FREQUENCY, 1, buf_pid);
}
*/
-#ifndef __SYSTEM_PRIVATE__
-#define __SYSTEM_PRIVATE__
+#ifndef __DEVICED_PRIVATE__
+#define __DEVICED_PRIVATE__
#include "common.h"
#ifdef __cplusplus
}
#endif
-#endif /* __SYSTEM_PRIVATE__ */
+#endif /* __DEVICED_PRIVATE__ */
#include <vconf.h>
#include "log.h"
-#include "dd-system.h"
-#include "system-priv.h"
+#include "dd-deviced.h"
+#include "deviced-priv.h"
-API int system_get_pid(const char *execpath)
+API int deviced_get_pid(const char *execpath)
{
DIR *dp;
struct dirent *dentry;
return -1;
}
-API int system_get_cmdline_name(pid_t pid, char *cmdline, size_t cmdline_size)
+API int deviced_get_cmdline_name(pid_t pid, char *cmdline, size_t cmdline_size)
{
int fd, ret;
char buf[PATH_MAX + 1];
return 0;
}
-API int system_get_apppath(pid_t pid, char *app_path, size_t app_path_size)
+API int deviced_get_apppath(pid_t pid, char *app_path, size_t app_path_size)
{
char buf[PATH_MAX];
int ret;
#include <device-node.h>
#include "log.h"
-#include "dd-system.h"
-#include "dd-led.h"
+#include "dd-deviced.h"
#define PREDEF_LED "led"
snprintf(buf_pid, sizeof(buf_pid), "%d", getpid());
snprintf(buf_prop, sizeof(buf_prop), "%d", SET_BRT);
snprintf(buf_val, sizeof(buf_val), "%d", val);
- return system_call_predef_action(PREDEF_LED, 3, buf_pid, buf_prop, buf_val);
+ return deviced_call_predef_action(PREDEF_LED, 3, buf_pid, buf_prop, buf_val);
}
#include <aul.h>
#include <bundle.h>
#include <dirent.h>
-#include "dd-system.h"
#include <libudev.h>
+#include "dd-deviced.h"
#include "ss_queue.h"
#include "ss_log.h"
#include "ss_device_handler.h"
#include <sys/time.h>
#include <mntent.h>
#include <sys/mount.h>
-#include "dd-system.h"
+#include "dd-deviced.h"
#include "ss_log.h"
#include "ss_launch.h"
#include "ss_queue.h"