Rework default database open handling; Updated DLT log messages
authorIngo Huerner <ingo.huerner@xse.de>
Mon, 4 Aug 2014 22:23:22 +0000 (00:23 +0200)
committerIngo Huerner <ingo.huerner@xse.de>
Mon, 4 Aug 2014 22:23:22 +0000 (00:23 +0200)
17 files changed:
configure.ac
src/persistence_client_library.c
src/persistence_client_library_backup_filelist.c
src/persistence_client_library_custom_loader.c
src/persistence_client_library_db_access.c
src/persistence_client_library_db_access.h
src/persistence_client_library_dbus_cmd.c
src/persistence_client_library_dbus_service.c
src/persistence_client_library_file.c
src/persistence_client_library_handle.c
src/persistence_client_library_key.c
src/persistence_client_library_lc_interface.c
src/persistence_client_library_pas_interface.c
src/persistence_client_library_prct_access.c
test/data/PAS_data.tar.gz
test/persistence_client_library_dbus_test.c
test/persistence_client_library_test.c

index 2c7f02f..04ec679 100644 (file)
@@ -10,6 +10,7 @@ m4_define([pers_client_library_tag_version], [pers_client_library_tag_version_ma
 
 
 AC_INIT([Persistence Client Library], [pers_client_library_tag_version], [not-valid@xse.de])
+AC_COPYRIGHT([Copyright (c) 2014 XS Embedded GmbH])
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2])
 AC_GNU_SOURCE()
index 2bc2608..27df48e 100644 (file)
@@ -89,12 +89,12 @@ int pclInitLibrary(const char* appName, int shutdownMode)
 
       if(readBlacklistConfigFile(blacklistPath) == -1)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclInitLibrary -> failed to access blacklist:"), DLT_STRING(blacklistPath));
+         DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclInitLibrary - failed to access blacklist:"), DLT_STRING(blacklistPath));
       }
 
       if(setup_dbus_mainloop() == -1)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => Failed to setup main loop"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary - Failed to setup main loop"));
          pthread_mutex_unlock(&gDbusPendingRegMtx);
          return EPERS_DBUS_MAINLOOP;
       }
@@ -114,13 +114,13 @@ int pclInitLibrary(const char* appName, int shutdownMode)
       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("PAS interface is enabled!!"));
       if(register_pers_admin_service() == -1)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => Failed to register to pers admin dbus interface"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary - Failed to register to pers admin dbus interface"));
          pthread_mutex_unlock(&gDbusPendingRegMtx);
          return EPERS_REGISTER_ADMIN;
       }
          else
          {
-         DLT_LOG(gPclDLTContext, DLT_LOG_INFO,  DLT_STRING("pclInitLibrary => Successfully established IPC protocol for PCL."));
+         DLT_LOG(gPclDLTContext, DLT_LOG_INFO,  DLT_STRING("pclInitLibrary - Successfully established IPC protocol for PCL."));
          }
 #else
       DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("PAS interface is not enabled, enable with \"./configure --enable-pasinterface\""));
@@ -146,7 +146,7 @@ int pclInitLibrary(const char* appName, int shutdownMode)
    else if(gPclInitialized >= PCLinitialized)
    {
       gPclInitialized++; // increment init counter
-      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary => I N I T  Persistence Client Library - "), DLT_STRING(gAppId),
+      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary - I N I T  Persistence Client Library - "), DLT_STRING(gAppId),
                            DLT_STRING("- ONLY INCREMENT init counter: "), DLT_INT(gPclInitialized) );
    }
 
@@ -166,7 +166,7 @@ int pclDeinitLibrary(void)
        data.message.cmd = (uint32_t)CMD_QUIT;
        data.message.string[0] = '\0';  // no string parameter, set to 0
 
-      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary -> D E I N I T  client library - "), DLT_STRING(gAppId),
+      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - D E I N I T  client library - "), DLT_STRING(gAppId),
                                          DLT_STRING("- init counter: "), DLT_INT(gPclInitialized));
 
       // unregister for lifecycle dbus messages
@@ -177,11 +177,11 @@ int pclDeinitLibrary(void)
       rval = unregister_pers_admin_service();
       if(0 != rval)
          {
-                 DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclDeinitLibrary => Failed to de-initialize IPC protocol for PCL."));
+                 DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclDeinitLibrary - Failed to de-initialize IPC protocol for PCL."));
          }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_INFO,  DLT_STRING("pclDeinitLibrary => Successfully de-initialized IPC protocol for PCL."));
+         DLT_LOG(gPclDLTContext, DLT_LOG_INFO,  DLT_STRING("pclDeinitLibrary - Successfully de-initialized IPC protocol for PCL."));
       }
 #endif
 
@@ -220,7 +220,7 @@ int pclDeinitLibrary(void)
    }
    else if(gPclInitialized > PCLinitialized)
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary -> D E I N I T  client library - "), DLT_STRING(gAppId),
+      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclDeinitLibrary - D E I N I T  client library - "), DLT_STRING(gAppId),
                                            DLT_STRING("- ONLY DECREMENT init counter: "), DLT_INT(gPclInitialized));
       gPclInitialized--;   // decrement init counter
    }
index 30a79fa..66918ee 100644 (file)
@@ -153,7 +153,7 @@ int readBlacklistConfigFile(const char* filename)
 
                                if(fd == -1)
                                {
-                                 DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("configReader::readConfigFile ==> Error file open"), DLT_STRING(filename), DLT_STRING(strerror(errno)) );
+                                 DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - Error file open"), DLT_STRING(filename), DLT_STRING(strerror(errno)) );
                                  return EPERS_COMMON;
                                }
 
@@ -163,7 +163,7 @@ int readBlacklistConfigFile(const char* filename)
                                if(configFileMap == MAP_FAILED)
                                {
                                  close(fd);
-                                 DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("configReader::readConfigFile ==> Error mapping the file:"), DLT_STRING(filename), DLT_STRING(strerror(errno)) );
+                                 DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("readBlacklistConfigFile - Error mapping the file:"), DLT_STRING(filename), DLT_STRING(strerror(errno)) );
 
                                  return EPERS_COMMON;
                                }
@@ -179,19 +179,19 @@ int readBlacklistConfigFile(const char* filename)
                        }
                        else
                        {
-                               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("configReader::readConfigFile ==> Error config file size is 0:"), DLT_STRING(filename));
+                               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - Error config file size is 0:"), DLT_STRING(filename));
                                return EPERS_COMMON;
                        }
           }
           else
           {
-               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("configReader::readConfigFile ==> failed to stat() config file:"), DLT_STRING(filename));
+               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - failed to stat() config file:"), DLT_STRING(filename));
                return EPERS_COMMON;
           }
        }
    else
    {
-       DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("configReader::readConfigFile ==> config file name is NULL:"));
+       DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("readBlacklistConfigFile - config file name is NULL:"));
           rval = EPERS_COMMON;
    }
 
@@ -373,7 +373,7 @@ int pclCreateFile(const char* path, int chached)
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateFile ==> no valid path to create: "), DLT_STRING(path) );
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateFile - no valid path to create: "), DLT_STRING(path) );
    }
 
    return handle;
@@ -399,7 +399,7 @@ int pclVerifyConsistency(const char* origPath, const char* backupPath, const cha
    // *************************************************
    if((backupAvail == 0) && (csumAvail == 0) )
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency => there is a backup file AND a checksum"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency - there is a backup file AND a checksum"));
       // calculate checksum form backup file
       fdBackup = open(backupPath,  O_RDONLY);
       if(fdBackup != -1)
@@ -458,7 +458,7 @@ int pclVerifyConsistency(const char* origPath, const char* backupPath, const cha
    // *************************************************
    else if(csumAvail == 0)
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency => there is ONLY a checksum file"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency - there is ONLY a checksum file"));
 
       fdCsum = open(csumPath,  O_RDONLY);
       if(fdCsum != -1)
@@ -466,7 +466,7 @@ int pclVerifyConsistency(const char* origPath, const char* backupPath, const cha
          readSize = read(fdCsum, csumBuf, ChecksumBufSize);
          if(readSize <= 0)
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclVerifyConsistency => read checksum: invalid readSize"));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclVerifyConsistency - read checksum: invalid readSize"));
          }
          close(fdCsum);
 
@@ -500,7 +500,7 @@ int pclVerifyConsistency(const char* origPath, const char* backupPath, const cha
    // *************************************************
    else if(backupAvail == 0)
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency => there is ONLY a backup file"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclVerifyConsistency - there is ONLY a backup file"));
 
       // calculate checksum form backup file
       fdBackup = open(backupPath,  O_RDONLY);
@@ -561,7 +561,7 @@ int pclRecoverFromBackup(int backupFd, const char* original)
       // copy data from one file to another
       if(pclBackupDoFileCopy(backupFd, handle) == -1)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclRecoverFromBackup => couldn't write whole buffer"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclRecoverFromBackup - couldn't write whole buffer"));
       }
    }
 
@@ -592,13 +592,13 @@ int pclCreateBackup(const char* dstPath, int srcfd, const char* csumPath, const
       int csumSize = strlen(csumBuf);
       if(write(csfd, csumBuf, csumSize) != csumSize)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup => failed to write checksum to file"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - failed to write checksum to file"));
       }
       close(csfd);
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup => failed to create checksum file:"), DLT_STRING(strerror(errno)) );
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - failed to create checksum file:"), DLT_STRING(strerror(errno)) );
    }
 
    // create backup file, user and group has read/write permission, others have read permission
@@ -613,12 +613,12 @@ int pclCreateBackup(const char* dstPath, int srcfd, const char* csumPath, const
       // copy data from one file to another
       if((readSize = pclBackupDoFileCopy(srcfd, dstFd)) == -1)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pcl_create_backup => error copying file"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - error copying file"));
       }
 
       if(close(dstFd) == -1)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pcl_create_backup => error closing fd"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - error closing fd"));
       }
 
       // set back to the position
@@ -626,7 +626,7 @@ int pclCreateBackup(const char* dstPath, int srcfd, const char* csumPath, const
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup => failed to open backup file"),
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclCreateBackup - failed to open backup file"),
                                           DLT_STRING(dstPath), DLT_STRING(strerror(errno)));
    }
 
