From 839a8b38a957b9ae468830fe70ad63af630c0cfb Mon Sep 17 00:00:00 2001 From: Dariusz Michaluk Date: Fri, 14 Sep 2018 12:31:51 +0200 Subject: [PATCH] Adjust tests to security-manager changes This commit fix tests after introducing below change: https://review.tizen.org/gerrit/#/c/186449 Change-Id: I362e7fb774246f632f1c5d5ce6cca937b9703aae --- src/security-manager-tests/test_cases.cpp | 36 +++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/security-manager-tests/test_cases.cpp b/src/security-manager-tests/test_cases.cpp index 90fa13e7..2095709f 100644 --- a/src/security-manager-tests/test_cases.cpp +++ b/src/security-manager-tests/test_cases.cpp @@ -144,24 +144,22 @@ RUNNER_TEST(security_manager_01d_app_install_complicated_dir_tree) RUNNER_TEST(security_manager_02_app_install_uninstall_full) { - PolicyConfiguration policy; - PolicyConfiguration::PrivGroupMap privGroupMap = policy.getPrivGroupMap(); - - RUNNER_ASSERT_MSG(privGroupMap.size() >= 4, "Failed to get policy of a suitable size"); - - privileges_t allowedPrivs; - privileges_t someDeniedPrivs; - - int counter = 0; - for (auto const &it: privGroupMap) { - if (counter < 2) - allowedPrivs.push_back(it.first); - else if (counter < 4) - someDeniedPrivs.push_back(it.first); - else - break; - ++counter; - } + privileges_t defaultPrivs = { + "http://tizen.org/privilege/internal/device/audio", + "http://tizen.org/privilege/internal/device/display", + "http://tizen.org/privilege/internal/device/video" + }; + privileges_t allowedPrivs = { + "http://tizen.org/privilege/camera", + "http://tizen.org/privilege/mediastorage" + }; + privileges_t someDeniedPrivs = { + "http://tizen.org/privilege/internet", + "http://tizen.org/privilege/externalstorage" + }; + + privileges_t defaultAllowedPrivs = defaultPrivs; + defaultAllowedPrivs.insert(defaultAllowedPrivs.end(), allowedPrivs.begin(), allowedPrivs.end()); AppInstallHelper app("sm_test_02"); app.createPrivateDir(); @@ -173,7 +171,7 @@ RUNNER_TEST(security_manager_02_app_install_uninstall_full) ScopedInstaller appInstall(app); check_app_after_install(app.getAppId(), app.getPkgId(), - app.getPrivilegesNames(), someDeniedPrivs); + defaultAllowedPrivs, someDeniedPrivs); check_path(app.getPrivateDir(), generatePathRWLabel(app.getPkgId())); check_path(app.getPrivateRODir(), generatePathROLabel(app.getPkgId()), false); -- 2.34.1