From 9ab5fcd2c0521108fa82501a3c3fb3dc35b8f33b Mon Sep 17 00:00:00 2001 From: Satyajit Anand Date: Thu, 1 Dec 2016 16:57:32 +0530 Subject: [PATCH] [ITC/UTC][accounts-svc][NonACR][Implemented execution logic for rpm and tpk approach in multi-user environment] Change-Id: If063fdb9705c7ba8559658dc7f18f2ef9ccece78 Signed-off-by: Satyajit Anand --- scripts_tpk/tpk_create.sh | 16 --- src/itc/accounts-svc/ITs-accounts-svc-common.c | 26 +++- src/itc/accounts-svc/ITs-accounts-svc-common.h | 7 +- src/itc/accounts-svc/ITs-accounts-svc.c | 159 ++++++++++++++++--------- src/utc/accounts-svc/utc-accounts-svc.c | 117 +++++++++++++++--- 5 files changed, 228 insertions(+), 97 deletions(-) diff --git a/scripts_tpk/tpk_create.sh b/scripts_tpk/tpk_create.sh index 95b712c..a38cd0a 100755 --- a/scripts_tpk/tpk_create.sh +++ b/scripts_tpk/tpk_create.sh @@ -316,16 +316,6 @@ deploySourceFile() { fi fi - if [ $MODULE_NAME == "accounts-svc" ]; then - if [ "$5" == "utc" ]; then - sed -i -e 's:/usr/apps/core-accounts-svc-tests/:/opt/usr/home/owner/apps_rw/org.tizen.accounts-svc-native-utc/:g' $1/src/utc-accounts-svc.c - sed -i -e 's/core.accounts-svc-tests/org.tizen.accounts-svc-native-utc/g' $1/src/utc-accounts-svc.c - elif [ "$5" == "itc" ]; then - sed -i -e 's:/usr/apps/native-accounts-svc-itc/:/opt/usr/home/owner/apps_rw/org.tizen.accounts-svc-native-itc/:g' $1/inc/ITs-accounts-svc-common.h - sed -i -e 's/native.accounts-svc-itc/org.tizen.accounts-svc-native-itc/g' $1/inc/ITs-accounts-svc-common.h - fi - fi - if [ $MODULE_NAME == "iotcon" ]; then if [ "$5" == "utc" ]; then sed -i -e 's/core-iotcon-tests/org.tizen.iotcon-native-utc/g' $1/src/utc-iotcon-common.c @@ -334,12 +324,6 @@ deploySourceFile() { fi fi - if [ $MODULE_NAME == "capi-media-tool" ]; then - if [ "$5" == "itc" ]; then - sed -i -e 's:/usr/apps/native-capi-media-tool-itc/:/home/owner/apps_rw/org.tizen.capi-media-tool-native-itc/:g' $1/inc/ITs-capi-media-tool-common.h - fi - fi - if [ $MODULE_NAME == "metadata-editor" ]; then if [ "$5" == "utc" ]; then sed -i -e 's/core-metadata-editor-tests/org.tizen.metadata-editor-native-utc/g' $1/src/utc-metadata-editor.c diff --git a/src/itc/accounts-svc/ITs-accounts-svc-common.c b/src/itc/accounts-svc/ITs-accounts-svc-common.c index ba901e3..095a91d 100755 --- a/src/itc/accounts-svc/ITs-accounts-svc-common.c +++ b/src/itc/accounts-svc/ITs-accounts-svc-common.c @@ -203,4 +203,28 @@ char* AccountGetSyncState(int nRet) return pszTypeVal; } -/** @} */ \ No newline at end of file +/** +* @function AppGetError +* @description Maps error enums to string values +* @parameter nRet : error code returned +* @return error string +*/ +char* AppGetError(int nRet) +{ + char *szErrorVal = NULL; + + switch ( nRet ) + { + case APP_ERROR_NONE : szErrorVal = "APP_ERROR_NONE"; break; + case APP_ERROR_INVALID_PARAMETER: szErrorVal = "APP_ERROR_INVALID_PARAMETER"; break; + case APP_ERROR_OUT_OF_MEMORY: szErrorVal = "APP_ERROR_OUT_OF_MEMORY"; break; + case APP_ERROR_INVALID_CONTEXT: szErrorVal = "APP_ERROR_INVALID_CONTEXT"; break; + case APP_ERROR_NO_SUCH_FILE: szErrorVal = "APP_ERROR_NO_SUCH_FILE"; break; + case APP_ERROR_ALREADY_RUNNING: szErrorVal = "APP_ERROR_ALREADY_RUNNING"; break; + default: szErrorVal = "Undefined error"; break; + } + + return szErrorVal; +} + +/** @} */ diff --git a/src/itc/accounts-svc/ITs-accounts-svc-common.h b/src/itc/accounts-svc/ITs-accounts-svc-common.h index 2692c5b..ef76b99 100755 --- a/src/itc/accounts-svc/ITs-accounts-svc-common.h +++ b/src/itc/accounts-svc/ITs-accounts-svc-common.h @@ -42,10 +42,12 @@ #define BUFFER 20 #define CALENDAR_CAPABILITY "http://tizen.org/account/capability/calendar" #define CONTACT_CAPABILITY "http://tizen.org/account/capability/contact" -#define ACCOUNT_ICON_PATH "/org.tizen.accounts-svc-native-itc/shared/res/account.png" -#define ACCOUNT_SMALL_ICON_PATH "/org.tizen.accounts-svc-native-itc/shared/res/account_small.png" +#define ACCOUNT_ICON_PATH "/shared/res/account.png" +#define ACCOUNT_SMALL_ICON_PATH "/shared/res/account_small.png" #define SERVICE_PROVIDER_ID "http://www.tizen.org/" #define MULTIPLE_ACCOUNT_SUPPORT 1 +#define RPM_INSTALL_LOCATION "/usr/apps/native-accounts-svc-itc" +#define TPK_APP_PREFIX "org.tizen." #define START_TEST {\ @@ -80,6 +82,7 @@ char* AccountGetAuthType(int nRet); char* AccountGetSyncState(int nRet); bool AccManagerAppendToAppDataPath(char* pInputPath, char* pFinalPath); bool AccManagerGetDataPath(char* pAppDataPath); +char* AppGetError(int nRet); /************************************************************************/ /** @} */ #endif //_ITS_ACCOUNTS_SVC_COMMON_H_ diff --git a/src/itc/accounts-svc/ITs-accounts-svc.c b/src/itc/accounts-svc/ITs-accounts-svc.c index 92ed74b..576540b 100644 --- a/src/itc/accounts-svc/ITs-accounts-svc.c +++ b/src/itc/accounts-svc/ITs-accounts-svc.c @@ -1746,9 +1746,59 @@ int ITc_account_type_get_icon_path_p(void) return 1; } - account_type_h accountTypeHandle; + char* psz_pkg_id = NULL; + int nRet = app_get_id(&psz_pkg_id); + PRINT_RESULT(APP_ERROR_NONE, nRet, "app_get_id", AppGetError(nRet)); + FPRINTF("[Line : %d][%s] app_get_id returned value = %s\\n", __LINE__, API_NAMESPACE, psz_pkg_id); + if(0 == strncmp(TPK_APP_PREFIX,psz_pkg_id, strlen(TPK_APP_PREFIX))) + { + FPRINTF("[Line : %d][%s] Detected TPK execution\\n", __LINE__, API_NAMESPACE); + if (true == GetValueForTCTSetting("DEVICE_EXECUTION_MODE_30", pszUser, API_NAMESPACE)) + { + if (!strcmp(pszUser, "owner")) + { + if (true != GetValueForTCTSetting("DEVICE_ADMIN_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) + { + FREE_MEMORY(psz_pkg_id); + FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_ADMIN_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); + return 1; + } + } + else + { + if (true != GetValueForTCTSetting("DEVICE_OTHER_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) + { + FREE_MEMORY(psz_pkg_id); + FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_OTHER_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); + return 1; + } + } + FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); + int path_size = strlen(pszValue) + strlen(psz_pkg_id) + strlen(ACCOUNT_ICON_PATH) + 2; + pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); + snprintf(pszACTUAL_FILE_PATH, path_size, "%s/%s%s", pszValue, psz_pkg_id, ACCOUNT_ICON_PATH); + FREE_MEMORY(psz_pkg_id); + } + else + { + FREE_MEMORY(psz_pkg_id); + FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_EXECUTION_MODE_30) failed\\n", __LINE__, API_NAMESPACE); + return 1; + } + } + else + { + FREE_MEMORY(psz_pkg_id); + FPRINTF("[Line : %d][%s] Detected RPM execution\\n", __LINE__, API_NAMESPACE); + + int path_size = strlen(RPM_INSTALL_LOCATION) + strlen(ACCOUNT_ICON_PATH) + 1; + pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); + snprintf(pszACTUAL_FILE_PATH, path_size, "%s%s", RPM_INSTALL_LOCATION, ACCOUNT_ICON_PATH); + } + FPRINTF("[Line : %d][%s] pszACTUAL_FILE_PATH = %s\\n", __LINE__, API_NAMESPACE, pszACTUAL_FILE_PATH); - int nRet = account_type_create(&accountTypeHandle); + account_type_h accountTypeHandle; + nRet = account_type_create(&accountTypeHandle); PRINT_RESULT(ACCOUNT_ERROR_NONE, nRet, "account_type_create", AccManagerGetErrorMSG(nRet)); if ( accountTypeHandle == NULL ) { @@ -1762,36 +1812,6 @@ int ITc_account_type_get_icon_path_p(void) nRet = account_type_get_icon_path(accountTypeHandle, &pszGetIconPath); PRINT_RESULT_CLEANUP(ACCOUNT_ERROR_NONE, nRet, "account_type_get_icon_path", AccManagerGetErrorMSG(nRet),AcountTypeDestroyHelper(accountTypeHandle)); - if (true == GetValueForTCTSetting("DEVICE_EXECUTION_MODE_30", pszUser, API_NAMESPACE)) - { - if (!strcmp(pszUser, "owner")) - { - if (true != GetValueForTCTSetting("DEVICE_ADMIN_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) - { - FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_ADMIN_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); - return 1; - } - } - else - { - if (true != GetValueForTCTSetting("DEVICE_OTHER_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) - { - FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_OTHER_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); - return 1; - } - } - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); - int path_size = strlen(pszValue) + strlen(ACCOUNT_ICON_PATH) + 1; - pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); - snprintf(pszACTUAL_FILE_PATH, path_size, "%s%s", pszValue, ACCOUNT_ICON_PATH); - } - else - { - FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_EXECUTION_MODE_30) failed\\n", __LINE__, API_NAMESPACE); - return 1; - } - FPRINTF("[Line : %d][%s] pszACTUAL_FILE_PATH = %s\\n", __LINE__, API_NAMESPACE, pszACTUAL_FILE_PATH); - if(pszGetIconPath == NULL) { FPRINTF("[Line : %d][%s] account_type_get_icon_path API Call Failed as pszGetIconPath is NULL\\n", __LINE__, API_NAMESPACE); @@ -1893,47 +1913,68 @@ int ITc_account_type_get_small_icon_path_p(void) return 1; } - account_type_h accountTypeHandle; - - int nRet = account_type_create(&accountTypeHandle); - PRINT_RESULT(ACCOUNT_ERROR_NONE, nRet, "account_type_create", AccManagerGetErrorMSG(nRet)); - - nRet = account_type_query_by_app_id(g_pstrAppId, &accountTypeHandle); - PRINT_RESULT_CLEANUP(ACCOUNT_ERROR_NONE, nRet, "account_type_query_by_app_id", AccManagerGetErrorMSG(nRet),AcountTypeDestroyHelper(accountTypeHandle)); - - nRet = account_type_get_small_icon_path(accountTypeHandle, &pszGetIconPath); - PRINT_RESULT_CLEANUP(ACCOUNT_ERROR_NONE, nRet, "account_type_get_small_icon_path", AccManagerGetErrorMSG(nRet),AcountTypeDestroyHelper(accountTypeHandle)); - - if (true == GetValueForTCTSetting("DEVICE_EXECUTION_MODE_30", pszUser, API_NAMESPACE)) + char* psz_pkg_id = NULL; + int nRet = app_get_id(&psz_pkg_id); + PRINT_RESULT(APP_ERROR_NONE, nRet, "app_get_id", AppGetError(nRet)); + FPRINTF("[Line : %d][%s] app_get_id returned value = %s\\n", __LINE__, API_NAMESPACE, psz_pkg_id); + if(0 == strncmp(TPK_APP_PREFIX,psz_pkg_id, strlen(TPK_APP_PREFIX))) { - if (!strcmp(pszUser, "owner")) + FPRINTF("[Line : %d][%s] Detected TPK execution\\n", __LINE__, API_NAMESPACE); + if (true == GetValueForTCTSetting("DEVICE_EXECUTION_MODE_30", pszUser, API_NAMESPACE)) { - if (true != GetValueForTCTSetting("DEVICE_ADMIN_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) + if (!strcmp(pszUser, "owner")) { - FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_ADMIN_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); - return 1; + if (true != GetValueForTCTSetting("DEVICE_ADMIN_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) + { + FREE_MEMORY(psz_pkg_id); + FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_ADMIN_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); + return 1; + } + } + else + { + if (true != GetValueForTCTSetting("DEVICE_OTHER_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) + { + FREE_MEMORY(psz_pkg_id); + FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_OTHER_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); + return 1; + } } + FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); + int path_size = strlen(pszValue) + strlen(psz_pkg_id) + strlen(ACCOUNT_SMALL_ICON_PATH) + 2; + pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); + snprintf(pszACTUAL_FILE_PATH, path_size, "%s/%s%s", pszValue, psz_pkg_id, ACCOUNT_SMALL_ICON_PATH); + FREE_MEMORY(psz_pkg_id); } else { - if (true != GetValueForTCTSetting("DEVICE_OTHER_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) - { - FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_OTHER_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); - return 1; - } + FREE_MEMORY(psz_pkg_id); + FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_EXECUTION_MODE_30) failed\\n", __LINE__, API_NAMESPACE); + return 1; } - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); - int path_size = strlen(pszValue) + strlen(ACCOUNT_SMALL_ICON_PATH) + 1; - pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); - snprintf(pszACTUAL_FILE_PATH, path_size, "%s%s", pszValue, ACCOUNT_SMALL_ICON_PATH); } else { - FPRINTF("[Line : %d][%s] GetValueForTCTSetting(DEVICE_EXECUTION_MODE_30) failed\\n", __LINE__, API_NAMESPACE); - return 1; + FREE_MEMORY(psz_pkg_id); + FPRINTF("[Line : %d][%s] Detected RPM execution\\n", __LINE__, API_NAMESPACE); + + int path_size = strlen(RPM_INSTALL_LOCATION) + strlen(ACCOUNT_SMALL_ICON_PATH) + 1; + pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); + snprintf(pszACTUAL_FILE_PATH, path_size, "%s%s", RPM_INSTALL_LOCATION, ACCOUNT_SMALL_ICON_PATH); } FPRINTF("[Line : %d][%s] pszACTUAL_FILE_PATH = %s\\n", __LINE__, API_NAMESPACE, pszACTUAL_FILE_PATH); + account_type_h accountTypeHandle; + + nRet = account_type_create(&accountTypeHandle); + PRINT_RESULT(ACCOUNT_ERROR_NONE, nRet, "account_type_create", AccManagerGetErrorMSG(nRet)); + + nRet = account_type_query_by_app_id(g_pstrAppId, &accountTypeHandle); + PRINT_RESULT_CLEANUP(ACCOUNT_ERROR_NONE, nRet, "account_type_query_by_app_id", AccManagerGetErrorMSG(nRet),AcountTypeDestroyHelper(accountTypeHandle)); + + nRet = account_type_get_small_icon_path(accountTypeHandle, &pszGetIconPath); + PRINT_RESULT_CLEANUP(ACCOUNT_ERROR_NONE, nRet, "account_type_get_small_icon_path", AccManagerGetErrorMSG(nRet),AcountTypeDestroyHelper(accountTypeHandle)); + if(pszGetIconPath == NULL) { FPRINTF("[Line : %d][%s] account_type_get_small_icon_path API Call Failed as pszGetIconPath is NULL\\n", __LINE__, API_NAMESPACE); diff --git a/src/utc/accounts-svc/utc-accounts-svc.c b/src/utc/accounts-svc/utc-accounts-svc.c index fe084f1..8ca4ac5 100644 --- a/src/utc/accounts-svc/utc-accounts-svc.c +++ b/src/utc/accounts-svc/utc-accounts-svc.c @@ -20,15 +20,20 @@ #include #include #include +#include +#include #define TEST_PACKAGE_NAME "core.accounts-svc-tests" // app_id #define USER_NAME "user_name" -#define ICON_PATH "/org.tizen.accounts-svc-native-utc/shared/res/account.png" -#define SMALL_ICON_PATH "/org.tizen.accounts-svc-native-utc/shared/res/account_small.png" +#define ICON_PATH "/shared/res/account.png" +#define SMALL_ICON_PATH "/shared/res/account_small.png" #define LABEL_DEFAULT "AccountTest" #define LABEL_EN_GB "English AccountTest" #define SERVICE_PROVIDER_ID "http://www.tizen.org/" #define BUFFERSIZE 1024 +#define RPM_INSTALL_LOCATION "/usr/apps/core-accounts-svc-tests" +#define TPK_APP_PREFIX "org.tizen." +#define API_NAMESPACE "accounts-svc" #define check_fail(exp) \ @@ -75,6 +80,30 @@ static gboolean timeout_cb(gpointer data) { } /** +* @function AppGetError +* @description Maps error enums to string values +* @parameter nRet : error code returned +* @return error string +*/ +char* AppGetError(int nRet) +{ + char *szErrorVal = NULL; + + switch ( nRet ) + { + case APP_ERROR_NONE : szErrorVal = "APP_ERROR_NONE"; break; + case APP_ERROR_INVALID_PARAMETER: szErrorVal = "APP_ERROR_INVALID_PARAMETER"; break; + case APP_ERROR_OUT_OF_MEMORY: szErrorVal = "APP_ERROR_OUT_OF_MEMORY"; break; + case APP_ERROR_INVALID_CONTEXT: szErrorVal = "APP_ERROR_INVALID_CONTEXT"; break; + case APP_ERROR_NO_SUCH_FILE: szErrorVal = "APP_ERROR_NO_SUCH_FILE"; break; + case APP_ERROR_ALREADY_RUNNING: szErrorVal = "APP_ERROR_ALREADY_RUNNING"; break; + default: szErrorVal = "Undefined error"; break; + } + + return szErrorVal; +} + +/** * @function utc_account_startup * @description Called before each test * @parameter NA @@ -120,26 +149,76 @@ char *_account_get_path(int type) char *pszACTUAL_FILE_PATH = NULL; int path_size = 0; - if (true == GetValueForTCTSetting("DEVICE_EXECUTION_MODE_30", pszUser, "ACCOUNTS_SVC_UTC")) { - if (!strcmp(pszUser, "owner")) { - if (true != GetValueForTCTSetting("DEVICE_ADMIN_USER_APPS_ROOT_30", pszValue, "ACCOUNTS_SVC_UTC")) - return NULL; - } else { - if (true != GetValueForTCTSetting("DEVICE_OTHER_USER_APPS_ROOT_30", pszValue, "ACCOUNTS_SVC_UTC")) - return NULL; + //testing + char* psz_pkg_id = NULL; + int nRet = app_get_id(&psz_pkg_id); + PRINT_RESULT(APP_ERROR_NONE, nRet, "app_get_id", AppGetError(nRet)); + PRINT_UTC_LOG("[Line : %d][%s] app_get_id returned value = %s\\n", __LINE__, API_NAMESPACE, psz_pkg_id); + if(0 == strncmp(TPK_APP_PREFIX,psz_pkg_id, strlen(TPK_APP_PREFIX))) + { + PRINT_UTC_LOG("[Line : %d][%s] Detected TPK execution\\n", __LINE__, API_NAMESPACE); + if (true == GetValueForTCTSetting("DEVICE_EXECUTION_MODE_30", pszUser, API_NAMESPACE)) + { + if (!strcmp(pszUser, "owner")) + { + if (true != GetValueForTCTSetting("DEVICE_ADMIN_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) + { + FREE_MEMORY(psz_pkg_id); + PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting(DEVICE_ADMIN_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); + return NULL; + } + } + else + { + if (true != GetValueForTCTSetting("DEVICE_OTHER_USER_APPS_ROOT_30", pszValue, API_NAMESPACE)) + { + FREE_MEMORY(psz_pkg_id); + PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting(DEVICE_OTHER_USER_APPS_ROOT_30) failed\\n", __LINE__, API_NAMESPACE); + return NULL; + } + } + PRINT_UTC_LOG("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); + if (type == ICON) + { + path_size = strlen(pszValue) + strlen(psz_pkg_id) + strlen(ICON_PATH) + 2; + pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); + snprintf(pszACTUAL_FILE_PATH, path_size, "%s/%s%s", pszValue, psz_pkg_id, ICON_PATH); + } + else + { + path_size = strlen(pszValue) + strlen(psz_pkg_id) + strlen(SMALL_ICON_PATH) + 2; + pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); + snprintf(pszACTUAL_FILE_PATH, path_size, "%s/%s%s", pszValue, psz_pkg_id, SMALL_ICON_PATH); + } + FREE_MEMORY(psz_pkg_id); + } + else + { + FREE_MEMORY(psz_pkg_id); + PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting(DEVICE_EXECUTION_MODE_30) failed\\n", __LINE__, API_NAMESPACE); + return NULL; } - } else { - return NULL; } - if (type == ICON) { - path_size = strlen(pszValue) + strlen(ICON_PATH) + 1; - pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); - snprintf(pszACTUAL_FILE_PATH, path_size, "%s%s", pszValue, ICON_PATH); - } else { - path_size = strlen(pszValue) + strlen(SMALL_ICON_PATH) + 1; - pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); - snprintf(pszACTUAL_FILE_PATH, path_size, "%s%s", pszValue, SMALL_ICON_PATH); + else + { + FREE_MEMORY(psz_pkg_id); + PRINT_UTC_LOG("[Line : %d][%s] Detected RPM execution\\n", __LINE__, API_NAMESPACE); + + if (type == ICON) + { + path_size = strlen(RPM_INSTALL_LOCATION) + strlen(ICON_PATH) + 1; + pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); + snprintf(pszACTUAL_FILE_PATH, path_size, "%s%s", RPM_INSTALL_LOCATION, ICON_PATH); + } + else + { + path_size = strlen(RPM_INSTALL_LOCATION) + strlen(SMALL_ICON_PATH) + 1; + pszACTUAL_FILE_PATH = (char*)calloc(path_size, sizeof(char)); + snprintf(pszACTUAL_FILE_PATH, path_size, "%s%s", RPM_INSTALL_LOCATION, SMALL_ICON_PATH); + } } + PRINT_UTC_LOG("[Line : %d][%s] pszACTUAL_FILE_PATH = %s\\n", __LINE__, API_NAMESPACE, pszACTUAL_FILE_PATH); + dlog_print(DLOG_ERROR, "ACCOUNT_TC", "pszACTUAL_FILE_PATH %s", pszACTUAL_FILE_PATH); return pszACTUAL_FILE_PATH; } -- 2.7.4