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<std::string, struct app_attributes> 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)
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)
{
--- /dev/null
+/*
+ * 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 <cstdint>
+#include <map>
+#include <string>
+#include <sys/smack.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <dpl/test/test_runner.h>
+#include <sm_api.h>
+#include <sm_commons.h>
+#include <sm_request.h>
+#include <tests_common.h>
+
+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<std::string, struct app_attributes> 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);
+ };
+}