security-manager-tests: install global apps to /opt/usr/apps, not /usr/apps 24/65124/1
authorRafal Krypa <r.krypa@samsung.com>
Tue, 5 Apr 2016 11:04:21 +0000 (13:04 +0200)
committerRafal Krypa <r.krypa@samsung.com>
Thu, 7 Apr 2016 09:29:22 +0000 (11:29 +0200)
Directory /usr/apps is now only for preloaded applications (TZ_SYS_RO_APP).
Security-manager tests install some global applications, hence it should use
/opt/usr/apps (TZ_SYS_RW_APP).

It should be fixed to rely on tizen-platform-config instead of hardcoding those
paths.

Change-Id: Ia82809ea21badff95b7b6c2e6be2e5d9789db1ab

packaging/security-tests.spec
src/security-manager-tests/CMakeLists.txt
src/security-manager-tests/common/app_install_helper.h
src/security-manager-tests/security_manager_tests.cpp

index 0769110..9f5a118 100644 (file)
@@ -83,7 +83,7 @@ echo "security-tests postinst done ..."
 /usr/bin/security-manager-tests
 /etc/smack/test_smack_rules
 /etc/smack/test_smack_rules_lnk
-/usr/apps/*
+/opt/usr/apps/*
 /usr/bin/cynara-test
 /usr/bin/ckm-tests
 /usr/bin/ckm-integration-tests
index a5182ef..e9bd7f5 100644 (file)
@@ -81,5 +81,5 @@ INSTALL(TARGETS ${TARGET_SEC_MGR_TESTS} DESTINATION /usr/bin)
 
 INSTALL(DIRECTORY
     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/app_files/
-    DESTINATION /usr/apps/
+    DESTINATION /opt/usr/apps/
 )
index a89db84..597e021 100644 (file)
@@ -29,7 +29,7 @@ struct AppInstallHelper {
     {}
 
     std::string getInstallDir() {
-        return "/usr/apps/" + getPkgId();
+        return "/opt/usr/apps/" + getPkgId();
     }
 
     std::string getTrustedDir(int i = 0) {
index 73e6c21..a878baf 100644 (file)
@@ -78,7 +78,7 @@ void changeSecurityContext(const std::string& label, uid_t uid, gid_t gid)
 std::string genPath(int app_num, const char *postfix) {
     char buf[16];
     sprintf(buf, "%02d", app_num);
-    return std::string("/usr/apps/sm_test_") + std::string(buf) + std::string("_pkg_id_full/") + std::string(postfix);
+    return std::string("/opt/usr/apps/sm_test_") + std::string(buf) + std::string("_pkg_id_full/") + std::string(postfix);
 }
 std::string genRWPath(int app_num) {
     return genPath(app_num, "app_dir");
@@ -93,10 +93,10 @@ std::string genOwnerRWOthersROPath(int app_num) {
     return genPath(app_num, "app_dir_rw_others_ro");
 }
 
-static const char *const SM_RW_PATH = "/usr/apps/sm_test_02_pkg_id_full/app_dir";
+static const char *const SM_RW_PATH = "/opt/usr/apps/sm_test_02_pkg_id_full/app_dir";
 
-static const char *const SM_DENIED_PATH = "/usr/apps/non_app_dir";
-static const char *const SM_TRUSTED_PATH = "/usr/apps/sm_test_02_pkg_id_full/app_dir_trusted";
+static const char *const SM_DENIED_PATH = "/opt/usr/apps/non_app_dir";
+static const char *const SM_TRUSTED_PATH = "/opt/usr/apps/sm_test_02_pkg_id_full/app_dir_trusted";
 
 static const char *const ANY_USER_REPRESENTATION = "anyuser";/*this may be actually any string*/
 static const std::string EXEC_FILE("exec");