From: Zofia Abramowska Date: Thu, 25 Aug 2016 14:56:48 +0000 (+0200) Subject: SM: Code cleanup - separate public sharing tests X-Git-Tag: security-manager_5.5_testing~20^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e75c4752ccba7a3b66a0a110dd52dda5f0e92011;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git SM: Code cleanup - separate public sharing tests Change-Id: Ifd5a6b6bc6e9983f728a3d04f5e0f8f6a2f0e074 --- diff --git a/src/security-manager-tests/CMakeLists.txt b/src/security-manager-tests/CMakeLists.txt index c17b71a1..c052611a 100644 --- a/src/security-manager-tests/CMakeLists.txt +++ b/src/security-manager-tests/CMakeLists.txt @@ -44,6 +44,7 @@ SET(SEC_MGR_SOURCES ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_dyntransition.cpp ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_privacy_manager.cpp ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_private_sharing.cpp + ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_public_sharing.cpp ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_register_paths.cpp ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_trusted_sharing.cpp ${PROJECT_SOURCE_DIR}/src/security-manager-tests/security_manager_tests.cpp diff --git a/src/security-manager-tests/security_manager_tests.cpp b/src/security-manager-tests/security_manager_tests.cpp index 5ecfda03..61dec7af 100644 --- a/src/security-manager-tests/security_manager_tests.cpp +++ b/src/security-manager-tests/security_manager_tests.cpp @@ -39,24 +39,6 @@ using namespace SecurityManagerTest; -void changeSecurityContext(const std::string& label, uid_t uid, gid_t gid) -{ - RUNNER_ASSERT_ERRNO_MSG(0 == smack_set_label_for_self(label.c_str()), - "Error in smack_set_label_for_self(" << label << ")"); - - RUNNER_ASSERT_ERRNO_MSG(0 == setgid(gid), "Error in setgid."); - RUNNER_ASSERT_ERRNO_MSG(0 == setuid(uid), "Error in setuid."); -} - -static const std::map MANY_APPS_PKGS = { - {"security_manager_10_app_1", {"security_manager_10_pkg_1", "2.1"}}, - {"security_manager_10_app_2", {"security_manager_10_pkg_2", "3.0"}}, - {"security_manager_10_app_3", {"security_manager_10_pkg_3", "2.1.1"}}, - {"security_manager_10_app_4", {"security_manager_10_pkg_4", "3.1"}}, - {"security_manager_10_app_5", {"security_manager_10_pkg_5", "2.2"}} -}; - - RUNNER_TEST_GROUP_INIT(SECRUTIY_MANAGER_POLICY) RUNNER_TEST(security_manager_18_user_cynara_policy) @@ -338,228 +320,7 @@ RUNNER_TEST(security_manager_22_groups_get) security_manager_groups_free(c_groups, count); } -namespace { -const int sm_app_shared_test_id = 27; -const char *const sm_app_shared_id = "sm_test_27_app_id_full"; -const char *const sm_app_shared_another_in_package_id = "sm_test_27_app_2_id_full"; -const char *const sm_pkg_shared_id = "sm_test_27_pkg_id_full"; - -void test_success_worker(const std::string &appName, int test_num) -{ - std::string SM_OWNER_RW_OTHERS_RO_PATH = genOwnerRWOthersROPath(test_num); - - changeSecurityContext(generateAppLabel(appName), APP_UID, APP_GID); - - RUNNER_ASSERT_ERRNO_MSG(::access(SM_OWNER_RW_OTHERS_RO_PATH.c_str(), R_OK|X_OK) != -1, - "access (" << SM_OWNER_RW_OTHERS_RO_PATH << ") from " << appName << " failed " << " to " << SM_OWNER_RW_OTHERS_RO_PATH ); -} - -void test_fail_worker(const std::string &appName, int test_num) -{ - std::string SM_OWNER_RW_OTHERS_RO_PATH = genOwnerRWOthersROPath(test_num); - - changeSecurityContext(generateAppLabel(appName), APP_UID, APP_GID); - - RUNNER_ASSERT_MSG(::access(SM_OWNER_RW_OTHERS_RO_PATH.c_str(), R_OK|X_OK) == -1, - "access (" << SM_OWNER_RW_OTHERS_RO_PATH << ") from " << appName - << " surprisingly succeeded, while expecting fail"); -} -} - -RUNNER_TEST_GROUP_INIT(SECURITY_MANAGER_PUBLIC_SHARING) - -RUNNER_TEST(security_manager_27a_API2X_app_install) -{ - std::string SM_RW_PATH = genRWPath(sm_app_shared_test_id); - std::string SM_RO_PATH = genROPath(sm_app_shared_test_id); - std::string SM_PUBLIC_RO_PATH = genPublicROPath(sm_app_shared_test_id); - std::string SM_OWNER_RW_OTHERS_RO_PATH = genOwnerRWOthersROPath(sm_app_shared_test_id); - prepare_app_env(sm_app_shared_test_id, true); - - // install other apps - for(const auto &app : MANY_APPS_PKGS) { - InstallRequest requestInst; - requestInst.setAppId(app.first.c_str()); - requestInst.setPkgId(app.second.package.c_str()); - requestInst.setAppTizenVersion(app.second.Tizen_ver.c_str()); - - Api::install(requestInst); - }; - - // install - { - InstallRequest requestInst; - requestInst.setAppId(sm_app_shared_id); - requestInst.setPkgId(sm_pkg_shared_id); - requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[0].c_str()); - requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[1].c_str()); - requestInst.addPath(SM_RW_PATH, SECURITY_MANAGER_PATH_RW); - requestInst.addPath(SM_RO_PATH, SECURITY_MANAGER_PATH_RO); - requestInst.addPath(SM_PUBLIC_RO_PATH, SECURITY_MANAGER_PATH_PUBLIC_RO); - requestInst.addPath(SM_OWNER_RW_OTHERS_RO_PATH, SECURITY_MANAGER_PATH_OWNER_RW_OTHER_RO); - requestInst.setAppTizenVersion("2.4"); - Api::install(requestInst); - } - - // another app in package - { - InstallRequest requestInst; - requestInst.setAppId(sm_app_shared_another_in_package_id); - requestInst.setPkgId(sm_pkg_shared_id); - requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[0].c_str()); - requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[1].c_str()); - requestInst.addPath(SM_OWNER_RW_OTHERS_RO_PATH, SECURITY_MANAGER_PATH_OWNER_RW_OTHER_RO); - requestInst.setAppTizenVersion("2.4"); - Api::install(requestInst); - } - - /* Check records in the security-manager database */ - check_app_after_install(sm_app_shared_id, sm_pkg_shared_id, - SM_ALLOWED_PRIVILEGES, SM_DENIED_PRIVILEGES, SM_ALLOWED_GROUPS); - /* Check records in the security-manager database */ - check_app_after_install(sm_app_shared_another_in_package_id, sm_pkg_shared_id, - SM_ALLOWED_PRIVILEGES, SM_DENIED_PRIVILEGES, SM_ALLOWED_GROUPS); - - /* TODO: add parameters to this function */ - check_app_path_after_install(sm_app_shared_test_id, sm_pkg_shared_id, true); - - RUNNER_ASSERT_ERRNO_MSG(::access(SM_OWNER_RW_OTHERS_RO_PATH.c_str(), R_OK|X_OK) != -1, "access (" << SM_OWNER_RW_OTHERS_RO_PATH << ") failed"); -} - -RUNNER_CHILD_TEST(security_manager_27b_owner_1_have_access) -{ - test_success_worker(sm_app_shared_id, sm_app_shared_test_id); -} - -RUNNER_CHILD_TEST(security_manager_27c_owner_2_have_access) -{ - test_success_worker(sm_app_shared_another_in_package_id, sm_app_shared_test_id); -} - -RUNNER_CHILD_TEST(security_manager_27d_API2X_apps_have_access_app_1) -{ - test_success_worker("security_manager_10_app_1", sm_app_shared_test_id); -} - -RUNNER_CHILD_TEST(security_manager_27e_API2X_apps_dont_have_access_app_2) -{ - test_fail_worker("security_manager_10_app_2", sm_app_shared_test_id); -} - -RUNNER_CHILD_TEST(security_manager_27f_API2X_apps_have_access_app_3) -{ - test_success_worker("security_manager_10_app_3", sm_app_shared_test_id); -} -RUNNER_CHILD_TEST(security_manager_27g_API2X_apps_dont_have_access_app_4) -{ - test_fail_worker("security_manager_10_app_4", sm_app_shared_test_id); -} - -RUNNER_CHILD_TEST(security_manager_27h_API2X_apps_have_access_app_5) -{ - test_success_worker("security_manager_10_app_5", sm_app_shared_test_id); -} - - -RUNNER_TEST(security_manager_27i_API2X_app_uninstall) -{ - { - InstallRequest requestUninst; - requestUninst.setAppId(sm_app_shared_id); - Api::uninstall(requestUninst); - } - { - InstallRequest requestUninst; - requestUninst.setAppId(sm_app_shared_another_in_package_id); - Api::uninstall(requestUninst); - } - - /* Check records in the security-manager database, - * all previously allowed privileges should be removed */ - check_app_after_uninstall(sm_app_shared_id, sm_pkg_shared_id, - SM_ALLOWED_PRIVILEGES, TestSecurityManagerDatabase::REMOVED); - check_app_after_uninstall(sm_app_shared_another_in_package_id, sm_pkg_shared_id, - SM_ALLOWED_PRIVILEGES, TestSecurityManagerDatabase::REMOVED); -} - -RUNNER_TEST(security_manager_27j_API30_app_install) -{ - std::string SM_RW_PATH = genRWPath(sm_app_shared_test_id); - std::string SM_RO_PATH = genROPath(sm_app_shared_test_id); - std::string SM_PUBLIC_RO_PATH = genPublicROPath(sm_app_shared_test_id); - std::string SM_OWNER_RW_OTHERS_RO_PATH = genOwnerRWOthersROPath(sm_app_shared_test_id); - prepare_app_env(sm_app_shared_test_id, true); - - // install - InstallRequest requestInst; - requestInst.setAppId(sm_app_shared_id); - requestInst.setPkgId(sm_pkg_shared_id); - requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[0].c_str()); - requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[1].c_str()); - requestInst.addPath(SM_RW_PATH, SECURITY_MANAGER_PATH_RW); - requestInst.addPath(SM_RO_PATH, SECURITY_MANAGER_PATH_RO); - requestInst.addPath(SM_PUBLIC_RO_PATH, SECURITY_MANAGER_PATH_PUBLIC_RO); - requestInst.addPath(SM_OWNER_RW_OTHERS_RO_PATH, SECURITY_MANAGER_PATH_OWNER_RW_OTHER_RO); - requestInst.setAppTizenVersion("3.0"); - - Api::install(requestInst); - - /* Check records in the security-manager database */ - check_app_after_install(sm_app_shared_id, sm_pkg_shared_id, - SM_ALLOWED_PRIVILEGES, SM_DENIED_PRIVILEGES, SM_ALLOWED_GROUPS); - - /* TODO: add parameters to this function */ - check_app_path_after_install(sm_app_shared_test_id, sm_pkg_shared_id, true); - - RUNNER_ASSERT_ERRNO_MSG(::access(SM_OWNER_RW_OTHERS_RO_PATH.c_str(), R_OK|X_OK) != -1, "access (" << SM_OWNER_RW_OTHERS_RO_PATH << ") failed"); -} - -RUNNER_CHILD_TEST(security_manager_27k_API30_apps_dont_have_access_app_1) -{ - test_fail_worker("security_manager_10_app_1", sm_app_shared_test_id); -} - -RUNNER_CHILD_TEST(security_manager_27l_API30_apps_dont_have_access_app_2) -{ - test_fail_worker("security_manager_10_app_2", sm_app_shared_test_id); -} - -RUNNER_CHILD_TEST(security_manager_27m_API30_apps_dont_have_access_app_3) -{ - test_fail_worker("security_manager_10_app_3", sm_app_shared_test_id); -} - -RUNNER_CHILD_TEST(security_manager_27n_API30_apps_dont_have_access_app_4) -{ - test_fail_worker("security_manager_10_app_4", sm_app_shared_test_id); -} - -RUNNER_CHILD_TEST(security_manager_27o_API30_apps_dont_have_access_app_5) -{ - test_fail_worker("security_manager_10_app_5", sm_app_shared_test_id); -} - -RUNNER_TEST(security_manager_27p_API30_app_uninstall) -{ - InstallRequest requestUninst; - requestUninst.setAppId(sm_app_shared_id); - - Api::uninstall(requestUninst); - - /* Check records in the security-manager database, - * all previously allowed privileges should be removed */ - check_app_after_uninstall(sm_app_shared_id, sm_pkg_shared_id, - SM_ALLOWED_PRIVILEGES, TestSecurityManagerDatabase::REMOVED); - - // install other apps - for(const auto &app : MANY_APPS_PKGS) { - InstallRequest requestUninst; - requestUninst.setAppId(app.first); - - Api::uninstall(requestUninst); - }; -} RUNNER_CHILD_TEST(security_manager_53_app_has_privilege) { diff --git a/src/security-manager-tests/test_cases_public_sharing.cpp b/src/security-manager-tests/test_cases_public_sharing.cpp new file mode 100644 index 00000000..8366fcb6 --- /dev/null +++ b/src/security-manager-tests/test_cases_public_sharing.cpp @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2016 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 +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace SecurityManagerTest; + +namespace { +const int sm_app_shared_test_id = 27; +const char *const sm_app_shared_id = "sm_test_27_app_id_full"; +const char *const sm_app_shared_another_in_package_id = "sm_test_27_app_2_id_full"; +const char *const sm_pkg_shared_id = "sm_test_27_pkg_id_full"; + +static const std::map MANY_APPS_PKGS = { + {"security_manager_10_app_1", {"security_manager_10_pkg_1", "2.1"}}, + {"security_manager_10_app_2", {"security_manager_10_pkg_2", "3.0"}}, + {"security_manager_10_app_3", {"security_manager_10_pkg_3", "2.1.1"}}, + {"security_manager_10_app_4", {"security_manager_10_pkg_4", "3.1"}}, + {"security_manager_10_app_5", {"security_manager_10_pkg_5", "2.2"}} +}; + +void changeSecurityContext(const std::string& label, uid_t uid, gid_t gid) +{ + RUNNER_ASSERT_ERRNO_MSG(0 == smack_set_label_for_self(label.c_str()), + "Error in smack_set_label_for_self(" << label << ")"); + + RUNNER_ASSERT_ERRNO_MSG(0 == setgid(gid), "Error in setgid."); + RUNNER_ASSERT_ERRNO_MSG(0 == setuid(uid), "Error in setuid."); +} + +void test_success_worker(const std::string &appName, int test_num) +{ + std::string SM_OWNER_RW_OTHERS_RO_PATH = genOwnerRWOthersROPath(test_num); + + changeSecurityContext(generateAppLabel(appName), APP_UID, APP_GID); + + RUNNER_ASSERT_ERRNO_MSG(::access(SM_OWNER_RW_OTHERS_RO_PATH.c_str(), R_OK|X_OK) != -1, + "access (" << SM_OWNER_RW_OTHERS_RO_PATH << ") from " << appName << " failed " << " to " << SM_OWNER_RW_OTHERS_RO_PATH ); +} + +void test_fail_worker(const std::string &appName, int test_num) +{ + std::string SM_OWNER_RW_OTHERS_RO_PATH = genOwnerRWOthersROPath(test_num); + + changeSecurityContext(generateAppLabel(appName), APP_UID, APP_GID); + + RUNNER_ASSERT_MSG(::access(SM_OWNER_RW_OTHERS_RO_PATH.c_str(), R_OK|X_OK) == -1, + "access (" << SM_OWNER_RW_OTHERS_RO_PATH << ") from " << appName + << " surprisingly succeeded, while expecting fail"); +} +} + +RUNNER_TEST_GROUP_INIT(SECURITY_MANAGER_PUBLIC_SHARING) + +RUNNER_TEST(security_manager_27a_API2X_app_install) +{ + std::string SM_RW_PATH = genRWPath(sm_app_shared_test_id); + std::string SM_RO_PATH = genROPath(sm_app_shared_test_id); + std::string SM_PUBLIC_RO_PATH = genPublicROPath(sm_app_shared_test_id); + std::string SM_OWNER_RW_OTHERS_RO_PATH = genOwnerRWOthersROPath(sm_app_shared_test_id); + prepare_app_env(sm_app_shared_test_id, true); + + // install other apps + for(const auto &app : MANY_APPS_PKGS) { + InstallRequest requestInst; + requestInst.setAppId(app.first.c_str()); + requestInst.setPkgId(app.second.package.c_str()); + requestInst.setAppTizenVersion(app.second.Tizen_ver.c_str()); + + Api::install(requestInst); + }; + + // install + { + InstallRequest requestInst; + requestInst.setAppId(sm_app_shared_id); + requestInst.setPkgId(sm_pkg_shared_id); + requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[0].c_str()); + requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[1].c_str()); + requestInst.addPath(SM_RW_PATH, SECURITY_MANAGER_PATH_RW); + requestInst.addPath(SM_RO_PATH, SECURITY_MANAGER_PATH_RO); + requestInst.addPath(SM_PUBLIC_RO_PATH, SECURITY_MANAGER_PATH_PUBLIC_RO); + requestInst.addPath(SM_OWNER_RW_OTHERS_RO_PATH, SECURITY_MANAGER_PATH_OWNER_RW_OTHER_RO); + requestInst.setAppTizenVersion("2.4"); + Api::install(requestInst); + } + + // another app in package + { + InstallRequest requestInst; + requestInst.setAppId(sm_app_shared_another_in_package_id); + requestInst.setPkgId(sm_pkg_shared_id); + requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[0].c_str()); + requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[1].c_str()); + requestInst.addPath(SM_OWNER_RW_OTHERS_RO_PATH, SECURITY_MANAGER_PATH_OWNER_RW_OTHER_RO); + requestInst.setAppTizenVersion("2.4"); + Api::install(requestInst); + } + + /* Check records in the security-manager database */ + check_app_after_install(sm_app_shared_id, sm_pkg_shared_id, + SM_ALLOWED_PRIVILEGES, SM_DENIED_PRIVILEGES, SM_ALLOWED_GROUPS); + /* Check records in the security-manager database */ + check_app_after_install(sm_app_shared_another_in_package_id, sm_pkg_shared_id, + SM_ALLOWED_PRIVILEGES, SM_DENIED_PRIVILEGES, SM_ALLOWED_GROUPS); + + /* TODO: add parameters to this function */ + check_app_path_after_install(sm_app_shared_test_id, sm_pkg_shared_id, true); + + RUNNER_ASSERT_ERRNO_MSG(::access(SM_OWNER_RW_OTHERS_RO_PATH.c_str(), R_OK|X_OK) != -1, "access (" << SM_OWNER_RW_OTHERS_RO_PATH << ") failed"); +} + +RUNNER_CHILD_TEST(security_manager_27b_owner_1_have_access) +{ + test_success_worker(sm_app_shared_id, sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27c_owner_2_have_access) +{ + test_success_worker(sm_app_shared_another_in_package_id, sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27d_API2X_apps_have_access_app_1) +{ + test_success_worker("security_manager_10_app_1", sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27e_API2X_apps_dont_have_access_app_2) +{ + test_fail_worker("security_manager_10_app_2", sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27f_API2X_apps_have_access_app_3) +{ + test_success_worker("security_manager_10_app_3", sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27g_API2X_apps_dont_have_access_app_4) +{ + test_fail_worker("security_manager_10_app_4", sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27h_API2X_apps_have_access_app_5) +{ + test_success_worker("security_manager_10_app_5", sm_app_shared_test_id); +} + + +RUNNER_TEST(security_manager_27i_API2X_app_uninstall) +{ + { + InstallRequest requestUninst; + requestUninst.setAppId(sm_app_shared_id); + Api::uninstall(requestUninst); + } + { + InstallRequest requestUninst; + requestUninst.setAppId(sm_app_shared_another_in_package_id); + Api::uninstall(requestUninst); + } + + /* Check records in the security-manager database, + * all previously allowed privileges should be removed */ + check_app_after_uninstall(sm_app_shared_id, sm_pkg_shared_id, + SM_ALLOWED_PRIVILEGES, TestSecurityManagerDatabase::REMOVED); + check_app_after_uninstall(sm_app_shared_another_in_package_id, sm_pkg_shared_id, + SM_ALLOWED_PRIVILEGES, TestSecurityManagerDatabase::REMOVED); +} + +RUNNER_TEST(security_manager_27j_API30_app_install) +{ + std::string SM_RW_PATH = genRWPath(sm_app_shared_test_id); + std::string SM_RO_PATH = genROPath(sm_app_shared_test_id); + std::string SM_PUBLIC_RO_PATH = genPublicROPath(sm_app_shared_test_id); + std::string SM_OWNER_RW_OTHERS_RO_PATH = genOwnerRWOthersROPath(sm_app_shared_test_id); + prepare_app_env(sm_app_shared_test_id, true); + + // install + InstallRequest requestInst; + requestInst.setAppId(sm_app_shared_id); + requestInst.setPkgId(sm_pkg_shared_id); + requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[0].c_str()); + requestInst.addPrivilege(SM_ALLOWED_PRIVILEGES[1].c_str()); + requestInst.addPath(SM_RW_PATH, SECURITY_MANAGER_PATH_RW); + requestInst.addPath(SM_RO_PATH, SECURITY_MANAGER_PATH_RO); + requestInst.addPath(SM_PUBLIC_RO_PATH, SECURITY_MANAGER_PATH_PUBLIC_RO); + requestInst.addPath(SM_OWNER_RW_OTHERS_RO_PATH, SECURITY_MANAGER_PATH_OWNER_RW_OTHER_RO); + requestInst.setAppTizenVersion("3.0"); + + Api::install(requestInst); + + /* Check records in the security-manager database */ + check_app_after_install(sm_app_shared_id, sm_pkg_shared_id, + SM_ALLOWED_PRIVILEGES, SM_DENIED_PRIVILEGES, SM_ALLOWED_GROUPS); + + /* TODO: add parameters to this function */ + check_app_path_after_install(sm_app_shared_test_id, sm_pkg_shared_id, true); + + RUNNER_ASSERT_ERRNO_MSG(::access(SM_OWNER_RW_OTHERS_RO_PATH.c_str(), R_OK|X_OK) != -1, "access (" << SM_OWNER_RW_OTHERS_RO_PATH << ") failed"); +} + +RUNNER_CHILD_TEST(security_manager_27k_API30_apps_dont_have_access_app_1) +{ + test_fail_worker("security_manager_10_app_1", sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27l_API30_apps_dont_have_access_app_2) +{ + test_fail_worker("security_manager_10_app_2", sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27m_API30_apps_dont_have_access_app_3) +{ + test_fail_worker("security_manager_10_app_3", sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27n_API30_apps_dont_have_access_app_4) +{ + test_fail_worker("security_manager_10_app_4", sm_app_shared_test_id); +} + +RUNNER_CHILD_TEST(security_manager_27o_API30_apps_dont_have_access_app_5) +{ + test_fail_worker("security_manager_10_app_5", sm_app_shared_test_id); +} + +RUNNER_TEST(security_manager_27p_API30_app_uninstall) +{ + InstallRequest requestUninst; + requestUninst.setAppId(sm_app_shared_id); + + Api::uninstall(requestUninst); + + /* Check records in the security-manager database, + * all previously allowed privileges should be removed */ + check_app_after_uninstall(sm_app_shared_id, sm_pkg_shared_id, + SM_ALLOWED_PRIVILEGES, TestSecurityManagerDatabase::REMOVED); + + // install other apps + for(const auto &app : MANY_APPS_PKGS) { + InstallRequest requestUninst; + requestUninst.setAppId(app.first); + + Api::uninstall(requestUninst); + }; +}