diff options
Diffstat (limited to 'TC')
-rwxr-xr-x | TC/build.sh | 20 | ||||
-rwxr-xr-x | TC/execute.sh | 19 | ||||
-rw-r--r-- | TC/tet_code | 12 | ||||
-rw-r--r-- | TC/tet_scen | 7 | ||||
-rw-r--r-- | TC/tetbuild.cfg | 3 | ||||
-rw-r--r-- | TC/tetclean.cfg | 2 | ||||
-rw-r--r-- | TC/tetexec.cfg | 1 | ||||
-rw-r--r-- | TC/unit/Makefile | 31 | ||||
-rwxr-xr-x | TC/unit/tc_gen.sh | 28 | ||||
-rw-r--r-- | TC/unit/tslist | 8 | ||||
-rw-r--r-- | TC/unit/utc_MODULE_API_func.c.in | 64 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysconf_is_vip_func.c | 64 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysconf_set_mempolicy_bypid_func.c | 66 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysconf_set_mempolicy_func.c | 64 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysconf_set_permanent_bypid_func.c | 64 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysconf_set_permanent_func.c | 65 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysconf_set_vip_func.c | 65 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysman_get_apppath_func.c | 66 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysman_get_cmdline_name_func.c | 64 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysman_get_pid_func.c | 64 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_sysman_set_datetime_func.c | 64 |
21 files changed, 841 insertions, 0 deletions
diff --git a/TC/build.sh b/TC/build.sh new file mode 100755 index 0000000..98ebeff --- /dev/null +++ b/TC/build.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +export TET_INSTALL_PATH=/scratchbox/tetware # local tetware path +export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target +export PATH=$TET_TARGET_PATH/bin:$PATH +export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH +export TET_ROOT=$TET_TARGET_PATH + +export TET_SUITE_ROOT=`pwd` +FILE_NAME_EXTENSION=`date +%s` + +RESULT_DIR=results +HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html +JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal + +mkdir -p $RESULT_DIR + +tcc -c -p ./ +tcc -b -j $JOURNAL_RESULT -p ./ +grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT diff --git a/TC/execute.sh b/TC/execute.sh new file mode 100755 index 0000000..6720da0 --- /dev/null +++ b/TC/execute.sh @@ -0,0 +1,19 @@ +#!/bin/sh +export TET_INSTALL_PATH=/mnt/nfs/tetware +export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target +export PATH=$TET_TARGET_PATH/bin:$PATH +export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH + +export TET_ROOT=$TET_TARGET_PATH + +export TET_SUITE_ROOT=`pwd` +FILE_NAME_EXTENSION=`date +%s` + +RESULT_DIR=results +HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html +JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal + +mkdir -p $RESULT_DIR + +tcc -e -j $JOURNAL_RESULT -p ./ +grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT diff --git a/TC/tet_code b/TC/tet_code new file mode 100644 index 0000000..a2cf6c1 --- /dev/null +++ b/TC/tet_code @@ -0,0 +1,12 @@ +# TET reserved codes +0 "PASS" +1 "FAIL" +2 "UNRESOLVED" +3 "NOTINUSE" +4 "UNSUPPORTED" +5 "UNTESTED" +6 "UNINITIATED" +7 "NORESULT" + +# Test suite additional codes +33 "INSPECT" diff --git a/TC/tet_scen b/TC/tet_scen new file mode 100644 index 0000000..43cbc9b --- /dev/null +++ b/TC/tet_scen @@ -0,0 +1,7 @@ +all + ^TEST +##### Scenarios for TEST ##### + +# Test scenario +TEST + :include:/unit/tslist diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg new file mode 100644 index 0000000..6192c78 --- /dev/null +++ b/TC/tetbuild.cfg @@ -0,0 +1,3 @@ +TET_OUTPUT_CAPTURE=False +TET_BUILD_TOOL=make +TET_PASS_TC_NAME=True diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg new file mode 100644 index 0000000..c66eda4 --- /dev/null +++ b/TC/tetclean.cfg @@ -0,0 +1,2 @@ +TET_OUTPUT_CAPTURE=False +TET_CLEAN_TOOL=make clean diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg new file mode 100644 index 0000000..0d9d39a --- /dev/null +++ b/TC/tetexec.cfg @@ -0,0 +1 @@ +TET_OUTPUT_CAPTURE=False diff --git a/TC/unit/Makefile b/TC/unit/Makefile new file mode 100644 index 0000000..7bb6092 --- /dev/null +++ b/TC/unit/Makefile @@ -0,0 +1,31 @@ +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 \ + +PKGS = sysman + +LDFLAGS = `pkg-config --libs $(PKGS)` +LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s + +CFLAGS = -I. `pkg-config --cflags $(PKGS)` +CFLAGS += -I$(TET_ROOT)/inc/tet3 +CFLAGS += -Wall + +all: $(TARGETS) + +$(TARGETS): %: %.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) + +clean: + rm -f $(TARGETS) diff --git a/TC/unit/tc_gen.sh b/TC/unit/tc_gen.sh new file mode 100755 index 0000000..54f482d --- /dev/null +++ b/TC/unit/tc_gen.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +TMPSTR=$0 +SCRIPT=${TMPSTR##*/} + +if [ $# -lt 2 ]; then + echo "Usage) $SCRIPT module_name api_name" + exit 1 +fi + +MODULE=$1 +API=$2 +TEMPLATE=utc_MODULE_API_func.c.in +TESTCASE=utc_${MODULE}_${API}_func + +sed -e ' + s^@API@^'"$API"'^g + s^@MODULE@^'"$MODULE"'^g + ' $TEMPLATE > $TESTCASE.c + +if [ ! -e "$TESTCASE.c" ]; then + echo "Failed" + exit 1 +fi +echo "Testcase file is $TESTCASE.c" +echo "Done" +echo "please put \"$TESTCASE\" as Target in Makefile" +echo "please put \"/unit/$TESTCASE\" in tslist" diff --git a/TC/unit/tslist b/TC/unit/tslist new file mode 100644 index 0000000..9f6d985 --- /dev/null +++ b/TC/unit/tslist @@ -0,0 +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 + diff --git a/TC/unit/utc_MODULE_API_func.c.in b/TC/unit/utc_MODULE_API_func.c.in new file mode 100644 index 0000000..b235fa3 --- /dev/null +++ b/TC/unit/utc_MODULE_API_func.c.in @@ -0,0 +1,64 @@ +#include <tet_api.h> + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_@MODULE@_@API@_func_01(void); +static void utc_@MODULE@_@API@_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_@MODULE@_@API@_func_01, POSITIVE_TC_IDX }, + { utc_@MODULE@_@API@_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +/** + * @brief Positive test case of @API@() + */ +static void utc_@MODULE@_@API@_func_01(void) +{ + int r = 0; + +/* + r = @API@(...); +*/ + if (r) { + tet_infoline("@API@() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init @API@() + */ +static void utc_@MODULE@_@API@_func_02(void) +{ + int r = 0; + +/* + r = @API@(...); +*/ + if (r) { + tet_infoline("@API@() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/unit/utc_SystemFW_sysconf_is_vip_func.c b/TC/unit/utc_SystemFW_sysconf_is_vip_func.c new file mode 100644 index 0000000..a57cf0b --- /dev/null +++ b/TC/unit/utc_SystemFW_sysconf_is_vip_func.c @@ -0,0 +1,64 @@ +#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); +} diff --git a/TC/unit/utc_SystemFW_sysconf_set_mempolicy_bypid_func.c b/TC/unit/utc_SystemFW_sysconf_set_mempolicy_bypid_func.c new file mode 100644 index 0000000..e1f6fab --- /dev/null +++ b/TC/unit/utc_SystemFW_sysconf_set_mempolicy_bypid_func.c @@ -0,0 +1,66 @@ +#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); +} diff --git a/TC/unit/utc_SystemFW_sysconf_set_mempolicy_func.c b/TC/unit/utc_SystemFW_sysconf_set_mempolicy_func.c new file mode 100644 index 0000000..baf5a4b --- /dev/null +++ b/TC/unit/utc_SystemFW_sysconf_set_mempolicy_func.c @@ -0,0 +1,64 @@ +#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); +} diff --git a/TC/unit/utc_SystemFW_sysconf_set_permanent_bypid_func.c b/TC/unit/utc_SystemFW_sysconf_set_permanent_bypid_func.c new file mode 100644 index 0000000..d44f985 --- /dev/null +++ b/TC/unit/utc_SystemFW_sysconf_set_permanent_bypid_func.c @@ -0,0 +1,64 @@ +#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); +} diff --git a/TC/unit/utc_SystemFW_sysconf_set_permanent_func.c b/TC/unit/utc_SystemFW_sysconf_set_permanent_func.c new file mode 100644 index 0000000..0bf38be --- /dev/null +++ b/TC/unit/utc_SystemFW_sysconf_set_permanent_func.c @@ -0,0 +1,65 @@ +#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); +}*/ diff --git a/TC/unit/utc_SystemFW_sysconf_set_vip_func.c b/TC/unit/utc_SystemFW_sysconf_set_vip_func.c new file mode 100644 index 0000000..955e73f --- /dev/null +++ b/TC/unit/utc_SystemFW_sysconf_set_vip_func.c @@ -0,0 +1,65 @@ +#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); +} diff --git a/TC/unit/utc_SystemFW_sysman_get_apppath_func.c b/TC/unit/utc_SystemFW_sysman_get_apppath_func.c new file mode 100644 index 0000000..609c8fa --- /dev/null +++ b/TC/unit/utc_SystemFW_sysman_get_apppath_func.c @@ -0,0 +1,66 @@ +#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); +} diff --git a/TC/unit/utc_SystemFW_sysman_get_cmdline_name_func.c b/TC/unit/utc_SystemFW_sysman_get_cmdline_name_func.c new file mode 100644 index 0000000..6ad5f45 --- /dev/null +++ b/TC/unit/utc_SystemFW_sysman_get_cmdline_name_func.c @@ -0,0 +1,64 @@ +#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); +} diff --git a/TC/unit/utc_SystemFW_sysman_get_pid_func.c b/TC/unit/utc_SystemFW_sysman_get_pid_func.c new file mode 100644 index 0000000..4e4efae --- /dev/null +++ b/TC/unit/utc_SystemFW_sysman_get_pid_func.c @@ -0,0 +1,64 @@ +#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); +} diff --git a/TC/unit/utc_SystemFW_sysman_set_datetime_func.c b/TC/unit/utc_SystemFW_sysman_set_datetime_func.c new file mode 100644 index 0000000..d09f7dc --- /dev/null +++ b/TC/unit/utc_SystemFW_sysman_set_datetime_func.c @@ -0,0 +1,64 @@ +#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); +} |