index f9633cd..dbfc6fa 100644 (file)
@@ -161,7 +161,7 @@ PersistenceCustomLibs_e custom_client_name_to_id(const char* lib_name, int subst
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_libname_to_id - error - id not found for lib:"), DLT_STRING(lib_name));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_client_name_to_id - id not found for lib:"), DLT_STRING(lib_name));
       }
    }
    else
@@ -196,7 +196,7 @@ PersistenceCustomLibs_e custom_client_name_to_id(const char* lib_name, int subst
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_libname_to_id - error - id not found for lib:"), DLT_STRING(lib_name));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("custom_client_name_to_id - id not found for lib:"), DLT_STRING(lib_name));
       }
 
    }
@@ -230,11 +230,11 @@ int get_custom_libraries()
                        int i = 0;
                        int fd = open(filename, O_RDONLY);
 
-                       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("load custom library config file ==> "), DLT_STRING(filename));
+                       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("get_custom_libraries - load config - "), DLT_STRING(filename));
 
                        if (fd == -1)
                        {
-                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load custom library config file error ==> Error file open: "),
+                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - Error file open: "),
                                                                                 DLT_STRING(filename), DLT_STRING("err msg: "), DLT_STRING(strerror(errno)) );
                                return EPERS_COMMON;
                        }
@@ -245,7 +245,7 @@ int get_custom_libraries()
                        if (customConfFileMap == MAP_FAILED)
                        {
                                close(fd);
-                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load custom library config file error ==> Error mapping the file"));
+                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - Error mapping the file"));
                                return EPERS_COMMON;
                        }
 
@@ -282,13 +282,13 @@ int get_custom_libraries()
                }
                else
                {
-                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load custom library config file error ==> Error file size is 0"));
+                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - Error file size is 0"));
                        rval = EPERS_COMMON;
                }
    }
    else
    {
-       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load custom library config file error ==> failed to stat() file"));
+       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_custom_libraries - failed to stat() file"));
        rval = EPERS_COMMON;
    }
    return rval;
@@ -436,7 +436,7 @@ int load_custom_library(PersistenceCustomLibs_e customLib, Pers_custom_functs_s
                                }
                                else
                                {
-                                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - error: could not load plugin functions: "),
+                                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - could not load plugin functions: "),
                                                                                                                                      DLT_STRING(get_custom_client_lib_name(customLib)));
                                        rval = EPERS_COMMON;
                                }
@@ -452,14 +452,14 @@ int load_custom_library(PersistenceCustomLibs_e customLib, Pers_custom_functs_s
                                }
                                else
                                {
-                                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library => error: could not load plugin functions: "),
+                                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - could not load plugin functions: "),
                                                                                                                                        DLT_STRING(get_custom_client_lib_name(customLib)));
                                        rval = EPERS_COMMON;
                                }
                        }
                        else
                        {
-                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - error: unknown init type "),
+                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - unknown init type "),
                                                                                 DLT_STRING(get_custom_client_lib_name(customLib)));
                                rval = EPERS_COMMON;
                        }
@@ -467,13 +467,13 @@ int load_custom_library(PersistenceCustomLibs_e customLib, Pers_custom_functs_s
       else
       {
          error = dlerror();
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - error:"), DLT_STRING(error));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - "), DLT_STRING(error));
          rval = EPERS_DLOPENERROR;
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - error: - customLib out of bounds"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_library - customLib out of bounds"));
       rval = EPERS_DLOPENERROR;
    }
 
@@ -530,7 +530,7 @@ int load_custom_plugins(plugin_callback_async_t pfInitCompletedCB)
                                {
                                        if(load_custom_library(i, &gPersCustomFuncs[i] ) <= 0)
                                        {
-                                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_plugins => E r r o r could not load plugin: "),
+                                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("load_custom_plugins - could not load plugin: "),
                                                                                                        DLT_STRING(get_custom_client_lib_name(i)));
                                                rval = EPERS_COMMON;
                                        }
@@ -544,7 +544,7 @@ int load_custom_plugins(plugin_callback_async_t pfInitCompletedCB)
        }
        else
        {
-               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclInit => Failed to load custom library config table"));
+               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("load_custom_plugins - Failed to load custom library config table"));
                rval = EPERS_COMMON;
        }
 
index 97f8f1e..a83078f 100644 (file)
@@ -35,8 +35,8 @@
 
 
 /// btree array
-static int gHandlesDB[DbTableSize][PersistencePolicy_LastEntry];
-static int gHandlesDBCreated[DbTableSize][PersistencePolicy_LastEntry] = { {0} };
+static int gHandlesDB[DbTableSize][PersistenceDB_LastEntry];
+static int gHandlesDBCreated[DbTableSize][PersistenceDB_LastEntry] = { {0} };
 
 
 // function prototype
@@ -63,7 +63,7 @@ char* pers_get_raw_key(char *key)
 
 
 
-static int database_get(PersistenceInfo_s* info, const char* dbPath)
+static int database_get(PersistenceInfo_s* info, const char* dbPath, int dbType)
 {
    int arrayIdx = 0;
    int handleDB = -1;
@@ -73,23 +73,23 @@ static int database_get(PersistenceInfo_s* info, const char* dbPath)
 
    if(arrayIdx < DbTableSize)
    {
-      if(gHandlesDBCreated[arrayIdx][info->configKey.policy] == 0)
+      if(gHandlesDBCreated[arrayIdx][dbType] == 0)
       {
          char path[DbPathMaxLen] = {0};
 
-         if(PersistencePolicy_wt == info->configKey.policy)                            /// write through database
+         if(PersistencePolicy_wt == dbType)                            /// write through database
          {
             snprintf(path, DbPathMaxLen, "%s%s", dbPath, gLocalWt);
          }
-         else if(PersistencePolicy_wc == info->configKey.policy)               // cached database
+         else if(PersistencePolicy_wc == dbType)               // cached database
          {
             snprintf(path, DbPathMaxLen, "%s%s", dbPath, gLocalCached);
          }
-         else if(PersistencePolicy_cd == info->configKey.policy)               // configurable default database
+         else if(PersistenceDB_confdefault == dbType)          // configurable default database
                        {
                          snprintf(path, DbPathMaxLen, "%s%s", dbPath, gLocalConfigurableDefault);
                        }
-                       else if(PersistencePolicy_d == info->configKey.policy)          // default database
+                       else if(PersistenceDB_default == dbType)                // default database
                        {
                          snprintf(path, DbPathMaxLen, "%s%s", dbPath, gLocalFactoryDefault);
                        }
@@ -103,27 +103,27 @@ static int database_get(PersistenceInfo_s* info, const char* dbPath)
             handleDB = persComDbOpen(path, 0x01);
             if(handleDB >= 0)
             {
-               gHandlesDB[arrayIdx][info->configKey.policy] = handleDB ;
-               gHandlesDBCreated[arrayIdx][info->configKey.policy] = 1;
+               gHandlesDB[arrayIdx][dbType] = handleDB ;
+               gHandlesDBCreated[arrayIdx][dbType] = 1;
             }
             else
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get ==> persComDbOpen() failed"));
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get - persComDbOpen() failed"));
             }
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get ==> wrong policy! Cannot extend dbPath wit database."));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get - wrong policy! Cannot extend dbPath wit database."));
          }
       }
       else
       {
-         handleDB = gHandlesDB[arrayIdx][info->configKey.policy];
+         handleDB = gHandlesDB[arrayIdx][dbType];
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get ==> invalid storage type"), DLT_STRING(dbPath));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_get - invalid storage type"), DLT_STRING(dbPath));
    }
    return handleDB;
 }
@@ -136,11 +136,9 @@ int pers_get_defaults(char* dbPath, char* key, PersistenceInfo_s* info, unsigned
    int read_size = EPERS_NOKEY;
    char dltMessage[DbPathMaxLen] = {0};
 
-   info->configKey.policy = PersistencePolicy_cd;
-   for(i=(int)PersistencePolicy_cd; i<(int)PersistencePolicy_na; i++)
+   for(i=(int)PersistenceDB_confdefault; i<(int)PersistenceDB_LastEntry; i++)
    {
-       handleDefaultDB = database_get(info, dbPath);
-       info->configKey.policy++;
+       handleDefaultDB = database_get(info, dbPath, i);
       if(handleDefaultDB >= 0)
       {
          if (PersGetDefault_Data == job)
@@ -153,7 +151,7 @@ int pers_get_defaults(char* dbPath, char* key, PersistenceInfo_s* info, unsigned
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_get_defaults ==> unknown job"));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_get_defaults - unknown job"));
             break;
          }
 
@@ -174,7 +172,7 @@ int pers_get_defaults(char* dbPath, char* key, PersistenceInfo_s* info, unsigned
             {
                 snprintf(dltMessage, DbPathMaxLen, "%s%s", dbPath, gLocalFactoryDefault);
             }
-            DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Default data will be used for Key"), DLT_STRING(key),
+            DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pers_get_defaults - efault data will be used for Key"), DLT_STRING(key),
                                                   DLT_STRING("from"), DLT_STRING(dltMessage));
             break;
          }
@@ -183,7 +181,7 @@ int pers_get_defaults(char* dbPath, char* key, PersistenceInfo_s* info, unsigned
 
    if (read_size < 0)
    {
-       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Default data not available for Key"), DLT_STRING(key),
+       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pers_get_defaults - default data not available for Key"), DLT_STRING(key),
                                              DLT_STRING("Path:"), DLT_STRING(dbPath));
    }
 
