diff options
Diffstat (limited to 'TC')
-rwxr-xr-x | TC/_export_env.sh | 10 | ||||
-rwxr-xr-x | TC/_export_target_env.sh | 9 | ||||
-rwxr-xr-x | TC/build.sh | 8 | ||||
-rwxr-xr-x | TC/clean.sh | 11 | ||||
-rwxr-xr-x | TC/execute.sh | 19 | ||||
-rwxr-xr-x | TC/push.sh | 13 | ||||
-rwxr-xr-x | TC/run.sh | 15 | ||||
-rwxr-xr-x | TC/scenario1/tslist | 5 | ||||
-rwxr-xr-x | TC/scenario1/utc_SecurityFW_ssm_delete_file_func.c | 137 | ||||
-rwxr-xr-x | TC/scenario1/utc_SecurityFW_ssm_getinfo_func.c | 144 | ||||
-rwxr-xr-x | TC/scenario1/utc_SecurityFW_ssm_read_func.c | 187 | ||||
-rwxr-xr-x | TC/scenario1/utc_SecurityFW_ssm_write_buffer_func.c | 155 | ||||
-rwxr-xr-x | TC/scenario1/utc_SecurityFW_ssm_write_file_func.c | 147 | ||||
-rwxr-xr-x | TC/testcase/tslist | 2 | ||||
-rwxr-xr-x | TC/testcase/utc_secure_storage | bin | 0 -> 40807 bytes | |||
-rw-r--r-- | TC/testcase/utc_secure_storage.c | 399 | ||||
-rwxr-xr-x | TC/tet_code | 12 | ||||
-rw-r--r--[-rwxr-xr-x] | TC/tet_scen | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | TC/tetbuild.cfg | 9 | ||||
-rw-r--r--[-rwxr-xr-x] | TC/tetclean.cfg | 8 | ||||
-rw-r--r--[-rwxr-xr-x] | TC/tetexec.cfg | 8 |
21 files changed, 477 insertions, 823 deletions
diff --git a/TC/_export_env.sh b/TC/_export_env.sh new file mode 100755 index 0000000..7a317f8 --- /dev/null +++ b/TC/_export_env.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +source ./config + +export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path +#export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-simulator # tetware target path +export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path +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 diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh new file mode 100755 index 0000000..3fd8e3f --- /dev/null +++ b/TC/_export_target_env.sh @@ -0,0 +1,9 @@ +#!/bin/sh +. ./config + +export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to path +#export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-simulator +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 diff --git a/TC/build.sh b/TC/build.sh index 91656c9..72aad6c 100755 --- a/TC/build.sh +++ b/TC/build.sh @@ -1,10 +1,6 @@ #!/bin/sh -export TET_INSTALL_PATH=$HOME/work/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_env.sh # setting environment variables export TET_SUITE_ROOT=`pwd` FILE_NAME_EXTENSION=`date +%s` @@ -17,4 +13,4 @@ mkdir -p $RESULT_DIR tcc -c -p ./ tcc -b -j $JOURNAL_RESULT -p ./ -grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT +grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT diff --git a/TC/clean.sh b/TC/clean.sh new file mode 100755 index 0000000..29743e0 --- /dev/null +++ b/TC/clean.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +. ./_export_env.sh # setting environment variables + +export TET_SUITE_ROOT=`pwd` +RESULT_DIR=results + +tcc -c -p ./ # executing tcc, with clean option (-c) +rm -r $RESULT_DIR +rm -r tet_tmp_dir +rm testcase/tet_captured diff --git a/TC/execute.sh b/TC/execute.sh deleted file mode 100755 index e2c742e..0000000 --- a/TC/execute.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/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/push.sh b/TC/push.sh new file mode 100755 index 0000000..5eb9510 --- /dev/null +++ b/TC/push.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +. ./config + +TC_PATH=/opt/home/$PKG_NAME + +echo $TC_PATH + +sdb shell "mkdir -p $TC_PATH" + +sdb push . $TC_PATH + + diff --git a/TC/run.sh b/TC/run.sh new file mode 100755 index 0000000..cec5778 --- /dev/null +++ b/TC/run.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +source ./_export_target_env.sh + +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 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT diff --git a/TC/scenario1/tslist b/TC/scenario1/tslist deleted file mode 100755 index c04c3f0..0000000 --- a/TC/scenario1/tslist +++ /dev/null @@ -1,5 +0,0 @@ -/scenario1/utc_SecurityFW_ssm_write_file_func -/scenario1/utc_SecurityFW_ssm_write_buffer_func -/scenario1/utc_SecurityFW_ssm_read_func -/scenario1/utc_SecurityFW_ssm_getinfo_func -/scenario1/utc_SecurityFW_ssm_delete_file_func diff --git a/TC/scenario1/utc_SecurityFW_ssm_delete_file_func.c b/TC/scenario1/utc_SecurityFW_ssm_delete_file_func.c deleted file mode 100755 index 88f782c..0000000 --- a/TC/scenario1/utc_SecurityFW_ssm_delete_file_func.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * secure storage - * - * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved - * - * Contact: Kidong Kim <kd0228.kim@samsung.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <ss_manager.h> -#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_SecurityFW_ssm_delete_file_func_01(void); -static void utc_SecurityFW_ssm_delete_file_func_02(void); - -enum { - POSITIVE_TC_IDX = 0x01, - NEGATIVE_TC_IDX, -}; - -struct tet_testlist tet_testlist[] = { - { utc_SecurityFW_ssm_delete_file_func_01, POSITIVE_TC_IDX }, - { utc_SecurityFW_ssm_delete_file_func_02, NEGATIVE_TC_IDX }, - { NULL, 0 } -}; - -static void startup(void) -{ - printf("Make temporary directory - /opt/secure-storage/test/\n"); - system("mkdir -p /opt/secure-storage/test"); - printf("Make temporary file\n"); - system("touch /opt/secure-storage/test/input.txt"); - system("echo \"abcdefghij\" > /opt/secure-storage/test/input.txt"); - system("cp /opt/secure-storage/test/input.txt /opt/secure-storage/test/input2.txt"); -} - -static void cleanup(void) -{ - printf("Remove tamporary file and directory\n"); - system("rm -rf /opt/secure-storage/test"); -} - -/** - * @brief Positive test case of ssm_delete_file() - */ -static void utc_SecurityFW_ssm_delete_file_func_01(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_delete_file */ - int ret = -1; - char* filepath = "/opt/secure-storage/test/input.txt"; - ssm_flag flag = SSM_FLAG_DATA; - char* group_id = NULL; - - /* write file to secure-storage */ - ret = ssm_write_file(filepath, flag, group_id); - if(ret != 0) // if fail, - { - tetResult = TET_UNINITIATED; - goto error; - } - - /* delete file */ - ret = ssm_delete_file(filepath, flag, group_id); - if(ret == 0) - tetResult = TET_PASS; - else - tetResult = TET_FAIL; - -error: - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} - -/** - * @brief Negative test case of ssm_delete_file() - */ -static void utc_SecurityFW_ssm_delete_file_func_02(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_delete_file */ - int ret = -1; - char* filepath = "/opt/secure-storage/test/input2.txt"; - ssm_flag flag = SSM_FLAG_DATA; - char* group_id = NULL; - - printf("[%s] checkpoint1\n", __func__); - - /* write file to secure-storage */ - ret = ssm_write_file(filepath, flag, group_id); - printf("[%s] checkpoint2 [%d]\n", __func__, ret); - if(ret != 0) // if fail, - { - tetResult = TET_UNINITIATED; - goto error; - } - - /* delete file */ - ret = ssm_delete_file(NULL, flag, group_id); - printf("[%s] checkpoint3 [%d]\n", __func__, ret); - if(ret != 0) - tetResult = TET_PASS; - else - tetResult = TET_FAIL; - - /* delete encrypted file */ - ret = ssm_delete_file(filepath, flag, group_id); - printf("[%s] checkpoint4 [%d]\n", __func__, ret); - if(ret != 0) - tetResult = TET_UNINITIATED; - -error: - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} diff --git a/TC/scenario1/utc_SecurityFW_ssm_getinfo_func.c b/TC/scenario1/utc_SecurityFW_ssm_getinfo_func.c deleted file mode 100755 index fb6064f..0000000 --- a/TC/scenario1/utc_SecurityFW_ssm_getinfo_func.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * secure storage - * - * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved - * - * Contact: Kidong Kim <kd0228.kim@samsung.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <ss_manager.h> -#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_SecurityFW_ssm_getinfo_func_01(void); -static void utc_SecurityFW_ssm_getinfo_func_02(void); - -enum { - POSITIVE_TC_IDX = 0x01, - NEGATIVE_TC_IDX, -}; - -struct tet_testlist tet_testlist[] = { - { utc_SecurityFW_ssm_getinfo_func_01, POSITIVE_TC_IDX }, - { utc_SecurityFW_ssm_getinfo_func_02, NEGATIVE_TC_IDX }, - { NULL, 0 } -}; - -static void startup(void) -{ - printf("Make temporary directory - /opt/secure-storage/test/\n"); - system("mkdir -p /opt/secure-storage/test"); - printf("Make temporary file\n"); - system("touch /opt/secure-storage/test/input.txt"); - system("echo \"abcdefghij\" > /opt/secure-storage/test/input.txt"); - system("cp /opt/secure-storage/test/input.txt /opt/secure-storage/test/input2.txt"); -} - -static void cleanup(void) -{ - printf("Remove tamporary file and directory\n"); - system("rm -rf /opt/secure-storage/test"); -} - -/** - * @brief Positive test case of ssm_getinfo() - */ -static void utc_SecurityFW_ssm_getinfo_func_01(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_write_file */ - int ret = -1; - char* filepath = "/opt/secure-storage/test/input.txt"; - ssm_flag flag = SSM_FLAG_DATA; - char* group_id = NULL; - ssm_file_info_t sfi; - - /* write file to secure-storage */ - ret = ssm_write_file(filepath, flag, group_id); - if(ret != 0) // if fail, - { - tetResult = TET_UNINITIATED; - goto error; - } - - /* get information */ - ret = ssm_getinfo(filepath, &sfi, flag, group_id); - if(ret == 0) // success - tetResult = TET_PASS; - else - tetResult = TET_FAIL; - - /* delete encrypted file */ - ret = ssm_delete_file(filepath, flag, group_id); - if(ret != 0) - tetResult = TET_UNINITIATED; - -error: - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} - -/** - * @brief Negative test case of ssm_getinfo() - */ -static void utc_SecurityFW_ssm_getinfo_func_02(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_write_file */ - int ret = -1; - char* filepath = "/opt/secure-storage/test/input2.txt"; - ssm_flag flag = SSM_FLAG_DATA; - char* group_id = NULL; - ssm_file_info_t sfi; - - printf("[%s] checkpoint1\n", __func__); - - /* write file to secure-storage */ - ret = ssm_write_file(filepath, flag, group_id); - printf("[%s] checkpoint2 [%d]\n", __func__, ret); - if(ret != 0) // if fail, - { - tetResult = TET_UNINITIATED; - goto error; - } - - /* get information */ - ret = ssm_getinfo(NULL, &sfi, flag, group_id); - printf("[%s] checkpoint3 [%d]\n", __func__, ret); - if(ret == 0) // success - tetResult = TET_FAIL; - else - tetResult = TET_PASS; - - /* delete encrypted file */ - ret = ssm_delete_file(filepath, flag, group_id); - printf("[%s] checkpoint4 [%d]\n", __func__, ret); - if(ret != 0) - tetResult = TET_UNINITIATED; - -error: - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} diff --git a/TC/scenario1/utc_SecurityFW_ssm_read_func.c b/TC/scenario1/utc_SecurityFW_ssm_read_func.c deleted file mode 100755 index e976f06..0000000 --- a/TC/scenario1/utc_SecurityFW_ssm_read_func.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - * secure storage - * - * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved - * - * Contact: Kidong Kim <kd0228.kim@samsung.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <ss_manager.h> -#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_SecurityFW_ssm_read_func_01(void); -static void utc_SecurityFW_ssm_read_func_02(void); - -enum { - POSITIVE_TC_IDX = 0x01, - NEGATIVE_TC_IDX, -}; - -struct tet_testlist tet_testlist[] = { - { utc_SecurityFW_ssm_read_func_01, POSITIVE_TC_IDX }, - { utc_SecurityFW_ssm_read_func_02, NEGATIVE_TC_IDX }, - { NULL, 0 } -}; - -static void startup(void) -{ - printf("Make temporary directory - /opt/secure-storage/test/\n"); - system("mkdir -p /opt/secure-storage/test"); - printf("Make temporary file\n"); - system("touch /opt/secure-storage/test/input.txt"); - system("echo \"abcdefghij\" > /opt/secure-storage/test/input.txt"); - system("cp /opt/secure-storage/test/input.txt /opt/secure-storage/test/input2.txt"); -} - -static void cleanup(void) -{ - printf("Remove tamporary file and directory\n"); - system("rm -rf /opt/secure-storage/test"); -} - -/** - * @brief Positive test case of ssm_read() - */ -static void utc_SecurityFW_ssm_read_func_01(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_write_file */ - int ret = -1; - char* filepath = "/opt/secure-storage/test/input.txt"; - ssm_flag flag = SSM_FLAG_DATA; - char* group_id = NULL; - - /* variables for ssm_read */ - FILE* fp_original = NULL; - char buf[20]; - char* retbuf = NULL; - int readlen = 0; - ssm_file_info_t sfi; - - /* get original file content. after encrypting, original file will be deleted */ - memset(buf, 0x00, 20); - fp_original = fopen(filepath, "r"); - fgets(buf, 20, fp_original); - fclose(fp_original); - - /* write file to secure-storage */ - ret = ssm_write_file(filepath, flag, group_id); - if(ret != 0) // if fail, - { - tetResult = TET_UNINITIATED; - goto error; - } - - /* read and compare */ - ssm_getinfo(filepath, &sfi, flag, group_id); - retbuf = (char*)malloc(sizeof(char) * (sfi.originSize + 1)); - memset(retbuf, 0x00, (sfi.originSize + 1)); - ret = ssm_read(filepath, retbuf, sfi.originSize, &readlen, flag, group_id); - if(ret != 0) // if fail, - { - tetResult = TET_UNINITIATED; - goto free_error; - } - - if(tetResult != TET_UNINITIATED) - { - if(!memcmp(buf, retbuf, strlen(retbuf))) // if same - tetResult = TET_PASS; - else - tetResult = TET_FAIL; - } - - /* delete encrypted file */ - ret = ssm_delete_file(filepath, flag, group_id); - if(ret != 0) - tetResult = TET_UNINITIATED; - -free_error: - free(retbuf); -error: - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} - -/** - * @brief Negative test case of ssm_read() - */ -static void utc_SecurityFW_ssm_read_func_02(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_write_file */ - int ret = -1; - char* filepath = "/opt/secure-storage/test/input2.txt"; - ssm_flag flag = SSM_FLAG_DATA; - char* group_id = NULL; - - /* variables for ssm_read */ - FILE* fp_original = NULL; - char buf[20]; - char* retbuf = NULL; - int readlen = 0; - ssm_file_info_t sfi; - - /* get original file content. after encrypting, original file will be deleted */ - memset(buf, 0x00, 20); - fp_original = fopen(filepath, "r"); - fgets(buf, 20, fp_original); - fclose(fp_original); - - printf("[%s] checkpoint1\n", __func__); - - /* write file to secure-storage */ - ret = ssm_write_file(filepath, flag, group_id); - printf("[%s] checkpoint2 [%d]\n", __func__, ret); - if(ret != 0) // if fail, - { - tetResult = TET_UNINITIATED; - goto error; - } - - /* read and compare */ - ret = ssm_getinfo(filepath, &sfi, flag, group_id); - printf("[%s] checkpoint3 [%d]\n", __func__, ret); - retbuf = (char*)malloc(sizeof(char) * (sfi.originSize + 1)); - memset(retbuf, 0x00, (sfi.originSize + 1)); - ret = ssm_read(NULL, retbuf, sfi.originSize, &readlen, flag, group_id); - printf("[%s] checkpoint4 [%d]\n", __func__, ret); - if(ret != 0) // if fail, - tetResult = TET_PASS; - else - tetResult = TET_FAIL; - - /* delete encrypted file */ - ret = ssm_delete_file(filepath, flag, group_id); - printf("[%s] checkpoint5 [%d]\n", __func__, ret); - if(ret != 0) - tetResult = TET_UNINITIATED; - - free(retbuf); -error: - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} diff --git a/TC/scenario1/utc_SecurityFW_ssm_write_buffer_func.c b/TC/scenario1/utc_SecurityFW_ssm_write_buffer_func.c deleted file mode 100755 index 50faf2c..0000000 --- a/TC/scenario1/utc_SecurityFW_ssm_write_buffer_func.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * secure storage - * - * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved - * - * Contact: Kidong Kim <kd0228.kim@samsung.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <ss_manager.h> -#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_SecurityFW_ssm_write_buffer_func_01(void); -static void utc_SecurityFW_ssm_write_buffer_func_02(void); - -enum { - POSITIVE_TC_IDX = 0x01, - NEGATIVE_TC_IDX, -}; - -struct tet_testlist tet_testlist[] = { - { utc_SecurityFW_ssm_write_buffer_func_01, POSITIVE_TC_IDX }, - { utc_SecurityFW_ssm_write_buffer_func_02, NEGATIVE_TC_IDX }, - { NULL, 0 } -}; - -static void startup(void) -{ - printf("Make temporary directory - /opt/secure-storage/test/\n"); - system("mkdir -p /opt/secure-storage/test"); - printf("Make temporary file\n"); - system("touch /opt/secure-storage/test/input.txt"); - system("echo \"abcdefghij\" > /opt/secure-storage/test/input.txt"); -} - -static void cleanup(void) -{ - printf("Remove tamporary file and directory\n"); - system("rm -rf /opt/secure-storage/test"); -} - -/** - * @brief Positive test case of ssm_write_buffer() - */ -static void utc_SecurityFW_ssm_write_buffer_func_01(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_write_buffer */ - int ret = -1; - char oribuf[20]; - ssm_flag flag = SSM_FLAG_SECRET_OPERATION; - char* group_id = NULL; - char* filename = "write_buffer.txt"; - int buflen = 0; - - /* variables for ssm_read */ - char buf[20]; - char* retbuf = NULL; - int readlen = 0; - ssm_file_info_t sfi; - - /* set contents in buffers */ - memset(oribuf, 0x00, 20); - memset(buf, 0x00, 20); - strncpy(oribuf, "abcdefghij", 10); // original buffer - strncpy(buf, "abcdefghij", 10); // encrypting - - buflen = strlen(buf); - - /* write file to secure-storage */ - ret = ssm_write_buffer(buf, buflen, filename, flag, group_id); - if(ret != 0) // if fail, - { - tetResult = TET_UNINITIATED; - goto error; - } - - /* read and compare */ - ssm_getinfo(filename, &sfi, flag, group_id); - retbuf = (char*)malloc(sizeof(char) * (sfi.originSize + 1)); - memset(retbuf, 0x00, (sfi.originSize + 1)); - - ret = ssm_read(filename, retbuf, sfi.originSize, &readlen, flag, group_id); - if(ret != 0) // if fail, - { - tetResult = TET_UNINITIATED; - goto free_error; - } - - if(tetResult != TET_UNINITIATED) - { - if(!memcmp(oribuf, retbuf, strlen(retbuf))) // if same - tetResult = TET_PASS; - else - tetResult = TET_FAIL; - } - - /* delete encrypted file */ - ret = ssm_delete_file(filename, flag, group_id); - if(ret != 0) - tetResult = TET_UNINITIATED; - -free_error: - free(retbuf); -error: - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} - -/** - * @brief Negative test case of ssm_write_buffer() - */ -static void utc_SecurityFW_ssm_write_buffer_func_02(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_write_buffer */ - int ret = -1; - char* filename = "write_buffer.txt"; - ssm_flag flag = SSM_FLAG_SECRET_OPERATION; - char buf[20]; - int buflen = 0; - char* group_id = NULL; - - /* write file to secure-storage */ - ret = ssm_write_buffer(NULL, buflen, filename, flag, group_id); - if(ret != 0) // if fail, - tetResult = TET_PASS; - else - tetResult = TET_FAIL; - - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} diff --git a/TC/scenario1/utc_SecurityFW_ssm_write_file_func.c b/TC/scenario1/utc_SecurityFW_ssm_write_file_func.c deleted file mode 100755 index a502992..0000000 --- a/TC/scenario1/utc_SecurityFW_ssm_write_file_func.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * secure storage - * - * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved - * - * Contact: Kidong Kim <kd0228.kim@samsung.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <ss_manager.h> -#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_SecurityFW_ssm_write_file_func_01(void); -static void utc_SecurityFW_ssm_write_file_func_02(void); - -enum { - POSITIVE_TC_IDX = 0x01, - NEGATIVE_TC_IDX, -}; - -struct tet_testlist tet_testlist[] = { - { utc_SecurityFW_ssm_write_file_func_01, POSITIVE_TC_IDX }, - { utc_SecurityFW_ssm_write_file_func_02, NEGATIVE_TC_IDX }, - { NULL, 0 } -}; - -static void startup(void) -{ - printf("Make temporary directory - /opt/secure-storage/test/\n"); - system("mkdir -p /opt/secure-storage/test"); - printf("Make temporary file\n"); - system("touch /opt/secure-storage/test/input.txt"); - system("echo \"abcdefghij\" > /opt/secure-storage/test/input.txt"); -} - -static void cleanup(void) -{ - printf("Remove tamporary file and directory\n"); - system("rm -rf /opt/secure-storage/test"); -} - -/** - * @brief Positive test case of ssm_write_file() - */ -static void utc_SecurityFW_ssm_write_file_func_01(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_write_file */ - int ret = -1; - char* filepath = "/opt/secure-storage/test/input.txt"; - ssm_flag flag = SSM_FLAG_DATA; - char* group_id = NULL; - - /* variables for ssm_read */ - FILE* fp_original = NULL; - char buf[20]; - char* retbuf = NULL; - int readlen = 0; - ssm_file_info_t sfi; - - /* get original file content. after encrypting, original file will be deleted */ - memset(buf, 0x00, 20); - fp_original = fopen(filepath, "r"); - fgets(buf, 20, fp_original); - fclose(fp_original); - - /* write file to secure-storage */ - ret = ssm_write_file(filepath, flag, group_id); - if(ret != 0) { // if fail, - tetResult = TET_UNINITIATED; - goto error; - } - - /* read and compare */ - ssm_getinfo(filepath, &sfi, flag, group_id); - retbuf = (char*)malloc(sizeof(char) * (sfi.originSize + 1)); - memset(retbuf, 0x00, (sfi.originSize + 1)); - ret = ssm_read(filepath, retbuf, sfi.originSize, &readlen, flag, group_id); - if(ret != 0) { // if fail, - tetResult = TET_UNINITIATED; - goto free_error; - } - - if(tetResult != TET_UNINITIATED) - { - if(!memcmp(buf, retbuf, strlen(retbuf))) // if same - tetResult = TET_PASS; - else - tetResult = TET_FAIL; - } - - /* delete encrypted file */ - ret = ssm_delete_file(filepath, flag, group_id); - if(ret != 0) - tetResult = TET_UNINITIATED; - -free_error: - free(retbuf); -error: - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} - -/** - * @brief Negative test case of ssm_write_file() - */ -static void utc_SecurityFW_ssm_write_file_func_02(void) -{ - int tetResult = TET_FAIL; - /* variables for ssm_write_file */ - int ret = -1; - char* filepath = "/opt/secure-storage/test/input.txt"; - ssm_flag flag = SSM_FLAG_DATA; - char* group_id = NULL; - - /* write file to secure-storage */ - ret = ssm_write_file(NULL, flag, group_id); - if(ret != 0) // if fail, - tetResult = TET_PASS; - else - tetResult = TET_FAIL; - - printf("[%d] [%s]\n", tetResult, __FILE__); - tet_result(tetResult); -} diff --git a/TC/testcase/tslist b/TC/testcase/tslist new file mode 100755 index 0000000..0d96058 --- /dev/null +++ b/TC/testcase/tslist @@ -0,0 +1,2 @@ +/testcase/utc_secure_storage + diff --git a/TC/testcase/utc_secure_storage b/TC/testcase/utc_secure_storage Binary files differnew file mode 100755 index 0000000..205852a --- /dev/null +++ b/TC/testcase/utc_secure_storage diff --git a/TC/testcase/utc_secure_storage.c b/TC/testcase/utc_secure_storage.c new file mode 100644 index 0000000..3ddce19 --- /dev/null +++ b/TC/testcase/utc_secure_storage.c @@ -0,0 +1,399 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include <tet_api.h> +#include <ss_manager.h> +#include <stdlib.h> + +#define MAX_DATA_NAME 256 +#define MAX_BUFFER_LEN 4096 +#define MAX_GROUP_ID_LEN 32 +#define MAX_PASSWORD_LEN 32 + +#define SSA_TEST_RESULT_SUCCESS 0 +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +// positive +static void utc_secure_stroage_ssa_put_p01(void); +static void utc_secure_stroage_ssa_put_p02(void); +static void utc_secure_stroage_ssa_put_p03(void); +static void utc_secure_stroage_ssa_put_p04(void); +static void utc_secure_stroage_ssa_put_p05(void); +static void utc_secure_stroage_ssa_get_p01(void); +static void utc_secure_stroage_ssa_delete_p01(void); +static void utc_secure_stroage_ssa_encrypt_p01(void); +static void utc_secure_stroage_ssa_encrypt_p02(void); +static void utc_secure_stroage_ssa_decrypt_p01(void); +// negative +static void utc_secure_stroage_ssa_put_n01(void); +static void utc_secure_stroage_ssa_get_n01(void); +static void utc_secure_stroage_ssa_encrypt_n01(void); +static void utc_secure_stroage_ssa_decrypt_n01(void); +static void utc_secure_stroage_ssa_delete_n01(void); + +struct tet_testlist tet_testlist[] = { + { utc_secure_stroage_ssa_put_p01, POSITIVE_TC_IDX }, + { utc_secure_stroage_ssa_put_p02, POSITIVE_TC_IDX }, + { utc_secure_stroage_ssa_put_p03, POSITIVE_TC_IDX }, + { utc_secure_stroage_ssa_put_p04, POSITIVE_TC_IDX }, + { utc_secure_stroage_ssa_put_p05, POSITIVE_TC_IDX }, +// { utc_secure_stroage_ssa_get_p01, POSITIVE_TC_IDX }, + { utc_secure_stroage_ssa_delete_p01, POSITIVE_TC_IDX }, + { utc_secure_stroage_ssa_encrypt_p01, POSITIVE_TC_IDX }, + { utc_secure_stroage_ssa_encrypt_p02, POSITIVE_TC_IDX }, +// { utc_secure_stroage_ssa_decrypt_p01, POSITIVE_TC_IDX }, + + { utc_secure_stroage_ssa_put_n01, NEGATIVE_TC_IDX }, +// { utc_secure_stroage_ssa_get_n01, NEGATIVE_TC_IDX }, + { utc_secure_stroage_ssa_encrypt_n01, NEGATIVE_TC_IDX }, + { utc_secure_stroage_ssa_decrypt_n01, NEGATIVE_TC_IDX }, + { utc_secure_stroage_ssa_delete_n01, NEGATIVE_TC_IDX }, + { NULL, 0 }, +}; + +static void startup(void) +{ + /* start of TC */ + tet_printf("\n Secure Storage Agnet TC start"); +} + + +static void cleanup(void) +{ + /* end of TC */ + tet_printf("\n Secure Storage Agent TC end"); +} + + +static void MakeLongBuffer(char* buffer, int length) +{ + int i = 0; + for(i=0; i<length; i++) + { + (buffer[i]) = (char)('a' + i % 26); + } +} + +int SsaCheckPut(const char* data_name, const char* group_id, const char *password, const char* orig_buffer) +{ + char* read_buffer = NULL; + + int len = ssa_get(data_name, &read_buffer, group_id, password); + dts_check_gt("ssa_get", len, 0, "Failed to get data_name : %s , err : %d", data_name, len); + dts_check_ne("ssa_get", read_buffer, NULL, "Failed to get data"); + + if(orig_buffer) + { + int res = strncmp(orig_buffer, read_buffer, len); + dts_check_eq("ssa_get", res, 0, "Failed to get data"); + } + + free(read_buffer); + + return len; +} + +int SsaCheckEncrypt(const char* data, int data_len, const char *password, const char* orig_buffer) +{ + char* decrypted_buffer = NULL; + + int len = ssa_decrypt(data, data_len, &decrypted_buffer, password); + dts_check_gt("ssa_decrypt", len, 0, "Failed to decrypt data"); + dts_check_ne("ssa_decrypt", decrypted_buffer, NULL, "Failed to decrypt data"); + + if(orig_buffer) + { + int res = strncmp(orig_buffer, decrypted_buffer, len); + dts_check_eq("ssa_decrypt", res, 0, "Failed to decrypt data"); + } + + free(decrypted_buffer); + + return len; +} + +// Positive +static void utc_secure_stroage_ssa_put_p01(void) +{ + const char* test_buffer = "this is test buffer for ssa_put.\n 1234567890 \n abcdefghijklmni \n !@#$%^&*()_+|"; + const char* data_name = "test"; + const char* group_id = NULL; + const char* password = "1234"; + + int len = ssa_put(data_name, test_buffer, strlen(test_buffer), group_id, password); + dts_check_gt("ssa_put", len, 0, "Failed to put data_name : %s , err : %d", data_name, len); + + int res = SsaCheckPut(data_name, group_id, password, test_buffer); + dts_check_gt("ssa_put", res, 0, "Failed to get data after put :%d", res); +} + + +static void utc_secure_stroage_ssa_put_p02(void) +{ + const char* test_buffer = "this is test buffer for ssa_put with group_id.\n group_id is secure-storage::test"; + const char* data_name = "group_id_test"; + const char* group_id = NULL; + const char* password = "qwer"; + + int len = ssa_put(data_name, test_buffer, strlen(test_buffer), group_id, password); + dts_check_gt("ssa_put", len, 0, "Failed to put data_name : %s , err : %d", data_name, len); + + int res = SsaCheckPut(data_name, group_id, password, test_buffer); + dts_check_gt("ssa_put", res, 0, "Failed to get data after put :%d", res); +} + + +static void utc_secure_stroage_ssa_put_p03(void) +{ + const char* test_buffer = "this is test buffer for ssa_put with max data name."; + char data_name[MAX_DATA_NAME+1] = {0,}; + const char* group_id = NULL; + const char* password = "qwer1234"; + + MakeLongBuffer(data_name, MAX_DATA_NAME); + int len = ssa_put(data_name, test_buffer, strlen(test_buffer), group_id, password); + dts_check_gt("ssa_put", len, 0, "Failed to put data_name : %s , err : %d", data_name, len); + + int res = SsaCheckPut(data_name, group_id, password, test_buffer); + dts_check_gt("ssa_put", res, 0, "Failed to get data after put :%d", res); +} + + +/** + * @brief Positive test case of sim_get_mcc() + */ +static void utc_secure_stroage_ssa_put_p04(void) +{ + char test_buffer[MAX_BUFFER_LEN] = {0,}; + const char* data_name = "max_buffer_test"; + const char* group_id = NULL; + const char* password = "qwer"; + + MakeLongBuffer(test_buffer, MAX_BUFFER_LEN); + + int len = ssa_put(data_name, test_buffer, MAX_BUFFER_LEN, group_id, password); + dts_check_gt("ssa_put", len, 0, "Failed to put data_name : %s , err : %d", data_name, len); + + int res = SsaCheckPut(data_name, group_id, password, test_buffer); + dts_check_gt("ssa_put", res, 0, "Failed to get data after put :%d", res); +} + + +static void utc_secure_stroage_ssa_put_p05(void) +{ + const char* test_buffer = "this is test buffer for ssa_put with max password"; + const char* data_name = "max_buffer_test"; + const char* group_id = NULL; + char password[MAX_PASSWORD_LEN+1] = {0,}; + + MakeLongBuffer(password, MAX_PASSWORD_LEN); + + int len = ssa_put(data_name, test_buffer, strlen(test_buffer), group_id, password); + dts_check_gt("ssa_put", len, 0, "Failed to put data_name : %s , err : %d", data_name, len); + + int res = SsaCheckPut(data_name, group_id, password, test_buffer); + dts_check_gt("ssa_put", res, 0, "Failed to get data after put :%d", res); +} + + +static void utc_secure_stroage_ssa_get_p01(void) +{ +} + + +static void utc_secure_stroage_ssa_delete_p01(void) +{ + const char* test_buffer = "this is test buffer for ssa_put.\n 1234567890 \n abcdefghijklmni \n !@#$%^&*()_+|"; + const char* data_name = "delete_test"; + const char* group_id = NULL; + const char* password = "1234"; + + // NULL group_id + int len = ssa_put(data_name, test_buffer, strlen(test_buffer), NULL, password); + dts_check_gt("ssa_delete", len, 0, "Failed to put data_name : %s , err : %d", data_name, len); + + int res = SsaCheckPut(data_name, NULL, password, test_buffer); + dts_check_gt("ssa_delete", res, 0, "Failed to get data after put :%d", res); + + int check = ssa_delete(data_name, NULL); + dts_check_gt("ssa_delete", check, 0, "Failed to ssa_delete :%d", check); + + + // with group_id + len = ssa_put(data_name, test_buffer, strlen(test_buffer), group_id, password); + dts_check_gt("ssa_delete", len, 0, "Failed to put data_name : %s , err : %d", data_name, len); + + res = SsaCheckPut(data_name, group_id, password, test_buffer); + dts_check_gt("ssa_delete", res, 0, "Failed to get data after put :%d", res); + + check = ssa_delete(data_name, group_id); + dts_check_gt("ssa_delete", check, 0, "Failed to ssa_delete :%d", check); +} + + +static void utc_secure_stroage_ssa_encrypt_p01(void) +{ + const char* test_buffer = "this is test buffer for ssa_put.\n 1234567890 \n abcdefghijklmni \n !@#$%^&*()_+|"; + const char* password = "1234"; + char* encrypted_buffer = NULL; + + int len = ssa_encrypt(test_buffer, strlen(test_buffer), &encrypted_buffer, password); + dts_check_gt("ssa_encrypt", len, 0, "Failed to encrypt err : %d", len); + + if(len > 0 && encrypted_buffer != NULL) + { + int res = SsaCheckEncrypt(encrypted_buffer, len, password, test_buffer); + dts_check_gt("ssa_encrypt", res, 0, "Failed to verifying ssa_encrypt err : %d", res); + free(encrypted_buffer); + } +} + + +static void utc_secure_stroage_ssa_encrypt_p02(void) +{ + char test_buffer[MAX_BUFFER_LEN] = {0,}; + const char* password = "1234"; + char* encrypted_buffer = NULL; + + MakeLongBuffer(test_buffer, MAX_BUFFER_LEN-60); + int len = ssa_encrypt(test_buffer, strlen(test_buffer), &encrypted_buffer, password); + dts_check_gt("ssa_encrypt", len, 0, "Failed to encrypt err : %d", len); + + if(len > 0 && encrypted_buffer != NULL) + { + int res = SsaCheckEncrypt(encrypted_buffer, len, password, test_buffer); + dts_check_gt("ssa_encrypt", res, 0, "Failed to verifying ssa_encrypt err : %d", res); + free(encrypted_buffer); + } +} + + +static void utc_secure_stroage_ssa_decrypt_p01(void) +{ +} + +// Negative + +static void utc_secure_stroage_ssa_put_n01(void) +{ + const char* test_buffer = "this is nagative ssa_put test buffer.\n"; + const char* data_name = "nagative_test_data_name"; + const char* group_id = "test"; + const char* password = "qwer"; + + // NULL data name + int len = ssa_put(NULL, test_buffer, strlen(test_buffer), NULL, NULL); + dts_check_lt("ssa_put Negative", len, 0, "Failed to test NULL data name data_name : %s , err : %d", data_name, len); + + // NULL data buffer + len = ssa_put(data_name, NULL, strlen(test_buffer), NULL, NULL); + dts_check_lt("ssa_put Negative", len, 0, "Failed to test NULL data buffer data_name : %s , err : %d", data_name, len); + + // zero data length + len = ssa_put(data_name, test_buffer, 0, NULL, NULL); + dts_check_lt("ssa_put Negative", len, 0, "Failed to test 0 data length put data_name : %s , err : %d", data_name, len); + + // ununiformed group_id + len = ssa_put(data_name, test_buffer, strlen(test_buffer), "ununiformaed group_id", NULL); + dts_check_lt("ssa_put Negative", len, 0, "Failed to test group_id data_name : %s , err : %d", data_name, len); + + // invalid password. ss password : 32, sss MAX_PW_LEN : 64 + char invalidPassword[128] = {0,}; + MakeLongBuffer(invalidPassword, 128); + len = ssa_put(data_name, test_buffer, strlen(test_buffer), NULL, invalidPassword); + dts_check_lt("ssa_put Negative", len, 0, "Failed to test invalid password data_name : %s , err : %d", data_name, len); +} + +static void utc_secure_stroage_ssa_get_n01(void) +{ +} + +static void utc_secure_stroage_ssa_encrypt_n01(void) +{ + const char* test_buffer = "this is test buffer for ssa_put.\n 1234567890 \n abcdefghijklmni \n !@#$%^&*()_+|"; + const char* password = "1234"; + char* encrypted_buffer = NULL; + + // null input buffer + int len = ssa_encrypt(NULL, strlen(test_buffer), &encrypted_buffer, password); + dts_check_lt("ssa_encrypt Negative", len, 0, "Failed to test null buffer err : %d",len); + dts_check_gt("ssa_encrypt Negative", encrypted_buffer, NULL, "Failed to encrypt err : %d", len); + + // zero buffer length + len = ssa_encrypt(test_buffer, 0, &encrypted_buffer, password); + dts_check_lt("ssa_encrypt Negative", len, 0, "Failed to test zero length err : %d",len); + + // over size of input buffer + char max_buffer[5500] = {0,}; + MakeLongBuffer(max_buffer, 5500); + len = ssa_encrypt(max_buffer, strlen(max_buffer), &encrypted_buffer, password); + dts_check_lt("ssa_encrypt Negative", len, 0, "Failed to test over size buffer err : %d", len); + + // over size of password + char max_passwd[80] = {0,}; + MakeLongBuffer(max_passwd, 80); + len = ssa_encrypt(test_buffer, strlen(test_buffer), &encrypted_buffer, max_passwd); + dts_check_lt("ssa_encrypt Negative", len, 0, "Failed to test invalid password err : %d", len); +} + + +static void utc_secure_stroage_ssa_decrypt_n01(void) +{ + const char* test_buffer = "this is test buffer for ssa_put.\n 1234567890 \n abcdefghijklmni \n !@#$%^&*()_+|"; + const char* password = "1234"; + char* encrypted_buffer = NULL; + + int len = ssa_encrypt(test_buffer, strlen(test_buffer), &encrypted_buffer, password); + dts_check_gt("ssa_decrypt Negative", len, 0, "Failed to encrypt err : %d", len); + dts_check_gt("ssa_decrypt Negative", encrypted_buffer, NULL, "Failed to encrypt err : %d", len); + + char* decrypted_buffer = NULL; + // NULL input buffer + len = ssa_decrypt(NULL, len, &decrypted_buffer, NULL); + dts_check_lt("ssa_decrypt Negative", len, 0, "Failed to test NULL input buffer err : %d", len); + free(decrypted_buffer); + + // zero length + len = ssa_decrypt(encrypted_buffer, 0, &decrypted_buffer, NULL); + dts_check_lt("ssa_decrypt Negative", len, 0, "Failed to test NULL zero length err : %d", len); + free(encrypted_buffer); +} + +static void utc_secure_stroage_ssa_delete_n01(void) +{ + const char* test_buffer = "this is test buffer for ssa_put.\n 1234567890 \n abcdefghijklmni \n !@#$%^&*()_+|"; + const char* data_name = "nagative_delete_test"; + const char* group_id = NULL; + const char* password = "1234"; + + // no data_name + int check = ssa_delete(data_name, NULL); + dts_check_lt("ssa_delete Negative", check, 0, "Failed to test invalid data name data_name : %s , err : %d", data_name, check); + + // NULL data name + check = ssa_delete(NULL, group_id); + dts_check_lt("ssa_delete Negative", check, 0, "Failed to test NULL data name data_name : %s , err : %d", data_name, check); +} diff --git a/TC/tet_code b/TC/tet_code deleted file mode 100755 index a2cf6c1..0000000 --- a/TC/tet_code +++ /dev/null @@ -1,12 +0,0 @@ -# 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 index c63a380..03f029a 100755..100644 --- a/TC/tet_scen +++ b/TC/tet_scen @@ -4,4 +4,4 @@ all # Test scenario TEST - :include:/scenario1/tslist + :include:/testcase/tslist diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg index 1f80874..f7eda55 100755..100644 --- a/TC/tetbuild.cfg +++ b/TC/tetbuild.cfg @@ -1,4 +1,5 @@ -TET_OUTPUT_CAPTURE=False -TET_BUILD_TOOL=make -TET_PASS_TC_NAME=True -TET_API_COMPLIANT=True +TET_OUTPUT_CAPTURE=True # capture option for build operation checking +TET_BUILD_TOOL=make # build with using make command +TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build +TET_API_COMPLIANT=True # use TET API in Test Case ? +TET_PASS_TC_NAME=True # report passed TC name in Journal file? diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg index 55ef6b5..02d7030 100755..100644 --- a/TC/tetclean.cfg +++ b/TC/tetclean.cfg @@ -1,3 +1,5 @@ -TET_OUTPUT_CAPTURE=False -TET_CLEAN_TOOL=make clean -TET_API_COMPLIANT=True +TET_OUTPUT_CAPTURE=True # capture option +TET_CLEAN_TOOL= make clean # clean tool +TET_CLEAN_FILE= Makefile # file for clean +TET_API_COMPLIANT=True # TET API useage +TET_PASS_TC_NAME=True # showing name , passed TC diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg index eb4f0d3..ef3e452 100755..100644 --- a/TC/tetexec.cfg +++ b/TC/tetexec.cfg @@ -1,3 +1,5 @@ -TET_OUTPUT_CAPTURE=True -TET_API_COMPLIANT=True -TET_PASS_TC_NAME=True +TET_OUTPUT_CAPTURE=True # capturing execution or not +TET_EXEC_TOOL= # ex) exec : execution tool set up/ Optional +TET_EXEC_FILE= # ex) exectool : execution file/ Optional +TET_API_COMPLIANT=True # Test case or Tool usesTET API? +TET_PASS_TC_NAME=True # showing Passed TC name ? |