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 | 16 | ||||
-rwxr-xr-x | TC/clean.sh | 11 | ||||
-rwxr-xr-x | TC/push.sh | 13 | ||||
-rwxr-xr-x | TC/run.sh | 15 | ||||
-rwxr-xr-x | TC/testcase/tslist | 2 | ||||
-rwxr-xr-x | TC/testcase/utc_secure_storage | bin | 40807 -> 0 bytes | |||
-rw-r--r-- | TC/testcase/utc_secure_storage.c | 399 | ||||
-rw-r--r-- | TC/tet_scen | 7 | ||||
-rw-r--r-- | TC/tetbuild.cfg | 5 | ||||
-rw-r--r-- | TC/tetclean.cfg | 5 | ||||
-rw-r--r-- | TC/tetexec.cfg | 5 |
13 files changed, 0 insertions, 497 deletions
diff --git a/TC/_export_env.sh b/TC/_export_env.sh deleted file mode 100755 index 7a317f8..0000000 --- a/TC/_export_env.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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 deleted file mode 100755 index 3fd8e3f..0000000 --- a/TC/_export_target_env.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/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 deleted file mode 100755 index 72aad6c..0000000 --- a/TC/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -. ./_export_env.sh # setting environment variables - -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 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT diff --git a/TC/clean.sh b/TC/clean.sh deleted file mode 100755 index 29743e0..0000000 --- a/TC/clean.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/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/push.sh b/TC/push.sh deleted file mode 100755 index 5eb9510..0000000 --- a/TC/push.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/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 deleted file mode 100755 index cec5778..0000000 --- a/TC/run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/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/testcase/tslist b/TC/testcase/tslist deleted file mode 100755 index 0d96058..0000000 --- a/TC/testcase/tslist +++ /dev/null @@ -1,2 +0,0 @@ -/testcase/utc_secure_storage - diff --git a/TC/testcase/utc_secure_storage b/TC/testcase/utc_secure_storage Binary files differdeleted file mode 100755 index 205852a..0000000 --- a/TC/testcase/utc_secure_storage +++ /dev/null diff --git a/TC/testcase/utc_secure_storage.c b/TC/testcase/utc_secure_storage.c deleted file mode 100644 index 3ddce19..0000000 --- a/TC/testcase/utc_secure_storage.c +++ /dev/null @@ -1,399 +0,0 @@ -/* - * 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_scen b/TC/tet_scen deleted file mode 100644 index 03f029a..0000000 --- a/TC/tet_scen +++ /dev/null @@ -1,7 +0,0 @@ -all - ^TEST -##### Scenarios for TEST ##### - -# Test scenario -TEST - :include:/testcase/tslist diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg deleted file mode 100644 index f7eda55..0000000 --- a/TC/tetbuild.cfg +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 02d7030..0000000 --- a/TC/tetclean.cfg +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index ef3e452..0000000 --- a/TC/tetexec.cfg +++ /dev/null @@ -1,5 +0,0 @@ -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 ? |