@@ -221,14 +219,14 @@ void database_close_all()
 
    for(i=0; i<DbTableSize; i++)
    {
-       for(j=0; j < PersistencePolicy_na; j++)
+       for(j=0; j < PersistenceDB_LastEntry; j++)
        {
                        if(gHandlesDBCreated[i][j] == 1)
                        {
                                int iErrorCode = persComDbClose(gHandlesDB[i][j]);
                                if (iErrorCode < 0)
                                {
-                                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_close_all => failed to close db => persComDbClose"));
+                                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("database_close_all - failed to close db"));
                                }
                                else
                                {
@@ -249,7 +247,7 @@ int persistence_get_data(char* dbPath, char* key, const char* resourceID, Persis
    if(   PersistenceStorage_shared == info->configKey.storage
       || PersistenceStorage_local == info->configKey.storage)
    {
-      int handleDB = database_get(info, dbPath);
+      int handleDB = database_get(info, dbPath, info->configKey.policy);
       if(handleDB >= 0)
       {
          read_size = persComDbReadKey(handleDB, key, (char*)buffer, buffer_size);
@@ -291,7 +289,7 @@ int persistence_get_data(char* dbPath, char* key, const char* resourceID, Persis
                                }
                                else
                                {
-                                        DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin not available (getData), unknown loading type: "),
+                                        DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data - Plugin not available, unknown loading type: "),
                                                                               DLT_INT(getCustomLoadingType(idx)));
                                         read_size = EPERS_COMMON;
                                }
@@ -331,7 +329,7 @@ int persistence_get_data(char* dbPath, char* key, const char* resourceID, Persis
 
          (void)get_db_path_and_key(info, key, NULL, dbPath);
 
-         DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin data not available. Try to get default data of key:"), DLT_STRING(key));
+         DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data - Plugin data not available - get default data of key:"), DLT_STRING(key));
          ret_defaults = pers_get_defaults(dbPath, (char*)resourceID, info, buffer, buffer_size, PersGetDefault_Data);
          if (0 < ret_defaults)
          {
@@ -344,7 +342,7 @@ int persistence_get_data(char* dbPath, char* key, const char* resourceID, Persis
 
 
 
-int persistence_set_data(char* dbPath, char* key, PersistenceInfo_s* info, unsigned char* buffer, unsigned int buffer_size)
+int persistence_set_data(char* dbPath, char* key, const char* resource_id, PersistenceInfo_s* info, unsigned char* buffer, unsigned int buffer_size)
 {
    int write_size = -1;
 
@@ -354,22 +352,22 @@ int persistence_set_data(char* dbPath, char* key, PersistenceInfo_s* info, unsig
       int handleDB = -1 ;
 
 
-      handleDB = database_get(info, dbPath);
+      handleDB = database_get(info, dbPath, info->configKey.policy);
       if(handleDB >= 0)
       {
          write_size = persComDbWriteKey(handleDB, key, (char*)buffer, buffer_size) ;
          if(write_size < 0)
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data ==> persComDbWriteKey() failure"));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - persComDbWriteKey() failure"));
          }
          else
          {
             if(PersistenceStorage_shared == info->configKey.storage)
             {
-               int rval = pers_send_Notification_Signal(key, &info->context, pclNotifyStatus_changed);
+               int rval = pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_changed);
                if(rval <= 0)
                {
-                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data ==> failed to send notification signal"));
+                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - failed to send notification signal"));
                   write_size = rval;
                }
             }
@@ -378,7 +376,7 @@ int persistence_set_data(char* dbPath, char* key, PersistenceInfo_s* info, unsig
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data ==> no resource config table"), DLT_STRING(dbPath), DLT_STRING(key));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - no resource config table"), DLT_STRING(dbPath), DLT_STRING(key));
          write_size = EPERS_NOPRCTABLE;
       }
    }
@@ -412,7 +410,7 @@ int persistence_set_data(char* dbPath, char* key, PersistenceInfo_s* info, unsig
                                }
                                else
                                {
-                                        DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin not available (setData), unknown loading type: "),
+                                        DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_set_data - Plugin not available, unknown loading type: "),
                                                                               DLT_INT(getCustomLoadingType(idx)));
                                         write_size = EPERS_COMMON;
                                }
@@ -438,10 +436,10 @@ int persistence_set_data(char* dbPath, char* key, PersistenceInfo_s* info, unsig
 
                                if ((0 < write_size) && ((unsigned int)write_size == buffer_size)) /* Check return value and send notification if OK */
                                {
-                                       int rval = pers_send_Notification_Signal(key, &info->context, pclNotifyStatus_changed);
+                                       int rval = pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_changed);
                                        if(rval <= 0)
                                        {
-                                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data ==> failed to send notification signal"));
+                                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_set_data - failed to send notification signal"));
                                                write_size = rval;
                                        }
                                }
@@ -469,7 +467,7 @@ int persistence_get_data_size(char* dbPath, char* key, const char* resourceID, P
    if(   PersistenceStorage_shared == info->configKey.storage
       || PersistenceStorage_local == info->configKey.storage)
    {
-      int handleDB = database_get(info, dbPath);
+      int handleDB = database_get(info, dbPath, info->configKey.policy);
       if(handleDB >= 0)
       {
 
@@ -509,7 +507,7 @@ int persistence_get_data_size(char* dbPath, char* key, const char* resourceID, P
                }
                                else
                                {
-                                        DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin not available (getDataSize), unknown loading type: "),
+                                        DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data_size - Plugin not available, unknown loading type: "),
                                                                               DLT_INT(getCustomLoadingType(idx)));
                                         read_size = EPERS_COMMON;
                                }
@@ -547,7 +545,7 @@ int persistence_get_data_size(char* dbPath, char* key, const char* resourceID, P
          info->configKey.policy = PersistencePolicy_wc;                        /* Set the policy */
          info->configKey.type   = PersistenceResourceType_key;  /* Set the type */
          (void)get_db_path_and_key(info, key, NULL, dbPath);
-         DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin data not available. Try to get size of default data for key:"),
+         DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_get_data_size - Plugin data not available,  get size of default data for key:"),
                                             DLT_STRING(key));
          ret_defaults = pers_get_defaults(dbPath, (char*)resourceID, info, NULL, 0, PersGetDefault_Size);
          if (0 < ret_defaults)
@@ -561,18 +559,18 @@ int persistence_get_data_size(char* dbPath, char* key, const char* resourceID, P
 
 
 
-int persistence_delete_data(char* dbPath, char* key, PersistenceInfo_s* info)
+int persistence_delete_data(char* dbPath, char* key, const char* resource_id, PersistenceInfo_s* info)
 {
    int ret = 0;
    if(PersistenceStorage_custom != info->configKey.storage)
    {
-      int handleDB = database_get(info, dbPath);
+      int handleDB = database_get(info, dbPath, info->configKey.policy);
       if(handleDB >= 0)
       {
          ret = persComDbDeleteKey(handleDB, key) ;
          if(ret < 0)
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data => persComDbDeleteKey failed: "), DLT_STRING(key));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data - failed: "), DLT_STRING(key));
             if(PERS_COM_ERR_NOT_FOUND == ret)
             {
                 ret = EPERS_NOKEY ;
@@ -585,12 +583,12 @@ int persistence_delete_data(char* dbPath, char* key, PersistenceInfo_s* info)
 
          if(PersistenceStorage_shared == info->configKey.storage)
          {
-            pers_send_Notification_Signal(key, &info->context, pclNotifyStatus_deleted);
+            pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_deleted);
          }
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data ==> no resource config table"), DLT_STRING(dbPath), DLT_STRING(key));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_delete_data - no resource config table"), DLT_STRING(dbPath), DLT_STRING(key));
          ret = EPERS_NOPRCTABLE;
       }
    }
@@ -623,7 +621,7 @@ int persistence_delete_data(char* dbPath, char* key, PersistenceInfo_s* info)
                                }
                                else
                                {
-                                        DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("Plugin not available (deleteData), unknown loading type: "),
+                                        DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("persistence_delete_data - Plugin not available, unknown loading type: "),
                                                                               DLT_INT(getCustomLoadingType(idx)));
                                         ret = EPERS_COMMON;
                                }
@@ -648,7 +646,7 @@ int persistence_delete_data(char* dbPath, char* key, PersistenceInfo_s* info)
 
                                if(0 <= ret) /* Check return value and send notification if OK */
                                {
-                                       pers_send_Notification_Signal(key, &info->context, pclNotifyStatus_deleted);
+                                       pers_send_Notification_Signal(resource_id, &info->context, pclNotifyStatus_deleted);
                                }
        }
        else
@@ -695,7 +693,7 @@ int persistence_notify_on_change(const char* key, unsigned int ldbid, unsigned i
 
       if(-1 == deliverToMainloop(&data))
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_notify_on_change => failed to write to pipe"), DLT_INT(errno));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("persistence_notify_on_change - failed to write to pipe"), DLT_INT(errno));
          rval = -1;
       }
    }
@@ -729,7 +727,7 @@ int pers_send_Notification_Signal(const char* key, PersistenceDbContext_s* conte
 
       if(-1 == deliverToMainloop(&data) )
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_send_Notification_Signal => failed to write to pipe"), DLT_INT(errno));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pers_send_Notification_Signal - failed to write to pipe"), DLT_INT(errno));
          rval = EPERS_NOTIFY_SIG;
       }
    }
