SM: Use TzPlatformConfig for global app dir
[platform/core/test/security-tests.git] / src / security-manager-tests / common / tzplatform.cpp
index 8484cb9..315bb48 100644 (file)
@@ -61,5 +61,18 @@ const std::string appDirPath(const TemporaryTestUser &user, const std::string &a
     return std::string(appDir) + "/" + pkgId + "/" + appId;
 }
 
+const std::string globalAppDir()
+{
+    struct tzplatform_context *tzCtxPtr = nullptr;
+
+    RUNNER_ASSERT_MSG(0 == tzplatform_context_create(&tzCtxPtr), "Couldn't create tzplatform context");
+    TzPlatformContextPtr tzCtxPtrSmart(tzCtxPtr);
+
+    const char *appDir = tzplatform_context_getenv(tzCtxPtr, TZ_SYS_RW_APP);
+    RUNNER_ASSERT_MSG(nullptr != appDir,
+                      "tzplatform_context_getenv failed for getting sys rw app");
+    return appDir;
+}
+
 }