{
const char *const app_id = "sm_test_06_app_id_install_app_offline";
const char *const pkg_id = "sm_test_06_pkg_id_install_app_offline";
- ServiceManager serviceManager("security-manager.service");
+ // Uninstall app on-line, off-line mode doesn't support it
uninstall_app(app_id, pkg_id, true);
- serviceManager.maskService();
+
+ ServiceManager("security-manager.service").stopService();
+
+ ServiceManager serviceManager("security-manager.socket");
serviceManager.stopService();
install_app(app_id, pkg_id);
- serviceManager.unmaskService();
serviceManager.startService();
uninstall_app(app_id, pkg_id, true);
const char *const app_id = "security_manager_09_add_user_offline_app";
const char *const pkg_id = "security_manager_09_add_user_offline_pkg";
const std::string new_user_name("sm_test_09_user_name");
- ServiceManager serviceManager("security-manager.service");
- serviceManager.maskService();
+
+ ServiceManager("security-manager.service").stopService();
+
+ ServiceManager serviceManager("security-manager.socket");
serviceManager.stopService();
TemporaryTestUser test_user(new_user_name, GUM_USERTYPE_NORMAL, true);
check_app_after_install(app_id, pkg_id);
- serviceManager.unmaskService();
serviceManager.startService();
test_user.remove();
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;
{"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) {