@@ -753,7 +751,7 @@ void pers_rct_close_all()
        {
                        if(persComRctClose(get_resource_cfg_table_by_idx(i)) != 0)
                        {
-                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown => failed to close db => index:"), DLT_INT(i));
+                               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown - failed close db => index:"), DLT_INT(i));
                        }
 
                        invalidate_resource_cfg_table(i);
index 7fe2b1e..ba825f2 100644 (file)
@@ -36,6 +36,19 @@ extern "C" {
 
 
 
+/// default database definitions
+typedef enum PersistenceDB_e_
+{
+       /// configurable default database
+       PersistenceDB_confdefault = PersistencePolicy_LastEntry,
+       /// default database
+       PersistenceDB_default,
+
+       PersistenceDB_LastEntry
+
+} PersistenceDefaultDB_e;
+
+
 /**
  * @brief get the raw key without prefixed '/node/', '/user/3/' etc
  *
@@ -83,6 +96,7 @@ int pers_get_defaults(char* dbPath, char* key, PersistenceInfo_s* info, unsigned
  *
  * @param dbPath the path to the database where the key is in 
  * @param key the database key
+ * @param resource_id the resource identifier
  * @param info persistence information
  * @param buffer the buffer holding the data
  * @param buffer_size the size of the buffer
@@ -90,7 +104,7 @@ int pers_get_defaults(char* dbPath, char* key, PersistenceInfo_s* info, unsigned
  * @return the number of bytes written or a negative value if an error occured with the following error codes:
  *   EPERS_SETDTAFAILED  EPERS_NOPRCTABLE  EPERS_NOKEYDATA  EPERS_NOKEY
  */
-int persistence_set_data(char* dbPath, char* key, PersistenceInfo_s* info, unsigned char* buffer, unsigned int buffer_size);
+int persistence_set_data(char* dbPath, char* key, const char* resource_id, PersistenceInfo_s* info, unsigned char* buffer, unsigned int buffer_size);
 
 
 
@@ -131,12 +145,13 @@ int persistence_get_data_size(char* dbPath, char* key, const char* resourceID, P
  *
  * @param dbPath the path to the database where the key is in
  * @param key the database key to register on
+ * @param resource_id the resource identifier
  * @param info persistence information
  *
  * @return 0 if deletion was successfull;
  *         or an error code: EPERS_DB_KEY_SIZE, EPERS_NOPRCTABLE, EPERS_DB_ERROR_INTERNAL or EPERS_NOPLUGINFUNCT
  */
-int persistence_delete_data(char* dbPath, char* key, PersistenceInfo_s* info);
+int persistence_delete_data(char* dbPath, char* key, const char* resource_id, PersistenceInfo_s* info);
 
 
 
index d23c4ad..7275347 100644 (file)
@@ -128,7 +128,7 @@ void process_send_notification_signal(DBusConnection* conn, unsigned int notifyL
       snprintf(userArray,  DbusSubMatchSize, "%u", notifyUserNo);
       snprintf(seatArray,  DbusSubMatchSize, "%u", notifySeatNo);
 
-      //printf("process_send_Notification_Signal => key: %s | lbid: %d | gUserNo: %d | gSeatNo: %d | gReason: %d \n", gNotifykey, gLdbid, gUserNo, gSeatNo, gReason);
+      //printf("process_send_Notification_Signal => key: %s | lbid: %d | gUserNo: %d | gSeatNo: %d | gReason: %d \n", notifyKey, notifyLdbid, notifyUserNo, notifySeatNo, notifyReason);
       message = dbus_message_new_signal(gPersAdminConsumerPath,
                                            gDbusPersAdminConsInterface,
                                         notifyReasonString);
@@ -150,22 +150,22 @@ void process_send_notification_signal(DBusConnection* conn, unsigned int notifyL
             }
             else
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> failed to send dbus message!!"));
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - failed to send dbus message!!"));
             }
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> E R R O R  C O N E C T I O N  NULL!!"));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - C O N E C T I O N  NULL!!"));
          }
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> ERROR dbus_message_append_args"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - dbus_message_append_args"));
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal ==> ERROR invalid notification reason"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_Notification_Signal - invalid notification reason"));
    }
 }
 
@@ -216,7 +216,7 @@ void process_prepare_shutdown(int complete)
 #endif
          if(rval == -1)
          {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown => failed to close file: "), DLT_STRING(strerror(errno)) );
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_prepare_shutdown - failed to close file: "), DLT_STRING(strerror(errno)) );
          }
 
       }
@@ -273,7 +273,7 @@ void process_send_pas_request(DBusConnection* conn, unsigned int requestID, int
 
          if(!dbus_connection_send(conn, message, 0))
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => Access denied"), DLT_STRING(error.message) );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Access denied"), DLT_STRING(error.message) );
          }
 
          dbus_connection_flush(conn);
@@ -281,12 +281,12 @@ void process_send_pas_request(DBusConnection* conn, unsigned int requestID, int
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request => ERROR: Invalid message") );
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request - Invalid message") );
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request => ERROR: Invalid connection") );
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_request - Invalid connection") );
    }
 }
 
@@ -332,24 +332,24 @@ void process_send_pas_register(DBusConnection* conn, int regType, int notificati
 
             if(!dbus_pending_call_set_notify(pending, msg_pending_func, method, NULL))
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_pas_register => dbus_pending_call_set_notify: FAILED\n") );
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("process_send_pas_register - dbus_pending_call_set_notify: FAILED\n") );
             }
             dbus_pending_call_unref(pending);
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register =>  ERROR: Invalid message") );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid message") );
          }
          dbus_message_unref(message);
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register =>  ERROR: Invalid busname") );
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid busname") );
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register =>  ERROR: Invalid connection") );
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_pas_register - Invalid connection") );
    }
 }
 
@@ -392,19 +392,19 @@ void process_send_lifecycle_register(DBusConnection* conn, int regType, int shut
 
                   if(!dbus_connection_send(conn, message, 0))
                   {
-                     DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => Access denied"), DLT_STRING(error.message) );
+                     DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Access denied"), DLT_STRING(error.message) );
                   }
                   dbus_connection_flush(conn);
          dbus_message_unref(message);
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => ERROR: Invalid message"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - Invalid message"));
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register => ERROR: connection isn NULL"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_register - connection isn NULL"));
    }
 }
 
@@ -430,7 +430,7 @@ void process_send_lifecycle_request(DBusConnection* conn, unsigned int requestId
 
          if(!dbus_connection_send(conn, message, 0))
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request => Access denied"), DLT_STRING(error.message) );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - Access denied"), DLT_STRING(error.message) );
           }
 
           dbus_connection_flush(conn);
@@ -438,12 +438,12 @@ void process_send_lifecycle_request(DBusConnection* conn, unsigned int requestId
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request => ERROR: Invalid message"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - Invalid message"));
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request => ERROR: connection isn NULL"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("send_lifecycle_request - connection isn NULL"));
    }
 }
 
@@ -461,7 +461,7 @@ void msg_pending_func(DBusPendingCall *call, void *data)
 
    if (dbus_set_error_from_message(&err, message))
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_pending_func ==> Access denied") );
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_pending_func - Access denied") );
    }
    else
    {
index 4705176..0ecbac8 100644 (file)
@@ -128,7 +128,7 @@ static DBusHandlerResult handleObjectPathMessageFallback(DBusConnection * connec
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback -> unknown signal:"), DLT_STRING(dbus_message_get_interface(message)) );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - unknown signal:"), DLT_STRING(dbus_message_get_interface(message)) );
          }
       }
    }
@@ -175,12 +175,12 @@ static DBusHandlerResult handleObjectPathMessageFallback(DBusConnection * connec
 
                if (reply == 0)
                {
-                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback => DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) );
+                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) );
                }
 
                if (!dbus_connection_send(connection, reply, 0))
                {
-                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback => DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) );
+                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - DBus No memory"), DLT_STRING(dbus_message_get_interface(message)) );
                }
 
                result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;;
@@ -199,7 +199,7 @@ static DBusHandlerResult handleObjectPathMessageFallback(DBusConnection * connec
                }
                else
                {
-                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback => gChangeNotifyCallback is not set (possibly NULL)") );
+                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - gChangeNotifyCallback is not set (possibly NULL)") );
                }
                result = DBUS_HANDLER_RESULT_HANDLED;
             }
@@ -235,12 +235,12 @@ static DBusHandlerResult handleObjectPathMessageFallback(DBusConnection * connec
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback -> unknown property:"), DLT_STRING(dbus_message_get_interface(message)) );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - unknown property:"), DLT_STRING(dbus_message_get_interface(message)) );
          }
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback -> not a signal:"), DLT_STRING(dbus_message_get_member(message)) );
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("handleObjectPathMessageFallback - not a signal:"), DLT_STRING(dbus_message_get_member(message)) );
       }
    }
    return result;
@@ -295,7 +295,7 @@ int setup_dbus_mainloop(void)
    // Connect to the bus and check for errors
    if(pAddress != NULL)
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("setup_dbus_mainloop -> Use specific dbus address:"), DLT_STRING(pAddress) );
+      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("setup_dbus_mainloop - Use specific dbus address:"), DLT_STRING(pAddress) );
 
       conn = dbus_connection_open_private(pAddress, &err);
 
@@ -303,7 +303,7 @@ int setup_dbus_mainloop(void)
       {
          if(!dbus_bus_register(conn, &err))
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_bus_register() Error :"), DLT_STRING(err.message) );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_bus_register() :"), DLT_STRING(err.message) );
             dbus_error_free (&err);
             pthread_mutex_unlock(&gDbusInitializedMtx);
             return -1;
@@ -311,7 +311,7 @@ int setup_dbus_mainloop(void)
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_connection_open_private() Error :"), DLT_STRING(err.message) );
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("dbus_connection_open_private() :"), DLT_STRING(err.message) );
          dbus_error_free(&err);
          pthread_mutex_unlock(&gDbusInitializedMtx);
          return -1;
@@ -439,18 +439,18 @@ static dbus_bool_t addTimeout(DBusTimeout *timeout, void *data)
             }
             else
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout => timerfd_settime() failed"), DLT_STRING(strerror(errno)) );
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - timerfd_settime() failed"), DLT_STRING(strerror(errno)) );
             }
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout => timerfd_create() failed"), DLT_STRING(strerror(errno)) );
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - timerfd_create() failed"), DLT_STRING(strerror(errno)) );
          }
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout => cannot create another fd to be poll()'ed"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("addTimeout - cannot create another fd to be poll()'ed"));
    }
    return ret;
 }
@@ -468,7 +468,7 @@ static void removeTimeout(DBusTimeout *timeout, void *data)
    {
       if (-1==close(gPollInfo.fds[i].fd))
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("removeTimeout => close() timerfd"), DLT_STRING(strerror(errno)) );
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("removeTimeout - close() timerfd"), DLT_STRING(strerror(errno)) );
       }
 
       --gPollInfo.nfds;
@@ -500,7 +500,7 @@ static void timeoutToggled(DBusTimeout *timeout, void *data)
       const struct itimerspec its = { .it_value= {interval/1000, interval%1000} };
       if (-1!=timerfd_settime(gPollInfo.fds[i].fd, 0, &its, NULL))
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("timeoutToggled => timerfd_settime()"), DLT_STRING(strerror(errno)) );
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("timeoutToggled - timerfd_settime()"), DLT_STRING(strerror(errno)) );
       }
    }
 }
@@ -519,7 +519,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2,
 
    if (dbus_error_is_set(&err))
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => Connection Error:"), DLT_STRING(err.message) );
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - Connection Error:"), DLT_STRING(err.message) );
       dbus_error_free(&err);
    }
    else if (NULL != conn)
