sqlite3
libgum
glib-2.0
+ cynara-creds-socket
+ cynara-creds-dbus
+ cynara-creds-gdbus
REQUIRED
)
${PROJECT_SOURCE_DIR}/src/common/synchronization_pipe.cpp
${PROJECT_SOURCE_DIR}/src/common/timeout.cpp
${PROJECT_SOURCE_DIR}/src/common/temp_test_user.cpp
+ ${PROJECT_SOURCE_DIR}/src/common/cynara_helpers_creds.cpp
)
#system and local includes
--- /dev/null
+/*
+ * Copyright (c) 2015-2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @file cynara_helper_credentials.cpp
+ * @author Aleksander Zdyb <a.zdyb@samsung.com>
+ * @version 1.0
+ * @brief Helpers for cynara-helpers
+ */
+
+#include <dpl/test/test_runner.h>
+
+#include <cynara-creds-dbus.h>
+#include <cynara-creds-socket.h>
+#include <cynara-creds-gdbus.h>
+
+#include "cynara_helpers_creds.h"
+
+namespace CynaraHelperCredentials {
+
+char *socketGetClient(int sock, cynara_client_creds method, int expectedResult) {
+ char *buff = nullptr;
+ auto ret = cynara_creds_socket_get_client(sock, method, &buff);
+ RUNNER_ASSERT_MSG(ret == expectedResult,
+ "cynara_creds_socket_get_client failed, ret = " << ret
+ << "; expected = " << expectedResult);
+ return buff;
+}
+
+char *socketGetUser(int sock, cynara_user_creds method, int expectedResult) {
+ char *buff = nullptr;
+ auto ret = cynara_creds_socket_get_user(sock, method, &buff);
+ RUNNER_ASSERT_MSG(ret == expectedResult,
+ "cynara_creds_socket_get_user failed, ret = " << ret
+ << "; expected = " << expectedResult);
+ return buff;
+}
+
+pid_t socketGetPid(int sock, int expectedResult) {
+ pid_t pid = -1;
+ auto ret = cynara_creds_socket_get_pid(sock, &pid);
+ RUNNER_ASSERT_MSG(ret == expectedResult,
+ "cynara_creds_socket_get_pid failed, ret = " << ret << "; expected = "
+ << expectedResult);
+ return pid;
+}
+
+char *dbusGetClient(DBusConnectionPtr connection, const char *uniqueName,
+ cynara_client_creds method, int expectedResult) {
+ char *buff = nullptr;
+ auto ret = cynara_creds_dbus_get_client(connection.get(), uniqueName, method, &buff);
+ RUNNER_ASSERT_MSG(ret == expectedResult,
+ "cynara_creds_dbus_get_client failed, ret = " << ret
+ << "; expected = " << expectedResult);
+ return buff;
+}
+
+char *dbusGetUser(DBusConnectionPtr connection, const char *uniqueName, cynara_user_creds method,
+ int expectedResult) {
+ char *buff = nullptr;
+ auto ret = cynara_creds_dbus_get_user(connection.get(), uniqueName, method, &buff);
+ RUNNER_ASSERT_MSG(ret == expectedResult,
+ "cynara_creds_dbus_get_user failed, ret = " << ret
+ << "; expected = " << expectedResult);
+ return buff;
+}
+
+pid_t dbusGetPid(DBusConnectionPtr connection, const char *uniqueName, int expectedResult) {
+ pid_t pid = -1;
+ auto ret = cynara_creds_dbus_get_pid(connection.get(), uniqueName, &pid);
+ RUNNER_ASSERT_MSG(ret == expectedResult, "cynara_creds_dbus_get_pid failed, ret = " << ret
+ << "; expected = " << expectedResult);
+ return pid;
+}
+
+char *gdbusGetClient(GDBusConnectionPtr connection, const char *uniqueName,
+ cynara_client_creds method, int expectedResult) {
+ char *buff = nullptr;
+ auto ret = cynara_creds_gdbus_get_client(connection.get(), uniqueName, method, &buff);
+ RUNNER_ASSERT_MSG(ret == expectedResult,
+ "cynara_creds_gdbus_get_client failed, ret = " << ret
+ << "; expected = " << expectedResult);
+ return buff;
+}
+
+char *gdbusGetUser(GDBusConnectionPtr connection, const char *uniqueName, cynara_user_creds method,
+ int expectedResult) {
+ char *buff = nullptr;
+ auto ret = cynara_creds_gdbus_get_user(connection.get(), uniqueName, method, &buff);
+ RUNNER_ASSERT_MSG(ret == expectedResult,
+ "cynara_creds_gdbus_get_user failed, ret = " << ret
+ << "; expected = " << expectedResult);
+ return buff;
+}
+
+pid_t gdbusGetPid(GDBusConnectionPtr connection, const char *uniqueName) {
+ pid_t pid = -1;
+ auto ret = cynara_creds_gdbus_get_pid(connection.get(), uniqueName, &pid);
+ RUNNER_ASSERT_MSG(ret == CYNARA_API_SUCCESS,
+ "cynara_creds_gdbus_get_pid failed, ret = " << ret);
+ return pid;
+}
+
+} //namespace CynaraHelperCredentials
--- /dev/null
+/*
+ * Copyright (c) 2015-2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @file cynara_helper_credentials.h
+ * @author Aleksander Zdyb <a.zdyb@samsung.com>
+ * @version 1.0
+ * @brief Helpers for cynara-helpers
+ */
+
+#ifndef CYNARA_TEST_HELPERS_H_
+#define CYNARA_TEST_HELPERS_H_
+
+#include <string>
+#include <sys/types.h>
+
+#include <cynara-creds-commons.h>
+#include <cynara-error.h>
+#include <cynara_helpers_dbus.h>
+
+namespace CynaraHelperCredentials {
+
+char *socketGetClient(int sock, cynara_client_creds method,
+ int expectedResult = CYNARA_API_SUCCESS);
+
+char *socketGetUser(int sock, cynara_user_creds method,
+ int expectedResult = CYNARA_API_SUCCESS);
+
+pid_t socketGetPid(int sock, int expectedResult = CYNARA_API_SUCCESS);
+
+DBusConnectionPtr createDBusConnection(const std::string &name);
+
+char *dbusGetClient(DBusConnectionPtr connection, const char *uniqueName,
+ cynara_client_creds method, int expectedResult = CYNARA_API_SUCCESS);
+
+
+char *dbusGetUser(DBusConnectionPtr connection, const char *uniqueName, cynara_user_creds method,
+ int expectedResult = CYNARA_API_SUCCESS);
+
+pid_t dbusGetPid(DBusConnectionPtr connection, const char *uniqueName,
+ int expectedResult = CYNARA_API_SUCCESS);
+
+char *gdbusGetClient(GDBusConnectionPtr connection, const char *uniqueName,
+ cynara_client_creds method, int expectedResult = CYNARA_API_SUCCESS);
+
+
+char *gdbusGetUser(GDBusConnectionPtr connection, const char *uniqueName, cynara_user_creds method,
+ int expectedResult = CYNARA_API_SUCCESS);
+
+pid_t gdbusGetPid(GDBusConnectionPtr connection, const char *uniqueName);
+
+} // namespace CynaraHelperCredentials
+
+#endif // CYNARA_TEST_HELPERS_H_
--- /dev/null
+/*
+ * Copyright (c) 2015-2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @file cynara_helpers_dbus.h
+ * @author Aleksander Zdyb <a.zdyb@samsung.com>
+ * @version 1.0
+ */
+#ifndef CYNARA_TEST_HELPERS_DBUS_H_
+#define CYNARA_TEST_HELPERS_DBUS_H_
+
+#include <dbus/dbus.h>
+#include <functional>
+#include <gio/gio.h>
+#include <memory>
+
+typedef std::function<void(DBusConnection *)> DBusConnectionCloseAndUnref;
+typedef std::function<void(GDBusConnection *)> GDBusConnectionCloseAndUnref;
+typedef std::unique_ptr<DBusConnection, DBusConnectionCloseAndUnref> DBusConnectionPtr;
+typedef std::unique_ptr<GDBusConnection, GDBusConnectionCloseAndUnref> GDBusConnectionPtr;
+
+
+#endif // CYNARA_TEST_HELPERS_DBUS_H_
${PROJECT_SOURCE_DIR}/src/cynara-tests/common/cynara_test_cynara_mask.cpp
${PROJECT_SOURCE_DIR}/src/cynara-tests/common/cynara_test_env.cpp
${PROJECT_SOURCE_DIR}/src/cynara-tests/common/cynara_test_file_operations.cpp
- ${PROJECT_SOURCE_DIR}/src/cynara-tests/common/cynara_test_helpers.cpp
${PROJECT_SOURCE_DIR}/src/cynara-tests/plugins/plugins.cpp
${PROJECT_SOURCE_DIR}/src/cynara-tests/cynara-test.cpp
${PROJECT_SOURCE_DIR}/src/cynara-tests/test_cases.cpp
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file cynara_test_helpers.cpp
- * @author Aleksander Zdyb <a.zdyb@samsung.com>
- * @version 1.0
- * @brief Helpers for cynara-helpers
- */
-
-#include <dpl/test/test_runner.h>
-
-#include <cynara-creds-dbus.h>
-#include <cynara-creds-socket.h>
-#include <cynara-creds-gdbus.h>
-
-#include "cynara_test_helpers.h"
-
-namespace CynaraHelperCredentials {
-
-char *socketGetClient(int sock, cynara_client_creds method, int expectedResult) {
- char *buff = nullptr;
- auto ret = cynara_creds_socket_get_client(sock, method, &buff);
- RUNNER_ASSERT_MSG(ret == expectedResult,
- "cynara_creds_socket_get_client failed, ret = " << ret
- << "; expected = " << expectedResult);
- return buff;
-}
-
-char *socketGetUser(int sock, cynara_user_creds method, int expectedResult) {
- char *buff = nullptr;
- auto ret = cynara_creds_socket_get_user(sock, method, &buff);
- RUNNER_ASSERT_MSG(ret == expectedResult,
- "cynara_creds_socket_get_user failed, ret = " << ret
- << "; expected = " << expectedResult);
- return buff;
-}
-
-pid_t socketGetPid(int sock, int expectedResult) {
- pid_t pid = -1;
- auto ret = cynara_creds_socket_get_pid(sock, &pid);
- RUNNER_ASSERT_MSG(ret == expectedResult,
- "cynara_creds_socket_get_pid failed, ret = " << ret << "; expected = "
- << expectedResult);
- return pid;
-}
-
-char *dbusGetClient(DBusConnectionPtr connection, const char *uniqueName,
- cynara_client_creds method, int expectedResult) {
- char *buff = nullptr;
- auto ret = cynara_creds_dbus_get_client(connection.get(), uniqueName, method, &buff);
- RUNNER_ASSERT_MSG(ret == expectedResult,
- "cynara_creds_dbus_get_client failed, ret = " << ret
- << "; expected = " << expectedResult);
- return buff;
-}
-
-char *dbusGetUser(DBusConnectionPtr connection, const char *uniqueName, cynara_user_creds method,
- int expectedResult) {
- char *buff = nullptr;
- auto ret = cynara_creds_dbus_get_user(connection.get(), uniqueName, method, &buff);
- RUNNER_ASSERT_MSG(ret == expectedResult,
- "cynara_creds_dbus_get_user failed, ret = " << ret
- << "; expected = " << expectedResult);
- return buff;
-}
-
-pid_t dbusGetPid(DBusConnectionPtr connection, const char *uniqueName, int expectedResult) {
- pid_t pid = -1;
- auto ret = cynara_creds_dbus_get_pid(connection.get(), uniqueName, &pid);
- RUNNER_ASSERT_MSG(ret == expectedResult, "cynara_creds_dbus_get_pid failed, ret = " << ret
- << "; expected = " << expectedResult);
- return pid;
-}
-
-char *gdbusGetClient(GDBusConnectionPtr connection, const char *uniqueName,
- cynara_client_creds method, int expectedResult) {
- char *buff = nullptr;
- auto ret = cynara_creds_gdbus_get_client(connection.get(), uniqueName, method, &buff);
- RUNNER_ASSERT_MSG(ret == expectedResult,
- "cynara_creds_gdbus_get_client failed, ret = " << ret
- << "; expected = " << expectedResult);
- return buff;
-}
-
-char *gdbusGetUser(GDBusConnectionPtr connection, const char *uniqueName, cynara_user_creds method,
- int expectedResult) {
- char *buff = nullptr;
- auto ret = cynara_creds_gdbus_get_user(connection.get(), uniqueName, method, &buff);
- RUNNER_ASSERT_MSG(ret == expectedResult,
- "cynara_creds_gdbus_get_user failed, ret = " << ret
- << "; expected = " << expectedResult);
- return buff;
-}
-
-pid_t gdbusGetPid(GDBusConnectionPtr connection, const char *uniqueName) {
- pid_t pid = -1;
- auto ret = cynara_creds_gdbus_get_pid(connection.get(), uniqueName, &pid);
- RUNNER_ASSERT_MSG(ret == CYNARA_API_SUCCESS,
- "cynara_creds_gdbus_get_pid failed, ret = " << ret);
- return pid;
-}
-
-} //namespace CynaraHelperCredentials
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file cynara_test_helpers.h
- * @author Aleksander Zdyb <a.zdyb@samsung.com>
- * @version 1.0
- * @brief Helpers for cynara-helpers
- */
-
-#ifndef CYNARA_TEST_HELPERS_H_
-#define CYNARA_TEST_HELPERS_H_
-
-#include <string>
-#include <sys/types.h>
-
-#include <cynara-creds-commons.h>
-#include <cynara-error.h>
-#include <cynara_test_helpers_dbus.h>
-
-namespace CynaraHelperCredentials {
-
-char *socketGetClient(int sock, cynara_client_creds method,
- int expectedResult = CYNARA_API_SUCCESS);
-
-char *socketGetUser(int sock, cynara_user_creds method,
- int expectedResult = CYNARA_API_SUCCESS);
-
-pid_t socketGetPid(int sock, int expectedResult = CYNARA_API_SUCCESS);
-
-DBusConnectionPtr createDBusConnection(const std::string &name);
-
-char *dbusGetClient(DBusConnectionPtr connection, const char *uniqueName,
- cynara_client_creds method, int expectedResult = CYNARA_API_SUCCESS);
-
-
-char *dbusGetUser(DBusConnectionPtr connection, const char *uniqueName, cynara_user_creds method,
- int expectedResult = CYNARA_API_SUCCESS);
-
-pid_t dbusGetPid(DBusConnectionPtr connection, const char *uniqueName,
- int expectedResult = CYNARA_API_SUCCESS);
-
-char *gdbusGetClient(GDBusConnectionPtr connection, const char *uniqueName,
- cynara_client_creds method, int expectedResult = CYNARA_API_SUCCESS);
-
-
-char *gdbusGetUser(GDBusConnectionPtr connection, const char *uniqueName, cynara_user_creds method,
- int expectedResult = CYNARA_API_SUCCESS);
-
-pid_t gdbusGetPid(GDBusConnectionPtr connection, const char *uniqueName);
-
-} // namespace CynaraHelperCredentials
-
-#endif // CYNARA_TEST_HELPERS_H_
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file cynara_test_helpers_dbus.h
- * @author Aleksander Zdyb <a.zdyb@samsung.com>
- * @version 1.0
- */
-#ifndef CYNARA_TEST_HELPERS_DBUS_H_
-#define CYNARA_TEST_HELPERS_DBUS_H_
-
-#include <dbus/dbus.h>
-#include <functional>
-#include <gio/gio.h>
-#include <memory>
-
-typedef std::function<void(DBusConnection *)> DBusConnectionCloseAndUnref;
-typedef std::function<void(GDBusConnection *)> GDBusConnectionCloseAndUnref;
-typedef std::unique_ptr<DBusConnection, DBusConnectionCloseAndUnref> DBusConnectionPtr;
-typedef std::unique_ptr<GDBusConnection, GDBusConnectionCloseAndUnref> GDBusConnectionPtr;
-
-
-#endif // CYNARA_TEST_HELPERS_DBUS_H_
#include <tests_common.h>
#include <uds.h>
#include <passwd_access.h>
+#include <cynara_helpers_creds.h>
+#include <cynara_helpers_dbus.h>
-#include <cynara_test_helpers.h>
-#include <cynara_test_helpers_dbus.h>
#include <cynara-creds-gdbus.h>
#include <cynara-creds-self.h>