Fix security_manager_11_security_manager_cmd_install 63/36063/4
authorRafal Krypa <r.krypa@samsung.com>
Fri, 27 Feb 2015 14:23:54 +0000 (15:23 +0100)
committerRafal Krypa <r.krypa@samsung.com>
Mon, 2 Mar 2015 14:49:12 +0000 (15:49 +0100)
- adapt to new path types (private => writable, public => readable)
- use proper application directories

Change-Id: I1556fbf7bdbd1ec23ac9750c686ac2b4b62c0ef6
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
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) {