From 9c120d3fbf6118e59ad088e84d01af24991979bb Mon Sep 17 00:00:00 2001 From: "giyeol.ok" Date: Wed, 27 Mar 2013 22:02:38 +0900 Subject: [PATCH] change system header file from dd-system to dd-deviced Change-Id: I27b1ce78f9813604a18eb85e7bddbaebff35c0f4 Signed-off-by: giyeol.ok --- CMakeLists.txt | 10 +- packaging/system-server.spec | 4 +- src/core/device-change-handler.c | 1 - src/core/predefine.c | 2 +- .../{dd-system-managed.h => dd-deviced-managed.h} | 36 +++---- src/deviced/{dd-system.h => dd-deviced.h} | 96 +++++++++---------- src/shared/TC/unit/Makefile | 22 ++--- src/shared/TC/unit/tslist | 14 +-- src/shared/TC/unit/utc_MODULE_API_func.c.in | 4 +- .../TC/unit/utc_SystemFW_sysconf_is_vip_func.c | 64 ------------- ...utc_SystemFW_sysconf_set_mempolicy_bypid_func.c | 66 ------------- .../unit/utc_SystemFW_sysconf_set_mempolicy_func.c | 64 ------------- ...utc_SystemFW_sysconf_set_permanent_bypid_func.c | 64 ------------- .../unit/utc_SystemFW_sysconf_set_permanent_func.c | 65 ------------- .../TC/unit/utc_SystemFW_sysconf_set_vip_func.c | 65 ------------- .../TC/unit/utc_SystemFW_sysman_get_apppath_func.c | 66 ------------- .../utc_SystemFW_sysman_get_cmdline_name_func.c | 64 ------------- .../TC/unit/utc_SystemFW_sysman_get_pid_func.c | 64 ------------- .../unit/utc_SystemFW_sysman_set_datetime_func.c | 64 ------------- .../TC/unit/utc_SystemFW_system_conf_is_vip_func.c | 64 +++++++++++++ ...SystemFW_system_conf_set_mempolicy_bypid_func.c | 66 +++++++++++++ .../utc_SystemFW_system_conf_set_mempolicy_func.c | 64 +++++++++++++ ...SystemFW_system_conf_set_permanent_bypid_func.c | 64 +++++++++++++ .../utc_SystemFW_system_conf_set_permanent_func.c | 65 +++++++++++++ .../unit/utc_SystemFW_system_conf_set_vip_func.c | 65 +++++++++++++ .../TC/unit/utc_SystemFW_system_get_apppath_func.c | 66 +++++++++++++ .../utc_SystemFW_system_get_cmdline_name_func.c | 64 +++++++++++++ .../TC/unit/utc_SystemFW_system_get_pid_func.c | 64 +++++++++++++ .../unit/utc_SystemFW_system_set_datetime_func.c | 64 +++++++++++++ src/shared/{system-conf.c => deviced-conf.c} | 24 ++--- .../{system-internal.h => deviced-internal.h} | 8 +- src/shared/{system-noti.c => deviced-noti.c} | 104 ++++++++++----------- src/shared/{system-priv.h => deviced-priv.h} | 6 +- src/shared/{system-util.c => deviced-util.c} | 10 +- src/shared/led.c | 5 +- 35 files changed, 818 insertions(+), 820 deletions(-) rename src/deviced/{dd-system-managed.h => dd-deviced-managed.h} (79%) rename src/deviced/{dd-system.h => dd-deviced.h} (71%) delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysconf_is_vip_func.c delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysconf_set_mempolicy_bypid_func.c delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysconf_set_mempolicy_func.c delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysconf_set_permanent_bypid_func.c delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysconf_set_permanent_func.c delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysconf_set_vip_func.c delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysman_get_apppath_func.c delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysman_get_cmdline_name_func.c delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysman_get_pid_func.c delete mode 100644 src/shared/TC/unit/utc_SystemFW_sysman_set_datetime_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_conf_is_vip_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_conf_set_mempolicy_bypid_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_conf_set_mempolicy_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_conf_set_permanent_bypid_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_conf_set_permanent_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_conf_set_vip_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_get_apppath_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_get_cmdline_name_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_get_pid_func.c create mode 100644 src/shared/TC/unit/utc_SystemFW_system_set_datetime_func.c rename src/shared/{system-conf.c => deviced-conf.c} (87%) rename src/shared/{system-internal.h => deviced-internal.h} (86%) rename src/shared/{system-noti.c => deviced-noti.c} (73%) rename src/shared/{system-priv.h => deviced-priv.h} (91%) rename src/shared/{system-util.c => deviced-util.c} (90%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68c97a1..133e307 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,21 +52,21 @@ SET(SRCS ${SRCS} # 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 ) diff --git a/packaging/system-server.spec b/packaging/system-server.spec index d760ce4..011051a 100755 --- a/packaging/system-server.spec +++ b/packaging/system-server.spec @@ -414,11 +414,11 @@ systemctl daemon-reload %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 diff --git a/src/core/device-change-handler.c b/src/core/device-change-handler.c index dbbedca..daa3c99 100755 --- a/src/core/device-change-handler.c +++ b/src/core/device-change-handler.c @@ -28,7 +28,6 @@ #include #include #include -#include "dd-system.h" #include #include #include "queue.h" diff --git a/src/core/predefine.c b/src/core/predefine.c index e50045e..758f601 100644 --- a/src/core/predefine.c +++ b/src/core/predefine.c @@ -30,7 +30,7 @@ #include #include #include -#include "dd-system.h" +#include "dd-deviced.h" #include "log.h" #include "launch.h" #include "queue.h" diff --git a/src/deviced/dd-system-managed.h b/src/deviced/dd-deviced-managed.h similarity index 79% rename from src/deviced/dd-system-managed.h rename to src/deviced/dd-deviced-managed.h index f0ad822..d0d4c84 100755 --- a/src/deviced/dd-system-managed.h +++ b/src/deviced/dd-deviced-managed.h @@ -18,14 +18,14 @@ */ -#ifndef __DD_SYSTEM_MANAGED__ -#define __DD_SYSTEM_MANAGED__ +#ifndef __DD_DEVICED_MANAGED__ +#define __DD_DEVICED_MANAGED__ #include /** - * @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 @@ -37,23 +37,23 @@ extern "C" { #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) @@ -64,10 +64,10 @@ struct mmc_contents { }; /** - * @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 @@ -88,13 +88,13 @@ struct mmc_contents { * @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 @@ -109,19 +109,19 @@ int system_request_mount_mmc(struct mmc_contents *mmc_data); * @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__ */ diff --git a/src/deviced/dd-system.h b/src/deviced/dd-deviced.h similarity index 71% rename from src/deviced/dd-system.h rename to src/deviced/dd-deviced.h index f47e6ab..143ffc2 100755 --- a/src/deviced/dd-system.h +++ b/src/deviced/dd-deviced.h @@ -18,22 +18,22 @@ */ -#ifndef __DD_SYSTEM__ -#define __DD_SYSTEM__ +#ifndef __DD_DEVICED__ +#define __DD_DEVICED__ #include #include #include #include -#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 @@ -41,14 +41,14 @@ */ /** - * @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. *
Please use libslp-system-dev debian package and dd-deviced.pc file for development. - *
And include dd-system.h file at your source codes as following. - * @addtogroup libdeviced System Manager library + *
And include dd-deviced.h file at your source codes as following. + * @addtogroup libdeviced Deviced Daemon library * @{ */ @@ -64,10 +64,10 @@ enum mem_policy { 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 @@ -80,11 +80,11 @@ enum mem_policy { * @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 @@ -98,47 +98,47 @@ int system_get_cmdline_name(pid_t pid, char *cmdline, * @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. @@ -146,16 +146,16 @@ int system_conf_set_permanent(void); * @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. @@ -165,50 +165,50 @@ int system_conf_set_permanent_bypid(pid_t pid); * @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); /** * @} @@ -217,4 +217,4 @@ int system_release_cpu_min_frequency(void); #ifdef __cplusplus } #endif -#endif /* __DD_SYSTEM__ */ +#endif /* __DD_DEVICED__ */ diff --git a/src/shared/TC/unit/Makefile b/src/shared/TC/unit/Makefile index 7bb6092..635abe1 100644 --- a/src/shared/TC/unit/Makefile +++ b/src/shared/TC/unit/Makefile @@ -1,17 +1,17 @@ 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 diff --git a/src/shared/TC/unit/tslist b/src/shared/TC/unit/tslist index 9f6d985..78bc1b2 100644 --- a/src/shared/TC/unit/tslist +++ b/src/shared/TC/unit/tslist @@ -1,8 +1,8 @@ -/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 diff --git a/src/shared/TC/unit/utc_MODULE_API_func.c.in b/src/shared/TC/unit/utc_MODULE_API_func.c.in index b235fa3..c64c623 100644 --- a/src/shared/TC/unit/utc_MODULE_API_func.c.in +++ b/src/shared/TC/unit/utc_MODULE_API_func.c.in @@ -35,7 +35,7 @@ static void utc_@MODULE@_@API@_func_01(void) int r = 0; /* - r = @API@(...); + r = @API@(...); */ if (r) { tet_infoline("@API@() failed in positive test case"); @@ -53,7 +53,7 @@ static void utc_@MODULE@_@API@_func_02(void) int r = 0; /* - r = @API@(...); + r = @API@(...); */ if (r) { tet_infoline("@API@() failed in negative test case"); diff --git a/src/shared/TC/unit/utc_SystemFW_sysconf_is_vip_func.c b/src/shared/TC/unit/utc_SystemFW_sysconf_is_vip_func.c deleted file mode 100644 index a57cf0b..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysconf_is_vip_func.c +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include - -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); -} diff --git a/src/shared/TC/unit/utc_SystemFW_sysconf_set_mempolicy_bypid_func.c b/src/shared/TC/unit/utc_SystemFW_sysconf_set_mempolicy_bypid_func.c deleted file mode 100644 index e1f6fab..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysconf_set_mempolicy_bypid_func.c +++ /dev/null @@ -1,66 +0,0 @@ -#include -#include - -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); -} diff --git a/src/shared/TC/unit/utc_SystemFW_sysconf_set_mempolicy_func.c b/src/shared/TC/unit/utc_SystemFW_sysconf_set_mempolicy_func.c deleted file mode 100644 index baf5a4b..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysconf_set_mempolicy_func.c +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include - -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); -} diff --git a/src/shared/TC/unit/utc_SystemFW_sysconf_set_permanent_bypid_func.c b/src/shared/TC/unit/utc_SystemFW_sysconf_set_permanent_bypid_func.c deleted file mode 100644 index d44f985..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysconf_set_permanent_bypid_func.c +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include - -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); -} diff --git a/src/shared/TC/unit/utc_SystemFW_sysconf_set_permanent_func.c b/src/shared/TC/unit/utc_SystemFW_sysconf_set_permanent_func.c deleted file mode 100644 index 0bf38be..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysconf_set_permanent_func.c +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include - -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); -}*/ diff --git a/src/shared/TC/unit/utc_SystemFW_sysconf_set_vip_func.c b/src/shared/TC/unit/utc_SystemFW_sysconf_set_vip_func.c deleted file mode 100644 index 955e73f..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysconf_set_vip_func.c +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include - -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); -} diff --git a/src/shared/TC/unit/utc_SystemFW_sysman_get_apppath_func.c b/src/shared/TC/unit/utc_SystemFW_sysman_get_apppath_func.c deleted file mode 100644 index 609c8fa..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysman_get_apppath_func.c +++ /dev/null @@ -1,66 +0,0 @@ -#include -#include - -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); -} diff --git a/src/shared/TC/unit/utc_SystemFW_sysman_get_cmdline_name_func.c b/src/shared/TC/unit/utc_SystemFW_sysman_get_cmdline_name_func.c deleted file mode 100644 index 6ad5f45..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysman_get_cmdline_name_func.c +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include - -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); -} diff --git a/src/shared/TC/unit/utc_SystemFW_sysman_get_pid_func.c b/src/shared/TC/unit/utc_SystemFW_sysman_get_pid_func.c deleted file mode 100644 index 4e4efae..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysman_get_pid_func.c +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include - -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); -} diff --git a/src/shared/TC/unit/utc_SystemFW_sysman_set_datetime_func.c b/src/shared/TC/unit/utc_SystemFW_sysman_set_datetime_func.c deleted file mode 100644 index d09f7dc..0000000 --- a/src/shared/TC/unit/utc_SystemFW_sysman_set_datetime_func.c +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include - -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); -} diff --git a/src/shared/TC/unit/utc_SystemFW_system_conf_is_vip_func.c b/src/shared/TC/unit/utc_SystemFW_system_conf_is_vip_func.c new file mode 100644 index 0000000..22a7e27 --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_conf_is_vip_func.c @@ -0,0 +1,64 @@ +#include +#include + +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); +} diff --git a/src/shared/TC/unit/utc_SystemFW_system_conf_set_mempolicy_bypid_func.c b/src/shared/TC/unit/utc_SystemFW_system_conf_set_mempolicy_bypid_func.c new file mode 100644 index 0000000..a28cad0 --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_conf_set_mempolicy_bypid_func.c @@ -0,0 +1,66 @@ +#include +#include + +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); +} diff --git a/src/shared/TC/unit/utc_SystemFW_system_conf_set_mempolicy_func.c b/src/shared/TC/unit/utc_SystemFW_system_conf_set_mempolicy_func.c new file mode 100644 index 0000000..0056e0c --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_conf_set_mempolicy_func.c @@ -0,0 +1,64 @@ +#include +#include + +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); +} diff --git a/src/shared/TC/unit/utc_SystemFW_system_conf_set_permanent_bypid_func.c b/src/shared/TC/unit/utc_SystemFW_system_conf_set_permanent_bypid_func.c new file mode 100644 index 0000000..76e8da8 --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_conf_set_permanent_bypid_func.c @@ -0,0 +1,64 @@ +#include +#include + +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); +} diff --git a/src/shared/TC/unit/utc_SystemFW_system_conf_set_permanent_func.c b/src/shared/TC/unit/utc_SystemFW_system_conf_set_permanent_func.c new file mode 100644 index 0000000..47fca93 --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_conf_set_permanent_func.c @@ -0,0 +1,65 @@ +#include +#include + +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); +}*/ diff --git a/src/shared/TC/unit/utc_SystemFW_system_conf_set_vip_func.c b/src/shared/TC/unit/utc_SystemFW_system_conf_set_vip_func.c new file mode 100644 index 0000000..34f71fb --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_conf_set_vip_func.c @@ -0,0 +1,65 @@ +#include +#include + +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); +} diff --git a/src/shared/TC/unit/utc_SystemFW_system_get_apppath_func.c b/src/shared/TC/unit/utc_SystemFW_system_get_apppath_func.c new file mode 100644 index 0000000..616ea67 --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_get_apppath_func.c @@ -0,0 +1,66 @@ +#include +#include + +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); +} diff --git a/src/shared/TC/unit/utc_SystemFW_system_get_cmdline_name_func.c b/src/shared/TC/unit/utc_SystemFW_system_get_cmdline_name_func.c new file mode 100644 index 0000000..a07e280 --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_get_cmdline_name_func.c @@ -0,0 +1,64 @@ +#include +#include + +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); +} diff --git a/src/shared/TC/unit/utc_SystemFW_system_get_pid_func.c b/src/shared/TC/unit/utc_SystemFW_system_get_pid_func.c new file mode 100644 index 0000000..91a0969 --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_get_pid_func.c @@ -0,0 +1,64 @@ +#include +#include + +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); +} diff --git a/src/shared/TC/unit/utc_SystemFW_system_set_datetime_func.c b/src/shared/TC/unit/utc_SystemFW_system_set_datetime_func.c new file mode 100644 index 0000000..1654dec --- /dev/null +++ b/src/shared/TC/unit/utc_SystemFW_system_set_datetime_func.c @@ -0,0 +1,64 @@ +#include +#include + +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); +} diff --git a/src/shared/system-conf.c b/src/shared/deviced-conf.c similarity index 87% rename from src/shared/system-conf.c rename to src/shared/deviced-conf.c index 220245c..6c28b36 100644 --- a/src/shared/system-conf.c +++ b/src/shared/deviced-conf.c @@ -26,8 +26,8 @@ #include #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" @@ -50,7 +50,7 @@ int util_oomadj_set(int pid, int oomadj_val) 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) @@ -66,10 +66,10 @@ int util_process_group_set(const char* name, int pid) snprintf(buf, sizeof(buf), "%d", pid); _E("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; @@ -90,9 +90,9 @@ API int system_conf_set_mempolicy_bypid(int pid, enum mem_policy mempol) 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) @@ -160,7 +160,7 @@ static int copy_cmdline(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; @@ -193,7 +193,7 @@ API int system_conf_set_vip(int pid) return 0; } -API int system_conf_is_vip(int pid) +API int deviced_conf_is_vip(int pid) { if (pid < 1) return -1; @@ -208,7 +208,7 @@ API int system_conf_is_vip(int pid) 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)) @@ -228,8 +228,8 @@ API int system_conf_set_permanent_bypid(int 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); } diff --git a/src/shared/system-internal.h b/src/shared/deviced-internal.h similarity index 86% rename from src/shared/system-internal.h rename to src/shared/deviced-internal.h index 9ccf8ac..bc9e528 100644 --- a/src/shared/system-internal.h +++ b/src/shared/deviced-internal.h @@ -18,10 +18,10 @@ */ -#ifndef ___SYSTEM_INTERNAL___ -#define ___SYSTEM_INTERNAL___ +#ifndef __DEVICED_INTERNAL__ +#define __DEVICED_INTERNAL__ #include -#include "dd-system.h" +#include "dd-deviced.h" #ifdef __cplusplus extern "C" { @@ -36,4 +36,4 @@ extern "C" { #ifdef __cplusplus } #endif -#endif /* ___SYSTEM_INTERNAL___ */ +#endif /* __DEVICED_INTERNAL__ */ diff --git a/src/shared/system-noti.c b/src/shared/deviced-noti.c similarity index 73% rename from src/shared/system-noti.c rename to src/shared/deviced-noti.c index 8d970a8..540ae34 100644 --- a/src/shared/system-noti.c +++ b/src/shared/deviced-noti.c @@ -28,8 +28,8 @@ #include #include -#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" @@ -51,9 +51,9 @@ #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" @@ -81,7 +81,7 @@ static inline int send_str(int fd, char *str) return ret; } -static int system_noti_send(struct sysnoti *msg) +static int deviced_noti_send(struct sysnoti *msg) { _E("--- %s: start", __FUNCTION__); int client_len; @@ -142,7 +142,7 @@ static int system_noti_send(struct sysnoti *msg) return result; } -API int system_call_predef_action(const char *type, int num, ...) +API int deviced_call_predef_action(const char *type, int num, ...) { _E("--- %s: start", __FUNCTION__); struct sysnoti *msg; @@ -165,7 +165,7 @@ API int system_call_predef_action(const char *type, int num, ...) } msg->pid = getpid(); - msg->cmd = CALL_SYSTEM_ACTION; + msg->cmd = CALL_DEVICED_ACTION; msg->type = (char *)type; msg->path = NULL; @@ -178,80 +178,80 @@ API int system_call_predef_action(const char *type, int num, ...) va_end(argptr); _E("--- %s: send msg", __FUNCTION__); - ret = system_noti_send(msg); + ret = deviced_noti_send(msg); free(msg); _E("--- %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; @@ -271,19 +271,19 @@ static int system_noti_mount_mmc_cb(keynode_t *key_nodes, void *data) (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; @@ -299,11 +299,11 @@ static int system_noti_unmount_mmc_cb(keynode_t *key_nodes, void *data) (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) { @@ -314,12 +314,12 @@ API int system_request_unmount_mmc(struct mmc_contents *mmc_data, int option) 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; @@ -334,20 +334,20 @@ static int system_noti_format_mmc_cb(keynode_t *key_nodes, void *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]; @@ -356,10 +356,10 @@ API int system_request_set_cpu_max_frequency(int val) 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]; @@ -368,23 +368,23 @@ API int system_request_set_cpu_min_frequency(int val) 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); } diff --git a/src/shared/system-priv.h b/src/shared/deviced-priv.h similarity index 91% rename from src/shared/system-priv.h rename to src/shared/deviced-priv.h index 1fd75aa..85557ec 100644 --- a/src/shared/system-priv.h +++ b/src/shared/deviced-priv.h @@ -18,8 +18,8 @@ */ -#ifndef __SYSTEM_PRIVATE__ -#define __SYSTEM_PRIVATE__ +#ifndef __DEVICED_PRIVATE__ +#define __DEVICED_PRIVATE__ #include "common.h" @@ -45,4 +45,4 @@ struct sysnoti { #ifdef __cplusplus } #endif -#endif /* __SYSTEM_PRIVATE__ */ +#endif /* __DEVICED_PRIVATE__ */ diff --git a/src/shared/system-util.c b/src/shared/deviced-util.c similarity index 90% rename from src/shared/system-util.c rename to src/shared/deviced-util.c index a297210..c3feadf 100644 --- a/src/shared/system-util.c +++ b/src/shared/deviced-util.c @@ -35,10 +35,10 @@ #include #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; @@ -79,7 +79,7 @@ API int system_get_pid(const char *execpath) 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]; @@ -112,7 +112,7 @@ API int system_get_cmdline_name(pid_t pid, char *cmdline, size_t cmdline_size) 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; diff --git a/src/shared/led.c b/src/shared/led.c index 4da1d7d..55835ff 100644 --- a/src/shared/led.c +++ b/src/shared/led.c @@ -22,8 +22,7 @@ #include #include "log.h" -#include "dd-system.h" -#include "dd-led.h" +#include "dd-deviced.h" #define PREDEF_LED "led" @@ -64,5 +63,5 @@ API int led_set_brightness(int val) 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); } -- 2.7.4