@@ -528,7 +528,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2,
       //if (-1 == (gEfds = eventfd(0, 0)))
       if (-1 == (pipe(gPipeFd)))
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => eventfd() failed w/ errno:"), DLT_INT(errno) );
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - eventfd() failed w/ errno:"), DLT_INT(errno) );
       }
       else
       {
@@ -551,7 +551,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2,
             if(   (TRUE!=dbus_connection_set_watch_functions(conn, addWatch, removeWatch, watchToggled, NULL, NULL))
                || (TRUE!=dbus_connection_set_timeout_functions(conn, addTimeout, removeTimeout, timeoutToggled, NULL, NULL)) )
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => dbus_connection_set_watch_functions() failed"));
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - dbus_connection_set_watch_functions() failed"));
             }
             else
             {
@@ -567,7 +567,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2,
 
                   if (0>ret)
                   {
-                     DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => poll() failed w/ errno "), DLT_INT(errno) );
+                     DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - poll() failed w/ errno "), DLT_INT(errno) );
                   }
                   else if (0==ret)
                   {
@@ -590,13 +590,13 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2,
 
                               if ((ssize_t)sizeof(nExpCount)!=read(gPollInfo.fds[i].fd, &nExpCount, sizeof(nExpCount)))
                               {
-                                 DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => read failed"));
+                                 DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - read failed"));
                               }
-                              DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => timeout"));
+                              DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - timeout"));
 
                               if (FALSE==dbus_timeout_handle(gPollInfo.objects[i].timeout))
                               {
-                                 DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => dbus_timeout_handle() failed!?"));
+                                 DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - dbus_timeout_handle() failed!?"));
                               }
                               bContinue = TRUE;
                            }
@@ -611,7 +611,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2,
                                  while ((-1==(ret = read(gPollInfo.fds[i].fd, readData.payload, 128)))&&(EINTR == errno));
                                  if(ret < 0)
                                  {
-                                    DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => read() failed"), DLT_STRING(strerror(errno)) );
+                                    DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - read() failed"), DLT_STRING(strerror(errno)) );
                                  }
                                  else
                                  {
@@ -648,7 +648,7 @@ int mainLoop(DBusObjectPathVTable vtable, DBusObjectPathVTable vtable2,
                                           bQuit = TRUE;
                                           break;
                                        default:
-                                          DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop => command not handled"), DLT_INT(readData.message.cmd) );
+                                          DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("mainLoop - command not handled"), DLT_INT(readData.message.cmd) );
                                           break;
                                     }
                                     pthread_cond_signal(&gMainLoopCond);
index 57db9b5..8d58fce 100644 (file)
@@ -239,16 +239,16 @@ int pclFileOpen(unsigned int ldbid, const char* resource_id, unsigned int user_n
                wantBackup = 0;
                if((handle = pclVerifyConsistency(dbPath, backupPath, csumPath, flags)) == -1)
                {
-                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen: error => file inconsistent, recovery  N O T  possible!"));
+                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen - file inconsistent, recovery  N O T  possible!"));
                   return -1;
                }
             }
             else
             {
                if(dbContext.configKey.permission == PersistencePermission_ReadOnly)
-                       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup => file is READ ONLY!"), DLT_STRING(dbKey));
+                       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup - file is READ ONLY!"), DLT_STRING(dbKey));
                else
-                       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup => file is in backup blacklist!"), DLT_STRING(dbKey));
+                       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileOpen: No Backup - file is in backup blacklist!"), DLT_STRING(dbKey));
 
             }
 
@@ -292,13 +292,13 @@ int pclFileOpen(unsigned int ldbid, const char* resource_id, unsigned int user_n
             {
                if((handle = pclCreateFile(dbPath, cacheStatus)) == -1)
                {
-                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen: error => failed to create file: "), DLT_STRING(dbPath));
+                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileOpen - failed to create file: "), DLT_STRING(dbPath));
                }
                else
                {
                        if(pclFileGetDefaultData(handle, resource_id, dbContext.configKey.policy) == -1)        // try to get default data
                        {
-                               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileOpen: no default data available: "), DLT_STRING(resource_id));
+                               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileOpen - no default data available: "), DLT_STRING(resource_id));
                        }
                }
 
@@ -413,13 +413,13 @@ int pclFileRemove(unsigned int ldbid, const char* resource_id, unsigned int user
             rval = remove(dbPath);
             if(rval == -1)
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove => remove ERROR"), DLT_STRING(strerror(errno)) );
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove - remove()"), DLT_STRING(strerror(errno)) );
             }
          }
          else
          {
             rval = shared_DB;
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove ==> no valid database context or resource not a file"));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileRemove - no valid database context or resource not a file"));
          }
       }
       else
@@ -536,13 +536,13 @@ int pclFileWriteData(int fd, const void * buffer, int buffer_size)
                if(get_file_cache_status(fd) == 1)
                {
                        if(fsync(fd) == -1)
-                               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileWriteData: Failed to fsync ==>!"), DLT_STRING(strerror(errno)));
+                               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileWriteData - Failed to fsync ==>!"), DLT_STRING(strerror(errno)));
                }
 #endif
             }
             else
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileWriteData: Failed to write ==> read only file!"), DLT_STRING(get_file_backup_path(fd)));
+               DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileWriteData - Failed to write ==> read only file!"), DLT_STRING(get_file_backup_path(fd)));
                size = EPERS_RESOURCE_READ_ONLY;
             }
          }
@@ -599,7 +599,7 @@ int pclFileCreatePath(unsigned int ldbid, const char* resource_id, unsigned int
 
                if((handle = pclVerifyConsistency(dbPath, backupPath, csumPath, flags)) == -1)
                {
-                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath: error => file inconsistent, recovery  N O T  possible!"));
+                  DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath - file inconsistent, recovery  N O T  possible!"));
                   return -1;
                }
                // we don't need the file handle here
@@ -609,7 +609,7 @@ int pclFileCreatePath(unsigned int ldbid, const char* resource_id, unsigned int
             }
             else
                                {
-                                       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileCreatePath: No Backup => read only OR in blacklist!"), DLT_STRING(dbKey));
+                                       DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclFileCreatePath - No Backup, read only OR in blacklist!"), DLT_STRING(dbKey));
                                }
 
             handle = get_persistence_handle_idx();
@@ -644,13 +644,13 @@ int pclFileCreatePath(unsigned int ldbid, const char* resource_id, unsigned int
 
                                                                if(handle == -1)
                                                                {
-                                                                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath: error => failed to create file: "), DLT_STRING(*path));
+                                                                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclFileCreatePath - failed to create file: "), DLT_STRING(*path));
                                                                }
                                                                else
                                                                {
                                                                        if(pclFileGetDefaultData(handle, resource_id, dbContext.configKey.policy) == -1)        // try to get default data
                                                                        {
-                                                                               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileCreatePath => no default data available: "), DLT_STRING(resource_id));
+                                                                               DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileCreatePath - no default data available: "), DLT_STRING(resource_id));
                                                                        }
                                                                        close(handle);    // don't need the open file
                                                                }
@@ -789,7 +789,7 @@ int pclFileGetDefaultData(int handle, const char* resource_id, int policy)
                }
                else
                {
-                       DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileGetDefaultData => failed to copy file "), DLT_STRING(strerror(errno)));
+                       DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("pclFileGetDefaultData - failed to copy file "), DLT_STRING(strerror(errno)));
                }
 
                close(defaultHandle);
index 60ea521..6950c4d 100644 (file)
@@ -70,7 +70,7 @@ int get_persistence_handle_idx()
          else
          {
             handle = EPERS_MAXHANDLE;
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_persistence_handle_idx => Reached maximum of open handles: "), DLT_INT(MaxPersHandle));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_persistence_handle_idx - max open handles: "), DLT_INT(MaxPersHandle));
          }
       }
       pthread_mutex_unlock(&gMtx);
@@ -128,7 +128,7 @@ int set_key_handle_data(int idx, const char* id, unsigned int ldbid,  unsigned i
                }
                else
                {
-                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("set_key_handle_data: error - index out of bounds:"), DLT_INT(idx));
+                       DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("set_key_handle_data - index out of bounds:"), DLT_INT(idx));
                }
 
                pthread_mutex_unlock(&gKeyHandleAccessMtx);
index c73cf4c..d2017a9 100644 (file)
@@ -72,7 +72,7 @@ int pclKeyHandleOpen(unsigned int ldbid, const char* resource_id, unsigned int u
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleOpen: error - no database context or resource is not a key "));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleOpen - no database context or resource is not a key "));
       }
    }
 
@@ -188,7 +188,7 @@ int pclKeyHandleRegisterNotifyOnChange(int key_handle, pclChangeNotifyCallback_t
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleRegisterNotifyOnChange: Only one callback is allowed for change notifications."));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyHandleRegisterNotifyOnChange - Only one callback is allowed for change notifications."));
       rval = EPERS_NOTIFY_NOT_ALLOWED;
    }
    return rval;
@@ -296,7 +296,7 @@ int pclKeyDelete(unsigned int ldbid, const char* resource_id, unsigned int user_
         {
            if(   dbContext.configKey.storage < PersistenceStorage_LastEntry)   // check if store policy is valid
            {
-                  rval = persistence_delete_data(dbPath, dbKey, &dbContext);
+                  rval = persistence_delete_data(dbPath, dbKey, resource_id, &dbContext);
            }
            else
            {
@@ -392,7 +392,7 @@ int pclKeyReadData(unsigned int ldbid, const char* resource_id, unsigned int use
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyReadData - error - no database context or resource is not a key"));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyReadData - no database context or resource is not a key"));
          }
       }
       else
@@ -441,7 +441,7 @@ int pclKeyWriteData(unsigned int ldbid, const char* resource_id, unsigned int us
                   // store data
                   if(   dbContext.configKey.storage < PersistenceStorage_LastEntry)   // check if store policy is valid
                   {
-                     data_size = persistence_set_data(dbPath, dbKey, &dbContext, buffer, buffer_size);
+                     data_size = persistence_set_data(dbPath, dbKey, resource_id, &dbContext, buffer, buffer_size);
                   }
                   else
                   {
@@ -455,13 +455,13 @@ int pclKeyWriteData(unsigned int ldbid, const char* resource_id, unsigned int us
             }
             else
             {
-               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData - error - no database context or resource is not a key"));
+               DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData no database context or resource is not a key"));
             }
          }
          else
          {
             data_size = EPERS_BUFLIMIT;
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData: error - buffer_size to big, limit is [bytes]:"), DLT_INT(gMaxKeyValDataSize));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyWriteData - buffer_size to big, limit is [bytes]:"), DLT_INT(gMaxKeyValDataSize));
          }
       }
       else
