/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
const std::string USER("cynara");
const std::string LABEL("System");
const std::string SERVICE("cynara.service");
+const std::string SERVICE_PLUGINS_DIR("/usr/lib/cynara/plugin/service/");
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
extern const std::string USER;
extern const std::string LABEL;
extern const std::string SERVICE;
+extern const std::string SERVICE_PLUGINS_DIR;
}
CynaraTestEnv::CynaraTestEnv(const char *dirName)
: m_dbPresent(false)
{
- m_dir = TMP_DIR + "/" + dirName;
+ m_saveDir = TMP_DIR + "/" + dirName;
+ m_dbSaveDir = m_saveDir + "/db";
+ m_pluginsSaveDir = m_saveDir + "/plugins";
}
CynaraTestEnv::~CynaraTestEnv()
{
CynaraMask mask;
- clear(m_dir);
- removeDirIfExists(m_dir);
+ clear(m_dbSaveDir);
+ removeDirIfExists(m_dbSaveDir);
+ clear(m_pluginsSaveDir);
+ removeDirIfExists(m_pluginsSaveDir);
+ removeDirIfExists(m_saveDir);
+ makeDir(m_saveDir);
m_dbPresent = dirExists(CynaraTestConsts::DB_DIR);
if (m_dbPresent) {
- makeDir(m_dir);
- copyDir(CynaraTestConsts::DB_DIR, m_dir);
+ makeDir(m_dbSaveDir);
+ copyDir(CynaraTestConsts::DB_DIR, m_dbSaveDir);
}
+ makeDir(m_pluginsSaveDir);
+ copyDir(CynaraTestConsts::SERVICE_PLUGINS_DIR, m_pluginsSaveDir);
}
void CynaraTestEnv::restore()
clear(CynaraTestConsts::DB_DIR);
if (m_dbPresent)
- copyDir(m_dir, CynaraTestConsts::DB_DIR);
+ copyDir(m_dbSaveDir, CynaraTestConsts::DB_DIR);
else
removeDirIfExists(CynaraTestConsts::DB_DIR);
- clear(m_dir);
- removeDirIfExists(m_dir);
+ clear(CynaraTestConsts::SERVICE_PLUGINS_DIR);
+ copyDir(m_pluginsSaveDir, CynaraTestConsts::SERVICE_PLUGINS_DIR);
+
+ clear(m_dbSaveDir);
+ removeDirIfExists(m_dbSaveDir);
+ clear(m_pluginsSaveDir);
+ removeDirIfExists(m_pluginsSaveDir);
+ removeDirIfExists(m_saveDir);
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void restore();
private:
- std::string m_dir;
+ std::string m_saveDir;
+ std::string m_dbSaveDir;
+ std::string m_pluginsSaveDir;
bool m_dbPresent;
};