Split existing tests into environment categories.
authorLukasz Kostyra <l.kostyra@partner.samsung.com>
Wed, 31 Jul 2013 09:26:37 +0000 (11:26 +0200)
committerMarcin Niesluchowski <m.niesluchow@samsung.com>
Thu, 23 Jan 2014 14:07:37 +0000 (15:07 +0100)
[Issue#]        SSDWSSP-416
[Feature]       Split existing tests into two categories: those that pass only on SMACK environment
                and those that pass no matter if SMACK exists on the system or not.
[Cause]         Launching tests on NOSMACK environment caused them to fail, because the environment
                behaved differently when SMACK was turned off. Failing tests expected different
                results than they should have.
[Solution]      Using recently added macros RUNNER_TEST_SMACK and RUNNER_CHILD_TEST_SMACK tests were
                split into two categories mentioned above in Feature section.
[Verification]  Run tests on an image with SMACK turned on and off. There should be less tests on an
                environment with SMACK turned OFF, others should pass (or fail) just as they do with
                SMACK turned on.

Change-Id: Ic313214eb578ce00f2156d434cd8358ad526c03f

tests/libprivilege-control-tests/test_cases.cpp
tests/libsmack-tests/CMakeLists.txt
tests/libsmack-tests/test_cases.cpp
tests/security-server-tests/CMakeLists.txt
tests/security-server-tests/security_server_tests_client_smack.cpp
tests/security-server-tests/security_server_tests_dbus.cpp
tests/security-server-tests/security_server_tests_label.cpp
tests/security-server-tests/security_server_tests_server.cpp
tests/security-server-tests/security_server_tests_weird_arguments.cpp

index 2aef3b8619e0988b9c8f4be97991e52813e784a7..d064bb1f50a247fefc0eada83521445446da0f2f 100644 (file)
@@ -12,7 +12,7 @@
  *    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.
- */
+*/
 
 /*
  * @file        test_cases.cpp
@@ -794,7 +794,7 @@ RUNNER_TEST(privilege_control02_app_label_dir)
     RUNNER_ASSERT_MSG(result == 0, "Unable to check Smack labels for non-app dir");
 }
 
-RUNNER_TEST(privilege_control03_app_label_shared_dir)
+RUNNER_TEST_SMACK(privilege_control03_app_label_shared_dir)
 {
     int result;
 
@@ -820,7 +820,7 @@ RUNNER_TEST(privilege_control03_app_label_shared_dir)
 /**
  * Add permisions from  test_privilege_control_rules template
  */
-RUNNER_TEST(privilege_control04_add_permissions)
+RUNNER_TEST_SMACK(privilege_control04_add_permissions)
 {
     int result = app_add_permissions(APP_ID, PRIVS);
     RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS,
@@ -984,7 +984,7 @@ static void read_gids(std::set<unsigned> &set, const char *file_path)
     }
 }
 
-RUNNER_TEST(privilege_control05_add_shared_dir_readers)
+RUNNER_TEST_SMACK(privilege_control05_add_shared_dir_readers)
 {
 #define  TEST_OBJ            "TEST_OBJECT"
 #define  TEST_OBJ_SOME_OTHER "TEST_OBJA"
@@ -1149,7 +1149,7 @@ void check_groups(const char *dac_file)
     RUNNER_ASSERT_MSG(groups_check.empty(), "Application doesn't belong to some required groups: " << groups_left);
 }
 
-RUNNER_CHILD_TEST(privilege_control05_set_app_privilege)
+RUNNER_CHILD_TEST_SMACK(privilege_control05_set_app_privilege)
 {
     int result;
 
@@ -1191,7 +1191,7 @@ RUNNER_CHILD_TEST(privilege_control05_set_app_privilege)
 /**
  * Set APP privileges. wgt.
  */
-RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_wgt)
+RUNNER_CHILD_TEST_SMACK(privilege_control05_set_app_privilege_wgt)
 {
     int result;
 
@@ -1220,7 +1220,7 @@ RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_wgt)
 /**
  * Set APP privileges. wgt_partner.
  */
-RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_wgt_partner)
+RUNNER_CHILD_TEST_SMACK(privilege_control05_set_app_privilege_wgt_partner)
 {
     int result;
 
@@ -1248,7 +1248,7 @@ RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_wgt_partner)
 /**
  * Set APP privileges. wgt_platform.
  */
-RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_wgt_platform)
+RUNNER_CHILD_TEST_SMACK(privilege_control05_set_app_privilege_wgt_platform)
 {
     int result;
 
@@ -1276,7 +1276,7 @@ RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_wgt_platform)
 /**
  * Set APP privileges. osp app.
  */
-RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_osp)
+RUNNER_CHILD_TEST_SMACK(privilege_control05_set_app_privilege_osp)
 {
     int result;
 
@@ -1304,7 +1304,7 @@ RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_osp)
 /**
  * Set APP privileges. partner osp app.
  */
-RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_osp_partner)
+RUNNER_CHILD_TEST_SMACK(privilege_control05_set_app_privilege_osp_partner)
 {
     int result;
 
@@ -1332,7 +1332,7 @@ RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_osp_partner)
 /**
  * Set APP privileges. platform osp app.
  */
-RUNNER_CHILD_TEST(privilege_control05_set_app_privilege_osp_platform)
+RUNNER_CHILD_TEST_SMACK(privilege_control05_set_app_privilege_osp_platform)
 {
     int result;
 
@@ -1599,7 +1599,7 @@ void checkOnlyAvAccess(const char *av_id, const char *app_id, const char *commen
  * Check app_register_av function
  * Notice that this test case may have no sense if previous would fail (privilege_control06_app_install)
  */
-RUNNER_TEST(privilege_control10_app_register_av)
+RUNNER_TEST_SMACK(privilege_control10_app_register_av)
 {
     int result;
 
@@ -1657,7 +1657,7 @@ RUNNER_TEST(privilege_control10_app_register_av)
 /**
  * Grant SMACK permissions based on permissions list.
  */
-RUNNER_TEST(privilege_control11_app_enable_permissions)
+RUNNER_TEST_SMACK(privilege_control11_app_enable_permissions)
 {
     int result;
     int smack_file_length;
@@ -1965,7 +1965,7 @@ RUNNER_CHILD_TEST(privilege_control11_app_enable_permissions_efl)
  * granted rules and enabling them again from a rules file from disk.
  */
 
-RUNNER_TEST(privilege_control13_app_reset_permissions)
+RUNNER_TEST_SMACK(privilege_control13_app_reset_permissions)
 {
     int result;
 
@@ -1997,7 +1997,7 @@ RUNNER_TEST(privilege_control13_app_reset_permissions)
  * Make two applications "friends", by giving them both full permissions on
  * each other.
  */
-RUNNER_TEST(privilege_control14_app_add_friend)
+RUNNER_TEST_SMACK(privilege_control14_app_add_friend)
 {
     int result;
 
@@ -2195,7 +2195,7 @@ static void smack_unix_sock_server(int sock)
     free(smack_label);
 }
 
-RUNNER_TEST(privilege_control15_app_id_from_socket)
+RUNNER_TEST_SMACK(privilege_control15_app_id_from_socket)
 {
     int pid;
     struct sockaddr_un sockaddr = {AF_UNIX, SOCK_PATH};
@@ -2405,7 +2405,7 @@ RUNNER_TEST(privilege_control17_appsettings_privilege)
     (void)perm_app_uninstall(APP_2);
 }
 
-RUNNER_TEST(privilege_control18_app_setup_path_public)
+RUNNER_TEST_SMACK(privilege_control18_app_setup_path_public)
 {
     int result;
 
@@ -2430,7 +2430,7 @@ RUNNER_TEST(privilege_control18_app_setup_path_public)
     cleaning_smack_database_files();
 }
 
-RUNNER_TEST(privilege_control19_app_setup_path_settings)
+RUNNER_TEST_SMACK(privilege_control19_app_setup_path_settings)
 {
     int result;
 
index 7992118157c05ffb6d78fbccb75a66c164526c21..582c4ebc3b43e363ec7106b43149fe2fb00b88c6 100644 (file)
@@ -36,6 +36,7 @@ SET(TARGET_TEST_SOURCES
 #header directories
 INCLUDE_DIRECTORIES(
     ${TARGET_DEP_INCLUDE_DIRS}
+    ${PROJECT_SOURCE_DIR}/tests/common/
     )
 
 #preprocessor definitions
@@ -47,6 +48,7 @@ ADD_EXECUTABLE(${TARGET_TEST} ${TARGET_TEST_SOURCES})
 #linker directories
 TARGET_LINK_LIBRARIES(${TARGET_TEST}
     ${TARGET_DEP_LIBRARIES}
+    tests-common
     )
 
 #place for output file
index 081697d3559061788012691ef748cc39ef6b3cbd..ad383053f08e02e8e153d243ca90603afe93dfeb 100644 (file)
@@ -36,6 +36,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/wait.h>
+#include "tests_common.h"
 
 #define TEST_SUBJECT  "test_subject"
 #define TEST_OBJECT   "test_oject"
@@ -172,7 +173,7 @@ void removeAccessesAll()
 /**
  * Add a new access with smack_accesses_add_modify()
  */
-RUNNER_TEST(smack_accesses_add_modify_test_1){
+RUNNER_TEST_SMACK(smack_accesses_add_modify_test_1){
     int result;
 
     clean_up();
@@ -197,7 +198,7 @@ RUNNER_TEST(smack_accesses_add_modify_test_1){
 /**
  * Test if rules are applied in the right order, and modification works.
  */
-RUNNER_TEST(smack_accesses_add_modify_test_2){
+RUNNER_TEST_SMACK(smack_accesses_add_modify_test_2){
     int result;
     struct smack_accesses *rules = NULL;
     result = smack_accesses_new(&rules);
@@ -225,7 +226,7 @@ RUNNER_TEST(smack_accesses_add_modify_test_2){
  * Test if rules are applied in the right order, and modification works.
  * Using different smack_accesses list to add and delete.
  */
-RUNNER_TEST(smack_accesses_add_modify_test_3){
+RUNNER_TEST_SMACK(smack_accesses_add_modify_test_3){
     int result;
     struct smack_accesses *rules = NULL;
     result = smack_accesses_new(&rules);
@@ -259,7 +260,7 @@ RUNNER_TEST(smack_accesses_add_modify_test_3){
 /**
  * Add a list of privileges and then revoke just ONE of them.
  */
-RUNNER_TEST(smack_accesses_add_modify_test_4){
+RUNNER_TEST_SMACK(smack_accesses_add_modify_test_4){
     int result;
     struct smack_accesses *rules = NULL;
     result = smack_accesses_new(&rules);
@@ -290,7 +291,7 @@ RUNNER_TEST(smack_accesses_add_modify_test_4){
  * Add a list of privileges and then revoke just ONE of them.
  * Without applying privileges in between those actions.
  */
-RUNNER_TEST(smack_accesses_add_modify_test_5){
+RUNNER_TEST_SMACK(smack_accesses_add_modify_test_5){
     int result;
     struct smack_accesses *rules = NULL;
     result = smack_accesses_new(&rules);
@@ -320,7 +321,7 @@ RUNNER_TEST(smack_accesses_add_modify_test_5){
 /**
  * Add a list of privileges and then revoke just TWO of them.
  */
-RUNNER_TEST(smack_accesses_add_modify_test_6){
+RUNNER_TEST_SMACK(smack_accesses_add_modify_test_6){
     int result;
     struct smack_accesses *rules = NULL;
     result = smack_accesses_new(&rules);
@@ -350,7 +351,7 @@ RUNNER_TEST(smack_accesses_add_modify_test_6){
 /**
  * Run smack_accesses_add_modify with the same accesses_add and accesses_del.
  */
-RUNNER_TEST(smack_accesses_add_modify_test_7){
+RUNNER_TEST_SMACK(smack_accesses_add_modify_test_7){
     unsigned int i;
     int result;
 
@@ -376,7 +377,7 @@ RUNNER_TEST(smack_accesses_add_modify_test_7){
 /**
  * Revoke subject with previously added rules and revoke it again.
  */
-RUNNER_TEST(smack_revoke_subject_test_1){
+RUNNER_TEST_SMACK(smack_revoke_subject_test_1){
     unsigned int i;
     int result;
 
@@ -421,7 +422,7 @@ RUNNER_TEST(smack_revoke_subject_test_1){
 /**
  * Clearing accesses
  */
-RUNNER_TEST(smack_accesses_clear_test_1){
+RUNNER_TEST_SMACK(smack_accesses_clear_test_1){
     unsigned int i;
     int result;
 
@@ -549,7 +550,7 @@ RUNNER_TEST(smack01_storing_and_restoring_rules)
     close(sample);
 }
 
-RUNNER_TEST(smack02_aplying_rules_into_kernel)
+RUNNER_TEST_SMACK(smack02_aplying_rules_into_kernel)
 {
     /*
      * author: Pawel Polawski
@@ -624,7 +625,7 @@ const char *rules_tab[] = {
     "reader8",  "#Ax[T].!~W@1}",    "-wxat"
 };
 
-RUNNER_TEST(smack03_mixed_rule_string_add)
+RUNNER_TEST_SMACK(smack03_mixed_rule_string_add)
 {
     /*
      * author: Pawel Polawski
@@ -674,7 +675,7 @@ RUNNER_TEST(smack03_mixed_rule_string_add)
     smack_accesses_free(rules);
 }
 
-RUNNER_TEST(smack04_mixed_rule_string_have_access)
+RUNNER_TEST_SMACK(smack04_mixed_rule_string_have_access)
 {
     /*
      * author: Pawel Polawski
@@ -709,7 +710,7 @@ RUNNER_TEST(smack04_mixed_rule_string_have_access)
 // - smack_accesses_add_modify("subject", "object", "rwx", "rwx") should create empty rule
 //}
 
-RUNNER_TEST(smack05_self_label)
+RUNNER_TEST_SMACK(smack05_self_label)
 {
     /*
      * author: Pawel Polawski
@@ -1036,7 +1037,7 @@ RUNNER_TEST(smack08_f_get_set_label)
     close(fd);
 }
 
-RUNNER_TEST(smack10_adding_removing_rules)
+RUNNER_TEST_SMACK(smack10_adding_removing_rules)
 {
     unsigned int i;
     int result;
@@ -1185,7 +1186,7 @@ RUNNER_TEST(smack10_adding_removing_rules)
     }
 }
 
-RUNNER_TEST(smack11_saving_loading_rules)
+RUNNER_TEST_SMACK(smack11_saving_loading_rules)
 {
     int result;
     int fd;
@@ -1395,7 +1396,7 @@ static void smack_unix_sock_server(int sock)
     free(smack_label);
 }
 
-RUNNER_TEST(smack09_new_label_from_socket)
+RUNNER_TEST_SMACK(smack09_new_label_from_socket)
 {
     int pid;
     struct sockaddr_un sockaddr = {AF_UNIX, SOCK_PATH};
index 81ef57658e8b86ac137a1195a77d5ae3e6959074..875f28c66df7ca1049223be4b6a0827274b44274 100644 (file)
@@ -82,6 +82,7 @@ SET(SEC_SRV_MEASURER_SOURCES
 
 INCLUDE_DIRECTORIES(
     ${SEC_SRV_TESTS_DEP_INCLUDE_DIRS}
+    ${PROJECT_SOURCE_DIR}/tests/common/
    )
 
 ADD_DEFINITIONS("-I/usr/include/dbus-1.0/dbus")
@@ -99,28 +100,36 @@ ADD_EXECUTABLE(${TARGET_SEC_SRV_MEASURER} ${SEC_SRV_MEASURER_SOURCES})
 
 
 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_CLIENT_SMACK_TESTS}
-    ${SEC_SRV_TESTS_DEP_LIBRARIES})
+    ${SEC_SRV_TESTS_DEP_LIBRARIES}
+    tests-common)
 
 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_LABEL_TESTS}
-    ${SEC_SRV_TESTS_DEP_LIBRARIES})
+    ${SEC_SRV_TESTS_DEP_LIBRARIES}
+    tests-common)
 
 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_PID_TESTS}
-    ${SEC_SRV_TESTS_DEP_LIBRARIES})
+    ${SEC_SRV_TESTS_DEP_LIBRARIES}
+    tests-common)
 
 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_TC_SERVER_TESTS}
-    ${SEC_SRV_TESTS_DEP_LIBRARIES})
+    ${SEC_SRV_TESTS_DEP_LIBRARIES}
+    tests-common)
 
 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_PWD_TESTS}
-    ${SEC_SRV_TESTS_DEP_LIBRARIES})
+    ${SEC_SRV_TESTS_DEP_LIBRARIES}
+    tests-common)
 
 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MT_TESTS}
-    ${SEC_SRV_TESTS_DEP_LIBRARIES})
+    ${SEC_SRV_TESTS_DEP_LIBRARIES}
+    tests-common)
 
 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_DBUS_TESTS}
-    ${SEC_SRV_TESTS_DEP_LIBRARIES})
+    ${SEC_SRV_TESTS_DEP_LIBRARIES}
+    tests-common)
 
 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MEASURER}
-    ${SEC_SRV_TESTS_DEP_LIBRARIES})
+    ${SEC_SRV_TESTS_DEP_LIBRARIES}
+    tests-common)
 
 # Installation
 
index 4e7752c6429560ffb2a5377a32ebd0ebaf6a1854..940d1f751c4928f55cb756b5c9cfa3a8840d36e6 100644 (file)
@@ -22,6 +22,8 @@
 
 #include <security-server.h>
 
+#include "tests_common.h"
+
 #define ENVIRONMENT                                                       \
     do {                                                                  \
         const char *subject_label = "mylabel";                            \
@@ -63,7 +65,7 @@ RUNNER_TEST_GROUP_INIT(SECURITY_SERVER_TESTS_CLIENT_SMACK)
  * Any other size of cookies should be treated as error.
  * expected: Function security_server_get_cookie_size returns 20.
  */
-RUNNER_CHILD_TEST(tc01_security_server_get_cookie_size)
+RUNNER_CHILD_TEST_SMACK(tc01_security_server_get_cookie_size)
 {
     ENVIRONMENT;
 
@@ -78,7 +80,7 @@ RUNNER_CHILD_TEST(tc01_security_server_get_cookie_size)
  * expected: function will set up cookie in the array and return
  * SECURITY_SERVER_API_SUCCESS.
  */
-RUNNER_CHILD_TEST(tc02_security_server_request_cookie_normal_case)
+RUNNER_CHILD_TEST_SMACK(tc02_security_server_request_cookie_normal_case)
 {
     ENVIRONMENT;
 
@@ -95,7 +97,7 @@ RUNNER_CHILD_TEST(tc02_security_server_request_cookie_normal_case)
  * expected: function will set up cookie in the array and return
  * SECURITY_SERVER_API_SUCCESS.
  */
-RUNNER_CHILD_TEST(tc03_security_server_request_cookie_too_small_buffer_size)
+RUNNER_CHILD_TEST_SMACK(tc03_security_server_request_cookie_too_small_buffer_size)
 {
     ENVIRONMENT;
 
@@ -113,7 +115,7 @@ RUNNER_CHILD_TEST(tc03_security_server_request_cookie_too_small_buffer_size)
  *           SECURITY_SERVER_ERROR_NO_SUCH_OBJECT with first call
  *           and group id with second call
  */
-RUNNER_CHILD_TEST(tc04_security_server_get_gid)
+RUNNER_CHILD_TEST_SMACK(tc04_security_server_get_gid)
 {
     ENVIRONMENT;
 
@@ -133,7 +135,7 @@ RUNNER_CHILD_TEST(tc04_security_server_get_gid)
  * expected: Function call with access rights set to "r" should return SUCCESS,
  * with "rw" should return ACCESS DENIED.
  */
-RUNNER_CHILD_TEST(tc05_check_privilege_by_cookie)
+RUNNER_CHILD_TEST_SMACK(tc05_check_privilege_by_cookie)
 {
     char cookie[20];
     const char *object_label = "tc05objectlabel";
@@ -181,7 +183,7 @@ RUNNER_CHILD_TEST(tc05_check_privilege_by_cookie)
  * expected: Function call with access rights set to "r" should return SUCCESS,
  * with "rw" should return ACCESS DENIED.
  */
-RUNNER_TEST(tc06_check_privilege_by_sockfd)
+RUNNER_TEST_SMACK(tc06_check_privilege_by_sockfd)
 {
     const char *object_label = "tc06objectlabel";
     const char *access_rights = "r";
@@ -296,7 +298,7 @@ RUNNER_TEST(tc06_check_privilege_by_sockfd)
  * expected: Function call with access rights set to "r" should return SUCCESS,
  * with "rw" should return ACCESS DENIED.
  */
-RUNNER_TEST(tc07_check_privilege_by_sockfd)
+RUNNER_TEST_SMACK(tc07_check_privilege_by_sockfd)
 {
     const char *object_label = "tc07objectlabel";
     const char *access_rights = "r";
index 83c1b8bef2067b029ed5d503d1008330dcadb918..7c13abbfd08befc660dd087072bf8cd104dca72d 100644 (file)
@@ -7,6 +7,7 @@
 #include <dbus/dbus.h>
 #include <dbus-glib.h>
 #include <glib-object.h>
+#include "tests_common.h"
 #include "security-server.h"
 #include "privilege-control.h"
 
@@ -26,7 +27,7 @@
 
 RUNNER_TEST_GROUP_INIT(SECURITY_SERVER_TESTS_DBUS);
 
-RUNNER_TEST(tc01_smack_context_from_DBus)
+RUNNER_TEST_SMACK(tc01_smack_context_from_DBus)
 {
     int ret = -1;
     const char *subject_parent = "subject_parent";
index 19f3148affa4efe3a2dd3e181779391590dfd65c..83b15df132f4e1351e0d4299be413b228b6113aa 100644 (file)
 #include <security-server.h>
 #include <dpl/test/test_runner.h>
 #include <dlog.h>
+#include "tests_common.h"
 #include "test.h"
 
 RUNNER_TEST_GROUP_INIT(SECURITY_SERVER_TESTS_LABEL);
 
-RUNNER_TEST(tc_security_server_get_smacklabel_cookie) {
+RUNNER_TEST_SMACK(tc_security_server_get_smacklabel_cookie) {
     int res;
 
     pid_t mypid;
index fedd864d0c2b5a825d97ec8038347d6d3fa310e5..a5c3da194442d7707cd7cab3ac07b8d8dee68333 100644 (file)
@@ -28,6 +28,7 @@
 #include <dlog.h>
 #include <privilege-control.h>
 #include <ftw.h>
+#include "tests_common.h"
 #include "test.h"
 
 #define TEST03_SUBJECT  "subject_0f09f7cc"
@@ -471,7 +472,7 @@ RUNNER_TEST(tc_get_pid_of_null_cookie)
     RUNNER_ASSERT(security_server_get_cookie_pid(NULL) == SECURITY_SERVER_API_ERROR_INPUT_PARAM);
 }
 
-RUNNER_CHILD_TEST(tc01a_security_server_app_give_access)
+RUNNER_CHILD_TEST_SMACK(tc01a_security_server_app_give_access)
 {
     const char *subject = "abc345v34sfa";
     const char *object = "efg678x2lkjz";
@@ -517,7 +518,7 @@ RUNNER_CHILD_TEST(tc01a_security_server_app_give_access)
     RUNNER_ASSERT(0 == smack_have_access(subject, object, "----t"));
 }*/
 
-RUNNER_CHILD_TEST(tc01c_security_server_app_give_access_no_access)
+RUNNER_CHILD_TEST_SMACK(tc01c_security_server_app_give_access_no_access)
 {
     const char *subject = "xxx45v34sfa";
     const char *object = "yyy78x2lkjz";
@@ -540,7 +541,7 @@ RUNNER_CHILD_TEST(tc01c_security_server_app_give_access_no_access)
     RUNNER_ASSERT(0 == smack_have_access(subject, object, "r"));
 }
 
-RUNNER_TEST(tc02_check_privilege_by_pid)
+RUNNER_TEST_SMACK(tc02_check_privilege_by_pid)
 {
     int ret;
     int pid;
@@ -556,7 +557,7 @@ RUNNER_TEST(tc02_check_privilege_by_pid)
     RUNNER_ASSERT(ret != SECURITY_SERVER_API_SUCCESS);
 }
 
-RUNNER_CHILD_TEST(tc03_check_API_passwd_allow)
+RUNNER_CHILD_TEST_SMACK(tc03_check_API_passwd_allow)
 {
     int ret = -1;
     unsigned int attempt, max_attempt, expire_sec;
@@ -691,7 +692,7 @@ RUNNER_TEST(tc04_check_API_passwd_denied)
     free(str);
 }
 
-RUNNER_CHILD_TEST(tc05_check_API_middleware_allow)
+RUNNER_CHILD_TEST_SMACK(tc05_check_API_middleware_allow)
 {
     int ret = -1;
     const char *subject_allow = TEST05_SUBJECT;
@@ -789,7 +790,7 @@ RUNNER_TEST(tc06_check_API_middleware_denied)
     RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
 }
 
-RUNNER_CHILD_TEST(tc07_check_API_data_share_allow)
+RUNNER_CHILD_TEST_SMACK(tc07_check_API_data_share_allow)
 {
     int ret = -1;
     const char *subject_allow = TEST07_SUBJECT;
@@ -816,7 +817,7 @@ RUNNER_CHILD_TEST(tc07_check_API_data_share_allow)
     RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_SUCCESS, "ret: " << ret);
 }
 
-RUNNER_CHILD_TEST(tc08_check_API_data_share_denied)
+RUNNER_CHILD_TEST_SMACK(tc08_check_API_data_share_denied)
 {
     int ret = -1;
     const char *subject_denied = TEST08_SUBJECT;
index 3251c169cfc2dddc398f2961192c9cebfba26afa..92e0842ed0e9fbe41e18547758fd9ac43bc39e91 100644 (file)
@@ -8,7 +8,7 @@
  * @brief   Test cases for security server
  *
  */
-
+#include "tests_common.h"
 #include "security-server.h"
 #include <dpl/test/test_runner.h>
 #include <dpl/log/log.h>
@@ -163,7 +163,7 @@ RUNNER_TEST(tc05_security_server_check_privilege_by_cookie_weird_input_case)
     RUNNER_ASSERT_MSG(ret == SECURITY_SERVER_API_ERROR_INPUT_PARAM, "ret: " << ret);
 }
 
-RUNNER_TEST(tc06_security_server_check_privilege_by_sockfd_weird_input_case)
+RUNNER_TEST_SMACK(tc06_security_server_check_privilege_by_sockfd_weird_input_case)
 {
     int ret = 0;
     int sockfd = -1;