@@ -491,7 +491,7 @@ int pclKeyRegisterNotifyOnChange(unsigned int ldbid, const char* resource_id, un
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyRegisterNotifyOnChange: Only one callback is allowed for change notifications."));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("pclKeyRegisterNotifyOnChange - Only one callback is allowed for change notifications."));
       rval = EPERS_NOTIFY_NOT_ALLOWED;
    }
    return rval;
@@ -529,7 +529,7 @@ int regNotifyOnChange(unsigned int ldbid, const char* resource_id, unsigned int
          }
          else
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("regNotifyOnChange: Not allowed! Resource is local or it is a file:"),
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("regNotifyOnChange - Not allowed! Resource is local or it is a file:"),
                                          DLT_STRING(resource_id), DLT_STRING("LDBID:"), DLT_UINT(ldbid));
             rval = EPERS_NOTIFY_NOT_ALLOWED;
          }
@@ -537,7 +537,7 @@ int regNotifyOnChange(unsigned int ldbid, const char* resource_id, unsigned int
       else
       {
          DLT_LOG(gPclDLTContext, DLT_LOG_ERROR,
-                              DLT_STRING("regNotifyOnChange: Not possible! get_db_context() returned:"),
+                              DLT_STRING("regNotifyOnChange - Not possible! get_db_context() returned:"),
                               DLT_INT(rval));
       }
    }
index 32ab659..4149ace 100644 (file)
@@ -52,7 +52,7 @@ int check_lc_request(unsigned int request, unsigned int requestID)
 
          if(-1 == deliverToMainloop_NM(&data) )
          {
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request => failed to write to pipe"), DLT_INT(errno));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request - failed to write to pipe"), DLT_INT(errno));
             rval = NsmErrorStatus_Fail;
          }
          else
@@ -63,7 +63,7 @@ int check_lc_request(unsigned int request, unsigned int requestID)
       }
       default:
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request => Unknown lifecycle message"), DLT_INT(request));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("check_lc_request - Unknown lifecycle message"), DLT_INT(request));
          break;
       }
    }
@@ -90,12 +90,12 @@ int msg_lifecycleRequest(DBusConnection *connection, DBusMessage *message)
 
       if (reply == 0)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
       }
 
       if (!dbus_connection_send(connection, reply, 0))
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
       }
 
       dbus_message_unref(reply);
@@ -109,17 +109,17 @@ int msg_lifecycleRequest(DBusConnection *connection, DBusMessage *message)
 
    if (reply == 0)
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
    }
 
    if (!dbus_message_append_args(reply, DBUS_TYPE_INT32, &msgReturn, DBUS_TYPE_INVALID))
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
    }
 
    if (!dbus_connection_send(connection, reply, 0))
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest => DBus No memory"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_lifecycleRequest - DBus No memory"));
    }
 
    dbus_connection_flush(connection);
@@ -144,7 +144,7 @@ DBusHandlerResult checkLifecycleMsg(DBusConnection * connection, DBusMessage * m
       }
       else
       {
-          DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkLifecycleMsg -> unknown message "), DLT_STRING(dbus_message_get_interface(message)));
+          DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkLifecycleMsg - unknown message "), DLT_STRING(dbus_message_get_interface(message)));
       }
    }
    return result;
index d94d709..0079df0 100644 (file)
@@ -59,7 +59,7 @@ int check_pas_request(unsigned int request, unsigned int requestID)
        data.message.params[1] = requestID;
        data.message.string[0] = '\0';  // no string parameter, set to 0
 
-         DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("PCL: check_pas_request; case PasMsg_Block o. PasMsg_WriteBack"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("check_pas_request - case PasMsg_Block o. PasMsg_WriteBack"));
          if(-1 == deliverToMainloop_NM(&data))
          {
             DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("write failed w/ errno "), DLT_INT(errno), DLT_STRING(strerror(errno)));
@@ -73,7 +73,7 @@ int check_pas_request(unsigned int request, unsigned int requestID)
       }
       case PasMsg_Unblock:
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("PCL: check_pas_request; case PasMsg_Unblock"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("check_pas_request - case PasMsg_Unblock"));
          pers_unlock_access();
          rval = PasErrorStatus_OK;
          break;
@@ -109,12 +109,12 @@ DBusHandlerResult msg_persAdminRequest(DBusConnection *connection, DBusMessage *
 
       if(reply == 0)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
       }
 
       if (!dbus_connection_send(connection, reply, 0))
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
       }
 
       dbus_message_unref(reply);
@@ -128,17 +128,17 @@ DBusHandlerResult msg_persAdminRequest(DBusConnection *connection, DBusMessage *
 
    if (reply == 0)
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
    }
 
    if (!dbus_message_append_args(reply, DBUS_TYPE_INT32, &errorReturn, DBUS_TYPE_INVALID))
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
    }
 
    if (!dbus_connection_send(connection, reply, 0))
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest => DBus No memory"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("msg_persAdminRequest - DBus No memory"));
    }
 
    dbus_connection_flush(connection);
@@ -164,12 +164,12 @@ int signal_persModeChange(DBusConnection *connection, DBusMessage *message)
 
       if(reply == 0)
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
       }
 
       if (!dbus_connection_send(connection, reply, 0))
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
       }
 
       dbus_message_unref(reply);
@@ -181,17 +181,17 @@ int signal_persModeChange(DBusConnection *connection, DBusMessage *message)
 
    if (reply == 0)
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
    }
 
    if (!dbus_message_append_args(reply, DBUS_TYPE_INT32, &errorCode, DBUS_TYPE_INVALID))
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
    }
 
    if (!dbus_connection_send(connection, reply, 0))
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange => DBus No memory"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("signal_persModeChange - DBus No memory"));
    }
 
    dbus_connection_flush(connection);
@@ -215,12 +215,12 @@ DBusHandlerResult checkPersAdminMsg(DBusConnection * connection, DBusMessage * m
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg => unknown message"), DLT_STRING(dbus_message_get_member(message)));
+         DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg - unknown message"), DLT_STRING(dbus_message_get_member(message)));
       }
    }
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg => unknown message"), DLT_STRING(dbus_message_get_interface(message)));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("checkPersAdminMsg - unknown message"), DLT_STRING(dbus_message_get_interface(message)));
    }
    return result;
 }
@@ -241,7 +241,7 @@ int register_pers_admin_service(void)
 
    if(-1 == deliverToMainloop(&data))
    {
-    DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("register_pers_admin_service => failed to write to pipe"), DLT_INT(errno));
+    DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("register_pers_admin_service - failed to write to pipe"), DLT_INT(errno));
     rval = -1;
    }
    else
@@ -266,7 +266,7 @@ int unregister_pers_admin_service(void)
 
    if(-1 == deliverToMainloop(&data))
    {
-     DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("unregister_pers_admin_service => failed to write to pipe"), DLT_INT(errno));
+     DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("unregister_pers_admin_service - failed to write to pipe"), DLT_INT(errno));
      rval = -1;
    }
    else
index dcbcbea..0884c6b 100644 (file)
@@ -117,7 +117,7 @@ int get_resource_cfg_table(PersistenceRCT_e rct, int group)
             snprintf(filename, DbPathMaxLen, gSharedWtPathKey, gAppId, group, gResTableCfg);
             break;
          default:
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table - error: no valid PersistenceRCT_e"));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table - no valid PersistenceRCT_e"));
             break;
          }
 
@@ -126,7 +126,7 @@ int get_resource_cfg_table(PersistenceRCT_e rct, int group)
          if(gResource_table[arrayIdx] < 0)
          {
                gResourceOpen[arrayIdx] = -1;
-            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table => RCT problem"), DLT_INT(gResource_table[arrayIdx] ));
+            DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_resource_cfg_table - RCT problem"), DLT_INT(gResource_table[arrayIdx] ));
          }
          else
          {
@@ -177,13 +177,13 @@ int get_db_context(PersistenceInfo_s* dbContext, const char* resource_id, unsign
       }
       else
       {
-         DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("get_db_context => persComRctRead => resource_table: no value for key:"), DLT_STRING(resource_id) );
+         DLT_LOG(gPclDLTContext, DLT_LOG_WARN, DLT_STRING("get_db_context - resource_table: no value for key:"), DLT_STRING(resource_id) );
          rval = EPERS_NOKEYDATA;
       }
    }  // resource table
    else
    {
-      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_db_context =>error resource table"));
+      DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("get_db_context - resource table"));
       rval = EPERS_NOPRCTABLE;
    }
 
@@ -209,7 +209,7 @@ int get_db_context(PersistenceInfo_s* dbContext, const char* resource_id, unsign
       memcpy(dbContext->configKey.reponsible, "default", strlen("default"));
       memcpy(dbContext->configKey.custom_name, "default", strlen("default"));
 
-      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("get_db_context => create resource not in PRCT => key:"), DLT_STRING(resource_id) );
+      DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("get_db_context - create resource not in PRCT => key:"), DLT_STRING(resource_id) );
 
       rval = get_db_path_and_key(dbContext, resource_id, dbKey, dbPath);
    }
index 235ef1b..f88bce1 100644 (file)
Binary files a/test/data/PAS_data.tar.gz and b/test/data/PAS_data.tar.gz differ
index 3fd0130..b5fdb6f 100644 (file)
@@ -58,9 +58,9 @@ int main(int argc, char *argv[])
    ret = pclKeyHandleOpen(0xFF, "posHandle/last_position", 0, 0);
 
    printf("Register for change notification\n");
-   ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
-   ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
-   ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+   ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+   ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
+   ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
 
    ret = pclKeyRegisterNotifyOnChange(0xFF, "69",     1/*user_no*/, 2/*seat_no*/, &myChangeCallback);
    printf("Reg => 69: %d\n", ret);
@@ -73,16 +73,16 @@ int main(int argc, char *argv[])
    printf("Press enter to unregister to notifications\n");
    getchar();
 
