Fix security_manager_11_security_manager_cmd_install
[platform/core/test/security-tests.git] / tests / security-manager-tests / security_manager_tests.cpp
index 0dfef82..6ab415e 100644 (file)
@@ -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) {