From 5e509f0bb39dcb9b906687306185c5cc02293361 Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Fri, 27 Feb 2015 15:23:54 +0100 Subject: [PATCH] Fix security_manager_11_security_manager_cmd_install - adapt to new path types (private => writable, public => readable) - use proper application directories Change-Id: I1556fbf7bdbd1ec23ac9750c686ac2b4b62c0ef6 Signed-off-by: Rafal Krypa --- tests/security-manager-tests/security_manager_tests.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/security-manager-tests/security_manager_tests.cpp b/tests/security-manager-tests/security_manager_tests.cpp index 0dfef82..6ab415e 100644 --- a/tests/security-manager-tests/security_manager_tests.cpp +++ b/tests/security-manager-tests/security_manager_tests.cpp @@ -2110,14 +2110,14 @@ RUNNER_CHILD_TEST(security_manager_11_security_manager_cmd_install) TemporaryTestUser user(username, GUM_USERTYPE_NORMAL, true); user.create(); user.getUidString(uid_string); - const std::string path1 = "/home/" + username + "/p1"; - const std::string path2 = "/home/" + username + "/p2"; + const std::string path1 = appDirPath(user, app_id, pkg_id) + "/p1"; + const std::string path2 = appDirPath(user, app_id, pkg_id) + "/p2"; const std::string pkgopt = " --pkg=" + pkg_id; const std::string appopt = " --app=" + app_id; const std::string uidopt = " --uid=" + uid_string; - mkdir(path1.c_str(), 0); - mkdir(path2.c_str(), 0); + mktreeSafe(path1.c_str(), 0); + mktreeSafe(path2.c_str(), 0); const std::string installcmd = "security-manager-cmd --install " + appopt + pkgopt + uidopt; @@ -2134,11 +2134,11 @@ RUNNER_CHILD_TEST(security_manager_11_security_manager_cmd_install) {"security-manager-cmd --i --app=app_id_10 --pkg=pkg_id_10", FAILURE},//no uid {installcmd, SUCCESS}, {"security-manager-cmd -i -a" + app_id + " -g" + pkg_id + uidopt, SUCCESS}, - {installcmd + " --path " + path1 + " private", SUCCESS}, + {installcmd + " --path " + path1 + " writable", SUCCESS}, {installcmd + " --path " + path1, FAILURE},//no path type - {installcmd + " --path " + path1 + " private" + " --path " + path2 + " private", SUCCESS}, - {installcmd + " --path " + path1 + " prie" + " --path " + path2 + " public", FAILURE},//wrong path type - {installcmd + " --path " + path1 + " private" + " --privilege somepriv --privilege somepriv2" , SUCCESS}, + {installcmd + " --path " + path1 + " writable" + " --path " + path2 + " readable", SUCCESS}, + {installcmd + " --path " + path1 + " prie" + " --path " + path2 + " readable", FAILURE},//wrong path type + {installcmd + " --path " + path1 + " writable" + " --privilege somepriv --privilege somepriv2" , SUCCESS}, }; for (auto &op : operations) { -- 2.7.4