-   ret = pclKeyUnRegisterNotifyOnChange(0x84, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
-   ret = pclKeyUnRegisterNotifyOnChange(0x84, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
-   ret = pclKeyUnRegisterNotifyOnChange(0x84, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+   ret = pclKeyUnRegisterNotifyOnChange(0x20, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+   ret = pclKeyUnRegisterNotifyOnChange(0x20, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
+   ret = pclKeyUnRegisterNotifyOnChange(0x20, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
 
    printf("Press enter to register to notifications\n");
    getchar();
 
-   ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
-   ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
-   ret = pclKeyRegisterNotifyOnChange(0x84, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+   ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link2", 2/*user_no*/, 1/*seat_no*/, &myChangeCallback);
+   ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link3", 3/*user_no*/, 2/*seat_no*/, &myChangeCallback);
+   ret = pclKeyRegisterNotifyOnChange(0x20, "links/last_link4", 4/*user_no*/, 1/*seat_no*/, &myChangeCallback);
 
    printf("Press enter to end\n");
    getchar();
index 9de598f..6e6e9aa 100644 (file)
@@ -59,16 +59,21 @@ char* gRecovChecksum = "608a3b5d";  // generated with http://www.tools4noobs.com/
 
 
 
+void data_setup(void)
+{
+   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+   (void)pclInitLibrary(gTheAppId, shutdownReg);
+}
+
 void data_teardown(void)
 {
-   printf("* * * tear down * * *\n");  // nothing
+   pclDeinitLibrary();
 }
 
 
 int myChangeCallback(pclNotification_s * notifyStruct)
 {
    printf(" ==> * - * myChangeCallback * - *\n");
-
    return 1;
 }
 
@@ -88,12 +93,8 @@ START_TEST(test_GetData)
    X_TEST_REPORT_TYPE(GOOD);
 
    int ret = 0;
-   unsigned int shutdownReg = (PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL);
-
    unsigned char buffer[READ_SIZE] = {0};
 
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 
 #if 1
    /**
@@ -174,7 +175,7 @@ START_TEST(test_GetData)
    memset(buffer, 0, READ_SIZE);
 
 #endif
-   pclDeinitLibrary();
+
 }
 END_TEST
 
@@ -194,15 +195,12 @@ START_TEST (test_GetDataHandle)
    X_TEST_REPORT_TYPE(GOOD);
 
    int ret = 0, handle = 0, handle2 = 0, handle3 = 0, handle4 = 0, size = 0;
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
 
    unsigned char buffer[READ_SIZE] = {0};
    struct tm *locTime;
 
    char sysTimeBuffer[128];
 
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 #if 1
    time_t t = time(0);
 
@@ -221,9 +219,11 @@ START_TEST (test_GetDataHandle)
    x_fail_unless(handle >= 0, "Failed to open handle ==> /posHandle/last_position");
 
    ret = pclKeyHandleReadData(handle, buffer, READ_SIZE);
-   x_fail_unless(strncmp((char*)buffer, "WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\"", ret-1) == 0, "Buffer not correctly read => 1");
+   //printf("pclKeyHandleReadData: \nsoll: %s \nist : %s => ret: %d | strlen: %d\n", "WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\"", buffer, ret, strlen("WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\""));
+   x_fail_unless(strncmp((char*)buffer, "WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\"", ret) == 0, "Buffer not correctly read => 1");
 
    size = pclKeyHandleGetSize(handle);
+   //printf("pclKeyHandleGetSize => size: %d\n", size);
    x_fail_unless(size == strlen("WT_ H A N D L E: +48° 10' 38.95\", +8° 44' 39.06\""));
    // ---------------------------------------------------------------------------------------------
 
@@ -251,7 +251,6 @@ START_TEST (test_GetDataHandle)
 #if 0 // plugin test case
    memset(buffer, 0, READ_SIZE);
    handle4 = pclKeyHandleOpen(0xFF, "language/country_code", 0, 0);
-   printf("H A N D L E: %d\n", handle4);
    x_fail_unless(handle4 >= 0, "Failed to open handle /language/country_code");
 
    ret = pclKeyHandleReadData(handle4, buffer, READ_SIZE);
@@ -286,7 +285,6 @@ START_TEST (test_GetDataHandle)
    ret = pclKeyHandleClose(handle3);
    ret = pclKeyHandleClose(handle4);
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -303,9 +301,8 @@ START_TEST(test_SetData)
    X_TEST_REPORT_REFERENCE("NONE");
    X_TEST_REPORT_DESCRIPTION("Test of set data");
    X_TEST_REPORT_TYPE(GOOD);
-
    int ret = 0;
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+
    unsigned char buffer[READ_SIZE]  = {0};
    char write1[READ_SIZE] = {0};
    char write2[READ_SIZE] = {0};
@@ -313,9 +310,6 @@ START_TEST(test_SetData)
 
    struct tm *locTime;
 
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
-
 #if 1
    /**
     * Logical DB ID: 0xFF with user 3 and seat 2
@@ -378,7 +372,7 @@ START_TEST(test_SetData)
     *       ==> used for shared testing
     */
    //printf("Write data to trigger change notification\n");
-   ret = pclKeyWriteData(0x84, "links/last_link2",  2, 1, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
+   ret = pclKeyWriteData(0x20, "links/last_link2",  2, 1, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
    x_fail_unless(ret == strlen("Test notify shared data"), "Wrong write size");
 
    /**
@@ -388,7 +382,7 @@ START_TEST(test_SetData)
     *       ==> used for shared testing
     */
    //printf("Write data to trigger change notification\n");
-   ret = pclKeyWriteData(0x84, "links/last_link3",  3, 2, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
+   ret = pclKeyWriteData(0x20, "links/last_link3",  3, 2, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
    x_fail_unless(ret == strlen("Test notify shared data"), "Wrong write size");
 
    /**
@@ -398,7 +392,7 @@ START_TEST(test_SetData)
     *       ==> used for shared testing
     */
    //printf("Write data to trigger change notification\n");
-   ret = pclKeyWriteData(0x84, "links/last_link4",  4, 1, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
+   ret = pclKeyWriteData(0x20, "links/last_link4",  4, 1, (unsigned char*)"Test notify shared data", strlen("Test notify shared data"));
    x_fail_unless(ret == strlen("Test notify shared data"), "Wrong write size");
    /*******************************************************************************************************************************************/
    /*******************************************************************************************************************************************/
@@ -427,7 +421,6 @@ START_TEST(test_SetData)
    x_fail_unless(ret == strlen(write2), "Wrong read size");
 #endif
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -447,12 +440,9 @@ START_TEST(test_SetDataNoPRCT)
    X_TEST_REPORT_TYPE(GOOD);
 
    int ret = 0;
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
    unsigned char buffer[READ_SIZE] = {0};
    struct tm *locTime;
 
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 #if 1
    time_t t = time(0);
 
@@ -479,7 +469,6 @@ START_TEST(test_SetDataNoPRCT)
    x_fail_unless(ret == strlen(sysTimeBuffer), "Wrong read size");
    //printf("read buffer  : %s\n", buffer);
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -497,12 +486,7 @@ START_TEST(test_GetDataSize)
    X_TEST_REPORT_DESCRIPTION("Test of get data size");
    X_TEST_REPORT_TYPE(GOOD);
 
-   int size = 0, ret = 0;
-
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
+   int size = 0;
 #if 1
    /**
     * Logical DB ID: 0xFF with user 3 and seat 2
@@ -519,7 +503,6 @@ START_TEST(test_GetDataSize)
    size = pclKeyGetSize(0x84, "links/last_link", 2, 1);
    x_fail_unless(size == strlen("CACHE_ /last_exit/queens"), "Invalid size");
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -539,10 +522,6 @@ START_TEST(test_DeleteData)
 
    int rval = 0;
    unsigned char buffer[READ_SIZE];
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
-   rval = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(rval <= 1, "Failed to init PCL");
 #if 1
    // read data from key
    rval = pclKeyReadData(0xFF, "key_70", 1, 2, buffer, READ_SIZE);
@@ -570,7 +549,6 @@ START_TEST(test_DeleteData)
    rval = pclKeyReadData(0xFF, "70", 1, 2, buffer, READ_SIZE);
    x_fail_unless(rval == EPERS_NOKEY, "Read form key 70 works, but should fail");
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -596,6 +574,9 @@ char gBackupInfo[] = {
 
        const char* backupBlacklist = "/Data/mnt-c/lt-persistence_client_library_test/BackupFileList.info";
 
+   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+   (void)pclInitLibrary(gTheAppId, shutdownReg);
+
        if(access(backupBlacklist, F_OK) == -1)
        {
                int ret = 0;
@@ -631,7 +612,6 @@ START_TEST(test_DataFile)
    int size = 0, ret = 0, avail = 100;
    int writeSize = 16*1024;
    int fdArray[10] = {0};
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
 
    unsigned char buffer[READ_SIZE] = {0};
    unsigned char wBuffer[READ_SIZE] = {0};
@@ -639,8 +619,6 @@ START_TEST(test_DataFile)
    char* writeBuffer;
    char* fileMap = NULL;
 
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 #if 1
    writeBuffer = malloc(writeSize);
 
@@ -716,10 +694,9 @@ START_TEST(test_DataFile)
    // negative test
    size = pclFileGetSize(1024);
    x_fail_unless(size < 0 , "Got size, but should not");
-   /*
+
    ret = pclFileClose(fd);
    x_fail_unless(ret == 0, "Failed to close file");
-*/
 
    // test backup blacklist functionality
    fdArray[0] = pclFileOpen(0xFF, "media/doNotBackupMe.txt_START", 1, 1);
@@ -747,7 +724,6 @@ START_TEST(test_DataFile)
        avail = access("/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/1/media/doNotBackupMe.txt_START~", F_OK);
        x_fail_unless(avail == -1, "1. Failed backup => backup available, but should not");
 
-
        avail = access("/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/2/media/doNotBackupMe.txt_START~", F_OK);
        x_fail_unless(avail == -1, "2. Failed backup => backup available, but should not");
 
@@ -782,7 +758,6 @@ START_TEST(test_DataFile)
 
    free(writeBuffer);
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -793,6 +768,9 @@ void data_setupBackup(void)
        int handle = -1;
        const char* path = "/Data/mnt-c/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_ReadWrite.db";
 
+   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+   (void)pclInitLibrary(gTheAppId, shutdownReg);
+
    handle = open(path, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
    if(write(handle, gWriteBackupTestData, strlen(gWriteBackupTestData)) == -1)
    {
@@ -809,14 +787,10 @@ START_TEST(test_DataFileBackupCreation)
    X_TEST_REPORT_TYPE(GOOD);
 
    int fd_RW = 0, fd_RO = 0, rval = -1, handle = -1;
-   int ret = 0;
    char* wBuffer = " ==> Appended: Test Data - test_DataFileRecovery! ";
    const char* path = "/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_ReadWrite.db~";
    char rBuffer[1024] = {0};
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
 
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 #if 1
 
    fd_RO = pclFileOpen(0xFF, "media/mediaDB_ReadOnly.db", 1, 1);
@@ -854,8 +828,6 @@ START_TEST(test_DataFileBackupCreation)
    (void)pclFileClose(fd_RO);
 
 #endif
-
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -872,6 +844,9 @@ void data_setupRecovery(void)
        const char* pathToBackup   = "/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_DataRecovery.db~";
        const char* pathToChecksum = "/Data/mnt-backup/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_DataRecovery.db~.crc";
 
+   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
+   (void)pclInitLibrary(gTheAppId, shutdownReg);
+
    // create directory, even if exist
    snprintf(createPath, 128, "%s", SOURCE_PATH );
    while(gPathSegemnts[i] != NULL)
@@ -913,28 +888,19 @@ START_TEST(test_DataFileRecovery)
        X_TEST_REPORT_TYPE(GOOD);
 
        int handle = 0;
-       int ret = 0;
        unsigned char buffer[READ_SIZE] = {0};
-       unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
-       ret = pclInitLibrary(gTheAppId, shutdownReg);
-       x_fail_unless(ret <= 1, "Failed to init PCL");
-
 
        handle = pclFileOpen(0xFF, "media/mediaDB_DataRecovery.db", 1, 1);
        //printf("pclFileOpen => handle: %d\n", handle);
    x_fail_unless(handle != -1, "Could not open file ==> /media/mediaDB_DataRecovery.db");
 
 
-       ret = pclFileReadData(handle, buffer, READ_SIZE);
+       /*ret = */(void)pclFileReadData(handle, buffer, READ_SIZE);
        //printf(" ** pclFileReadData => ist-buffer : %s | size: %d\n", buffer, ret);
        //printf(" ** pclFileReadData => soll-buffer: %s | size: %d\n", gWriteRecoveryTestData, strlen(gWriteRecoveryTestData));
        x_fail_unless(strncmp((char*)buffer, gWriteRecoveryTestData, strlen(gWriteRecoveryTestData)) == 0, "Recovery failed");
 
    (void)pclFileClose(handle);
-
-   pclDeinitLibrary();
-
 }
 END_TEST
 
@@ -955,10 +921,7 @@ START_TEST(test_DataHandle)
    int handleArray[4] = {0};
    int ret = 0;
    unsigned char buffer[READ_SIZE] = {0};
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
 
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 #if 1
    // test multiple handles
    handleArray[0] = pclFileOpen(0xFF, "media/mediaDB_write_01.db", 1, 1);
@@ -1033,9 +996,7 @@ START_TEST(test_DataHandle)
 
        ret = pclFileClose(19);
        x_fail_unless(ret == -1, "Could close file, but should not!!");
-
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -1054,10 +1015,6 @@ START_TEST(test_DataHandleOpen)
    X_TEST_REPORT_TYPE(GOOD);
 
    int hd1 = -2, hd2 = -2, hd3 = -2, hd4 = -2, hd5 = -2, hd6 = -2, hd7 = -2, hd8 = -2, hd9 = -2, ret = 0;
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 #if 1
    // open handles ----------------------------------------------------
    hd1 = pclKeyHandleOpen(0xFF, "posHandle/last_position1", 0, 0);
@@ -1117,7 +1074,6 @@ START_TEST(test_DataHandleOpen)
    ret = pclKeyHandleClose(hd9);
    x_fail_unless(ret != -1, "Failed to close handle!!");
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -1134,11 +1090,6 @@ START_TEST(test_Plugin)
        int ret = 0;
        unsigned char buffer[READ_SIZE]  = {0};
 
-       unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
-
 #if 1
 
        ret = pclKeyReadData(0xFF, "secured",           0, 0, buffer, READ_SIZE);
@@ -1195,7 +1146,6 @@ START_TEST(test_Plugin)
    x_fail_unless(ret == 13579, "Failed query custom data size");       // plugin should return 13579
 
 #endif
-       pclDeinitLibrary();
 }
 END_TEST
 
@@ -1214,10 +1164,6 @@ START_TEST(test_ReadDefault)
    int ret = 0;
    unsigned char buffer[READ_SIZE]  = {0};
 
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 #if 1
    ret = pclKeyReadData(0xFF, "statusHandle/default01", 3, 2, buffer, READ_SIZE);
    //printf(" --- test_ReadConfDefault => statusHandle/default01: %s => retIst: %d retSoll: %d\n", buffer, ret, strlen("DEFAULT_01!"));
@@ -1233,7 +1179,6 @@ START_TEST(test_ReadDefault)
    x_fail_unless(ret == strlen("DEFAULT_01!"), "Invalid size");
 
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -1249,11 +1194,6 @@ START_TEST(test_ReadConfDefault)
 
    int ret = 0;
    unsigned char buffer[READ_SIZE]  = {0};
-
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 #if 1
    ret = pclKeyReadData(0xFF, "statusHandle/confdefault01",     3, 2, buffer, READ_SIZE);
    //printf(" --- test_ReadConfDefault => statusHandle/confdefault01: %s => retIst: %d retSoll: %d\n", buffer, ret, strlen("CONF_DEFAULT_01!"));
@@ -1269,7 +1209,6 @@ START_TEST(test_ReadConfDefault)
    x_fail_unless(ret == strlen("CONF_DEFAULT_02!"), "Invalid size");
 
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -1288,10 +1227,6 @@ START_TEST(test_GetPath)
    const char* thePath = "/Data/mnt-c/lt-persistence_client_library_test/user/1/seat/1/media/mediaDB_create.db";
    unsigned int pathSize = 0;
 
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
-   ret = pclInitLibrary(gTheAppId, shutdownReg);
-   x_fail_unless(ret <= 1, "Failed to init PCL");
 #if 1
    ret = pclFileCreatePath(0xFF, "media/mediaDB_create.db", 1, 1, &path, &pathSize);
 
@@ -1300,7 +1235,6 @@ START_TEST(test_GetPath)
 
    pclFileReleasePath(ret);
 #endif
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -1369,12 +1303,8 @@ START_TEST(test_NegHandle)
 {
    int handle = -1, ret = 0;
    int negativeHandle = -17;
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
    unsigned char buffer[128] = {0};
 
-   (void)pclInitLibrary(gTheAppId, shutdownReg);
-
    handle = pclKeyHandleOpen(0xFF, "posHandle/last_position", 0, 0);
    x_fail_unless(handle >= 0, "Failed to open handle ==> /posHandle/last_position");
 
@@ -1399,8 +1329,6 @@ START_TEST(test_NegHandle)
 
    // close handle
    ret = pclKeyHandleClose(handle);
-
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -1409,20 +1337,15 @@ END_TEST
 START_TEST(test_utf8_string)
 {
        int ret = 0, size = 0;
-   unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
    const char* utf8StringBuffer = "String °^° Ñ text";
    unsigned char buffer[128] = {0};
 
-   (void)pclInitLibrary(gTheAppId, shutdownReg);
-
    ret = pclKeyReadData(0xFF, "utf8String", 3, 2, buffer, READ_SIZE);
    x_fail_unless(ret == strlen(utf8StringBuffer), "Wrong read size");
    x_fail_unless(strncmp((char*)buffer, utf8StringBuffer, ret-1) == 0, "Buffer not correctly read => 1");
 
    size = pclKeyGetSize(0xFF, "utf8String", 3, 2);
    x_fail_unless(size == strlen(utf8StringBuffer), "Invalid size");
-
-   pclDeinitLibrary();
 }
 END_TEST
 
@@ -1430,14 +1353,8 @@ END_TEST
 
 START_TEST(test_Notifications)
 {
-       unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL;
-
-       (void)pclInitLibrary(gTheAppId, shutdownReg);
-
        pclKeyRegisterNotifyOnChange(0x20, "address/home_address", 1, 1, myChangeCallback);
        pclKeyUnRegisterNotifyOnChange(0x20, "address/home_address", 1, 1, myChangeCallback);
-
-       pclDeinitLibrary();
 }
 END_TEST
 
@@ -1524,15 +1441,34 @@ static Suite * persistencyClientLib_suite()
    tcase_set_timeout(tc_Notifications, 2);
 
    suite_add_tcase(s, tc_persSetData);
+   tcase_add_checked_fixture(tc_persSetData, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_persGetData);
+   tcase_add_checked_fixture(tc_persGetData, data_setup, data_teardown);
+
+   suite_add_tcase(s, tc_persGetDataHandle);
+   tcase_add_checked_fixture(tc_persGetDataHandle, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_persSetDataNoPRCT);
+   tcase_add_checked_fixture(tc_persSetDataNoPRCT, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_persGetDataSize);
+   tcase_add_checked_fixture(tc_persGetDataSize, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_persDeleteData);
-   suite_add_tcase(s, tc_persGetDataHandle);
+   tcase_add_checked_fixture(tc_persDeleteData, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_persDataHandle);
+   tcase_add_checked_fixture(tc_persDataHandle, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_persDataHandleOpen);
+   tcase_add_checked_fixture(tc_persDataHandleOpen, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_ReadDefault);
+   tcase_add_checked_fixture(tc_ReadDefault, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_ReadConfDefault);
+   tcase_add_checked_fixture(tc_ReadConfDefault, data_setup, data_teardown);
 
    suite_add_tcase(s, tc_persDataFile);
    tcase_add_checked_fixture(tc_persDataFile, data_setupBlacklist, data_teardown);
@@ -1542,12 +1478,20 @@ static Suite * persistencyClientLib_suite()
 
    suite_add_tcase(s, tc_persDataFileRecovery);
    tcase_add_checked_fixture(tc_persDataFileRecovery, data_setupRecovery, data_teardown);
-
    suite_add_tcase(s, tc_GetPath);
+   tcase_add_checked_fixture(tc_GetPath, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_NegHandle);
+   tcase_add_checked_fixture(tc_NegHandle, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_utf8_string);
+   tcase_add_checked_fixture(tc_utf8_string, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_Notifications);
+   tcase_add_checked_fixture(tc_Notifications, data_setup, data_teardown);
+
    suite_add_tcase(s, tc_Plugin);
+   tcase_add_checked_fixture(tc_Plugin, data_setup, data_teardown);
 
    suite_add_tcase(s, tc_InitDeinit);