Adjust cynara wrapper to framework
[platform/core/test/security-tests.git] / src / cynara-tests / common / cynara_test_commons.h
1 /*
2  * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 /*
18  * @file        cynara_test_commons.h
19  * @author      Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
20  * @version     1.0
21  * @brief       Definition of environment wrap for test cases
22  */
23
24 #ifndef CYNARA_TEST_COMMONS_H_
25 #define CYNARA_TEST_COMMONS_H_
26
27 #include <string>
28 #include <vector>
29
30 #include <cynara_test_env.h>
31
32 #include <dpl/test/test_runner.h>
33
34 namespace CynaraTestConsts
35 {
36
37 extern const std::string DB_DIR;
38 extern const std::string USER;
39 extern const std::string LABEL;
40 extern const std::string SERVICE;
41 extern const std::string SERVICE_PLUGINS_DIR;
42 extern const std::string SOCKET_CLIENT;
43 extern const std::string SOCKET_ADMIN;
44 extern const std::string SOCKET_AGENT;
45
46 }
47
48 struct CheckKey
49 {
50     const char *m_client;
51     const char *m_user;
52     const char *m_privilege;
53 };
54
55 #define RUN_CYNARA_TEST(Proc)                \
56     RUNNER_TEST(Proc, CynaraTestEnv)         \
57
58 typedef std::vector<std::string> DirectoryPaths;
59 void loadServicePlugins(const DirectoryPaths &pluginDirectories);
60
61 void restartCynaraService();
62 void restartCynaraServiceAndSockets();
63
64 #endif /* CYNARA_TEST_COMMONS_H_ */