Makefile
# Others
-security-containers.pc
+vasum.pc
doc/html
#
CMAKE_MINIMUM_REQUIRED (VERSION 2.6.2)
-PROJECT(security-containers)
+PROJECT(vasum)
## pkgconfig ###################################################################
ADD_DEFINITIONS(-DPROGRAM_VERSION="${VERSION}")
ADD_DEFINITIONS(-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
-IF(NOT DEFINED SECURITY_CONTAINERS_USER)
- SET(SECURITY_CONTAINERS_USER "security-containers")
-ENDIF(NOT DEFINED SECURITY_CONTAINERS_USER)
+IF(NOT DEFINED VASUM_USER)
+ SET(VASUM_USER "security-containers")
+ENDIF(NOT DEFINED VASUM_USER)
IF(NOT DEFINED INPUT_EVENT_GROUP)
SET(INPUT_EVENT_GROUP "input")
ENDIF(NOT DEFINED INPUT_EVENT_GROUP)
SET(TTY_GROUP "tty")
ENDIF(NOT DEFINED TTY_GROUP)
-ADD_DEFINITIONS(-DSECURITY_CONTAINERS_USER="${SECURITY_CONTAINERS_USER}")
+ADD_DEFINITIONS(-DVASUM_USER="${VASUM_USER}")
ADD_DEFINITIONS(-DINPUT_EVENT_GROUP="${INPUT_EVENT_GROUP}")
ADD_DEFINITIONS(-DDISK_GROUP="${DISK_GROUP}")
ADD_DEFINITIONS(-DTTY_GROUP="${TTY_GROUP}")
SET(SYSTEMD_UNIT_DIR "${LIB_INSTALL_DIR}/systemd/system")
ENDIF(NOT DEFINED SYSTEMD_UNIT_DIR)
-SET(SC_CONFIG_INSTALL_DIR ${SYSCONF_INSTALL_DIR}/security-containers)
-SET(SC_DATA_INSTALL_DIR ${SHARE_INSTALL_PREFIX}/security-containers)
+SET(VSM_CONFIG_INSTALL_DIR ${SYSCONF_INSTALL_DIR}/vasum)
+SET(VSM_DATA_INSTALL_DIR ${SHARE_INSTALL_PREFIX}/vasum)
ADD_SUBDIRECTORY(${CLIENT_FOLDER})
ADD_SUBDIRECTORY(${SERVER_FOLDER})
## Link libraries ##############################################################
-PKG_CHECK_MODULES(LIB_DEPS REQUIRED security-containers)
+PKG_CHECK_MODULES(LIB_DEPS REQUIRED vasum)
INCLUDE_DIRECTORIES(${CLIENT_FOLDER})
INCLUDE_DIRECTORIES(${COMMON_FOLDER})
#include "config.hpp"
#include "command-line-interface.hpp"
-#include <security-containers-client.h>
+#include <vasum-client.h>
#include <map>
#include <stdexcept>
using namespace std;
-namespace security_containers {
+namespace vasum {
namespace cli {
namespace {
}
} // namespace cli
-} // namespace security_containers
+} // namespace vasum
#include <ostream>
#include <string>
-namespace security_containers {
+namespace vasum {
namespace cli {
/**
} // namespace cli
-} // namespace security_containers
+} // namespace vasum
#endif /* CLI_COMMAND_LINE_INTERFACE_HPP */
#include <string>
#include <iostream>
-using namespace security_containers::cli;
+using namespace vasum::cli;
std::map<std::string, CommandLineInterface> commands = {
{
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT RuntimeLibraries)
-INSTALL(FILES security-containers-client.h
+INSTALL(FILES vasum-client.h
DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME})
* @brief Utility functions declaration
*/
-#ifndef SECURITY_CONTAINERS_CLIENT_UTILS_HPP
-#define SECURITY_CONTAINERS_CLIENT_UTILS_HPP
+#ifndef VASUM_CLIENT_UTILS_HPP
+#define VASUM_CLIENT_UTILS_HPP
#include <string>
bool parseContainerIdFromCpuSet(const std::string& cpuset, std::string& id);
-#endif // SECURITY_CONTAINERS_CLIENT_UTILS_HPP
+#endif // VASUM_CLIENT_UTILS_HPP
/**
* @file
* @author Mateusz Malicki (m.malicki2@samsung.com)
- * @brief This file contains security-containers-server's client implementation
+ * @brief This file contains vasum-server's client implementation
*/
#include <config.hpp>
-#include "security-containers-client-impl.hpp"
+#include "vasum-client-impl.hpp"
#include "utils.hpp"
#include <dbus/connection.hpp>
#include <dbus/exception.hpp>
using namespace std;
using namespace dbus;
-using namespace security_containers;
-using namespace security_containers::utils;
+using namespace vasum;
+using namespace vasum::utils;
namespace {
/**
* @file
* @author Mateusz Malicki (m.malicki2@samsung.com)
- * @brief This file contains security-containers-server's client definition
+ * @brief This file contains vasum-server's client definition
*/
-#ifndef SECURITY_CONTAINERS_CLIENT_IMPL_HPP
-#define SECURITY_CONTAINERS_CLIENT_IMPL_HPP
+#ifndef VASUM_CLIENT_IMPL_HPP
+#define VASUM_CLIENT_IMPL_HPP
-#include "security-containers-client.h"
+#include "vasum-client.h"
#include <dbus/connection.hpp>
#include <exception>
};
/**
- * security-containers's client definition.
+ * vasum's client definition.
*
* Client uses dbus API.
*/
static VsmStatus vsm_stop_glib_loop() noexcept;
};
-#endif /* SECURITY_CONTAINERS_CLIENT_IMPL_HPP */
+#endif /* VASUM_CLIENT_IMPL_HPP */
/**
* @file
* @author Mateusz Malicki (m.malicki2@samsung.com)
- * @brief This file contains the public API for Security Containers Client
+ * @brief This file contains the public API for Vasum Client
*/
#include <config.hpp>
-#include "security-containers-client.h"
-#include "security-containers-client-impl.hpp"
+#include "vasum-client.h"
+#include "vasum-client-impl.hpp"
#include <cassert>
/**
* @file
* @author Mateusz Malicki (m.malicki2@samsung.com)
- * @brief This file contains the public API for Security Containers Client
+ * @brief This file contains the public API for Vasum Client
*
* @par Example usage:
* @code
#include <stdio.h>
-#include "client/security-containers-client.h"
+#include "client/vasum-client.h"
int main(int argc, char** argv)
{
@endcode
*/
-#ifndef SECURITY_CONTAINERS_CLIENT_H
-#define SECURITY_CONTAINERS_CLIENT_H
+#ifndef VASUM_CLIENT_H
+#define VASUM_CLIENT_H
#include <stdint.h>
#include <sys/stat.h>
#endif
/**
- * security-containers-server's client pointer.
+ * vasum-server's client pointer.
*/
typedef void* VsmClient;
VsmStatus vsm_stop_glib_loop();
/**
- * Create a new security-containers-server's client.
+ * Create a new vasum-server's client.
*
* @return Created client pointer or NULL on failure.
*/
/**
* Release client resources.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
*/
void vsm_client_free(VsmClient client);
/**
- * Get status code of last security-containers-server communication.
+ * Get status code of last vasum-server communication.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @return status of this function call
*/
VsmStatus vsm_get_status(VsmClient client);
/**
- * Get status message of the last security-containers-server communication.
+ * Get status message of the last vasum-server communication.
*
- * @param[in] client security-containers-server's client
- * @return last status message from security-containers-server communication
+ * @param[in] client vasum-server's client
+ * @return last status message from vasum-server communication
*/
const char* vsm_get_status_message(VsmClient client);
/**
- * Connect client to the security-containers-server.
+ * Connect client to the vasum-server.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @return status of this function call
*/
VsmStatus vsm_connect(VsmClient client);
/**
- * Connect client to the security-containers-server via custom address.
+ * Connect client to the vasum-server via custom address.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] address dbus address
* @return status of this function call
*/
/**
* Get dbus address of each container.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[out] keys array of containers name
* @param[out] values array of containers dbus address
* @return status of this function call
/**
* Get containers name.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[out] array array of containers name
* @return status of this function call
* @remark Use vsm_array_string_free() to free memory occupied by @p array.
/**
* Get active (foreground) container name.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[out] id active container name
* @return status of this function call
* @remark Use @p vsm_string_free() to free memory occupied by @p id.
/**
* Get container name of process with given pid.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] pid process id
* @param[out] id active container name
* @return status of this function call
/**
* Get zone informations of zone with given id.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] id zone name
* @param[out] zone zone informations
* @return status of this function call
/**
* Get zone name with given terminal.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] terminal terminal id
* @param[out] id zone name with given terminal
* @return status of this function call
/**
* Set active (foreground) container.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] id container name
* @return status of this function call
*/
/**
* Create and add container
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] id container id
* @param[in] tname template name, NULL for default
* @return status of this function call
/**
* Remove zone
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] id container id
* @param[in] force if 0 data will be kept, otherwise data will be lost
* @return status of this function call
/**
* Shutdown zone
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] id zone name
* @return status of this function call
*/
/**
* Start zone
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] id zone name
* @return status of this function call
*/
/**
* Lock zone
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] id zone name
* @return status of this function call
*/
/**
* Unlock zone
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] id zone name
* @return status of this function call
*/
*
* @note The callback function will be invoked on a different thread.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] containerDbusStateCallback callback function
* @param[in] data some extra data that will be passed to callback function
* @param[out] subscriptionId subscription identifier that can be used to unsubscribe signal,
/**
* Unregister dbus state change callback function.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] subscriptionId subscription identifier returned by vsm_add_state_callback
* @return status of this function call
*/
/**
* Grant access to device
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] device device path
* @param[in] flags access flags
/**
* Revoke access to device
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] device device path
* @return status of this function call
/**
* Get array of netdev from given zone
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[out] netdevIds array of netdev id
* @return status of this function call
/**
* Get ipv4 address for given netdevId
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] netdevId netdev id
* @param[out] addr ipv4 address
/**
* Get ipv6 address for given netdevId
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] netdevId netdev id
* @param[out] addr ipv6 address
/**
* Set ipv4 address for given netdevId
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] netdevId netdev id
* @param[in] addr ipv4 address
/**
* Set ipv6 address for given netdevId
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] netdevId netdev id
* @param[in] addr ipv6 address
/**
* Create netdev in zone
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] netdevType netdev type
* @param[in] target TODO: this is taken form zone-control
/**
* Remove netdev from zone
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] netdevId network device id
* @return status of this function call
/**
* Get netdev informations
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] netdevId network device id
* @param[out] netdev netdev informations
*
* Declare file, directory or pipe that will be created while container startup
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] type file type
* @param[in] container container id
* @param[in] path path to file
* Declare mount that will be created while container startup
* Parameters are passed to mount system function
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] source device path (path in host)
* @param[in] container container id
* @param[in] target mount point (path in container)
* Declare link that will be created while container startup
* Parameters are passed to link system function
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] source path to link source (in host)
* @param[in] container container id
* @param[in] target path to link name (in container)
/**
* Send message to active container.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] application application name
* @param[in] message message
* @return status of this function call
/**
* Move file between containers.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] destContainer destination container id
* @param[in] path path to moved file
* @return status of this function call
*
* @note The callback function will be invoked on a different thread.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] notificationCallback callback function
* @param[in] data some extra data that will be passed to callback function
* @param[out] subscriptionId subscription identifier that can be used to unsubscribe signal,
/**
* Unregister notification callback function.
*
- * @param[in] client security-containers-server's client
+ * @param[in] client vasum-server's client
* @param[in] subscriptionId subscription identifier returned by vsm_add_notification_callback
* @return status of this function call
*/
}
#endif
-#endif /* SECRITY_CONTAINERS_CLIENT_H */
+#endif /* VASUM_CLIENT_H */
libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
-Name: security-containers
-Description: Security Containers library
+Name: vasum
+Description: Vasum library
Version: @_LIB_VERSION_@
-Libs: -L${libdir} -lsecurity-containers-client
-Cflags: -I${includedir}/security-containers
+Libs: -L${libdir} -lvasum-client
+Cflags: -I${includedir}/vasum
/**
* @file
* @author Piotr Bartosiewicz (p.bartosiewi@partner.samsung.com)
- * @brief Security containers base exception
+ * @brief Vasum base exception
*/
#include <string>
-namespace security_containers {
+namespace vasum {
/**
- * Base class security containers exceptions
+ * Base class vasum exceptions
*/
-struct SecurityContainersException: public std::runtime_error {
+struct VasumException: public std::runtime_error {
- SecurityContainersException(const std::string& error = "") : std::runtime_error(error) {}
+ VasumException(const std::string& error = "") : std::runtime_error(error) {}
};
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_BASE_EXCEPTION_HPP
#include "ipc/internals/socket.hpp"
#include "ipc/exception.hpp"
-namespace security_containers {
+namespace vasum {
namespace ipc {
Client::Client(const std::string& socketPath)
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#include <string>
-namespace security_containers {
+namespace vasum {
namespace ipc {
/**
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_CLIENT_HPP
#include "base-exception.hpp"
-namespace security_containers {
+namespace vasum {
/**
* Base class for exceptions in IPC
*/
-struct IPCException: public SecurityContainersException {
- IPCException(const std::string& error) : SecurityContainersException(error) {}
+struct IPCException: public VasumException {
+ IPCException(const std::string& error) : VasumException(error) {}
};
struct IPCParsingException: public IPCException {
#include <chrono>
#include <vector>
-namespace security_containers {
+namespace vasum {
namespace ipc {
Acceptor::Acceptor(const std::string& socketPath, const NewConnectionCallback& newConnectionCallback)
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#include <string>
#include <thread>
-namespace security_containers {
+namespace vasum {
namespace ipc {
/**
};
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_INTERNALS_ACCEPTOR_HPP
#include "ipc/exception.hpp"
#include "logger/logger.hpp"
-namespace security_containers {
+namespace vasum {
namespace ipc {
CallQueue::CallQueue()
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#include <atomic>
#include <queue>
-namespace security_containers {
+namespace vasum {
namespace ipc {
/**
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_INTERNALS_CALL_QUEUE_HPP
#include <mutex>
#include <queue>
-namespace security_containers {
+namespace vasum {
namespace ipc {
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_INTERNALS_EVENT_QUEUE_HPP
#include <cstring>
#include <cstdint>
-namespace security_containers {
+namespace vasum {
namespace ipc {
EventFD::EventFD()
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#ifndef COMMON_IPC_INTERNALS_EVENTFD_HPP
#define COMMON_IPC_INTERNALS_EVENTFD_HPP
-namespace security_containers {
+namespace vasum {
namespace ipc {
class EventFD {
};
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_INTERNALS_EVENTFD_HPP
#include <sys/socket.h>
#include <limits>
-namespace security_containers {
+namespace vasum {
namespace ipc {
#define IGNORE_EXCEPTIONS(expr) \
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#include <functional>
#include <unordered_map>
-namespace security_containers {
+namespace vasum {
namespace ipc {
const unsigned int DEFAULT_MAX_NUMBER_OF_PEERS = 500;
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_INTERNALS_PROCESSOR_HPP
#include <cstring>
-namespace security_containers {
+namespace vasum {
namespace ipc {
namespace {
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#include <mutex>
#include <memory>
-namespace security_containers {
+namespace vasum {
namespace ipc {
/**
};
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_INTERNALS_SOCKET_HPP
namespace fs = boost::filesystem;
namespace chr = std::chrono;
-namespace security_containers {
+namespace vasum {
namespace ipc {
namespace {
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#include <cstddef>
-namespace security_containers {
+namespace vasum {
namespace ipc {
/**
unsigned int getFDNumber();
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_INTERNALS_UTILS_HPP
using namespace std::placeholders;
-namespace security_containers {
+namespace vasum {
namespace ipc {
Service::Service(const std::string& socketPath,
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#include <string>
-namespace security_containers {
+namespace vasum {
namespace ipc {
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_SERVICE_HPP
#include "logger/logger.hpp"
-namespace security_containers {
+namespace vasum {
namespace ipc {
std::string toString(const Status status)
}
}
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#include <memory>
#include <string>
-namespace security_containers {
+namespace vasum {
namespace ipc {
typedef int FileDescriptor;
};
} // namespace ipc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_IPC_HANDLERS_HPP
#include "base-exception.hpp"
-namespace security_containers {
+namespace vasum {
/**
* Base class for exceptions in utils
*/
-struct LxcException: public SecurityContainersException {
+struct LxcException: public VasumException {
- LxcException(const std::string& error) : SecurityContainersException(error) {}
+ LxcException(const std::string& error) : VasumException(error) {}
};
-}
-
+} // namespace vasum
#endif // COMMON_UTILS_EXCEPTION_HPP
#include <map>
-namespace security_containers {
+namespace vasum {
namespace lxc {
namespace {
} // namespace lxc
-} // namespace security_containers
+} // namespace vasum
// fwd declaration of lxc internals
struct lxc_container;
-namespace security_containers {
+namespace vasum {
namespace lxc {
} // namespace lxc
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_LXC_ZONE_HPP
#include <vector>
-namespace security_containers {
+namespace vasum {
namespace utils {
template<typename T>
typedef CArrayBuilder<const char*> CStringArrayBuilder;
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_C_ARRAY_HPP
#include <cassert>
-namespace security_containers {
+namespace vasum {
namespace utils {
// Reference counting class like shared_ptr but with the ability to wait for it.
}
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <memory>
-namespace security_containers {
+namespace vasum {
namespace utils {
/**
};
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_CALLBACK_GUARD_HPP
#include "callback-guard.hpp"
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_CALLBACK_WRAPPER_HPP
#include <cstring>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <sys/types.h>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_ENVIRONMENT_HPP
#include "base-exception.hpp"
-namespace security_containers {
+namespace vasum {
/**
* Base class for exceptions in utils
*/
-struct UtilsException: public SecurityContainersException {
+struct UtilsException: public VasumException {
- UtilsException(const std::string& error = "") : SecurityContainersException(error) {}
+ UtilsException(const std::string& error = "") : VasumException(error) {}
};
-}
-
+} // namespace vasum
#endif // COMMON_UTILS_EXCEPTION_HPP
#include <unistd.h>
#include <sys/wait.h>
-namespace security_containers {
+namespace vasum {
namespace utils {
namespace {
}
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <sys/types.h>
-namespace security_containers {
+namespace vasum {
namespace utils {
bool executeAndWait(const char* fname, const char* const* argv);
bool waitPid(pid_t pid, int& status);
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_EXECUTE_HPP
#include <stdexcept>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <string>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_FILE_WAIT_HPP
#include <iostream>
-namespace security_containers {
+namespace vasum {
namespace utils {
}
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <boost/filesystem.hpp>
-namespace security_containers {
+namespace vasum {
namespace utils {
/**
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_FS_HPP
#include <cassert>
#include <glib-object.h>
-namespace security_containers {
+namespace vasum {
namespace utils {
namespace {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <glib.h>
-namespace security_containers {
+namespace vasum {
namespace utils {
};
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_GLIB_LOOP_HPP
#include <fcntl.h>
#include <linux/loop.h>
-namespace security_containers {
+namespace vasum {
namespace utils {
namespace {
}
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#ifndef COMMON_UTILS_IMG_HPP
#define COMMON_UTILS_IMG_HPP
-namespace security_containers {
+namespace vasum {
namespace utils {
/**
bool copyImageContents(const std::string& img, const std::string& dst);
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_IMG_HPP
#include <fcntl.h>
#include <errno.h>
-namespace security_containers {
+namespace vasum {
namespace utils {
namespace {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#define COMMON_UTILS_INITCTL_HPP
-namespace security_containers {
+namespace vasum {
namespace utils {
enum RunLevel : int {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_INITCTL_HPP
#include <cassert>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <condition_variable>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_LATCH_HPP
#include <algorithm>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_PATHS_HPP
#include "scoped-gerror.hpp"
-namespace security_containers {
+namespace vasum {
namespace utils {
ScopedGError::ScopedGError()
}
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <iostream>
#include <gio/gio.h>
-namespace security_containers{
+namespace vasum{
namespace utils {
class ScopedGError {
};
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_SCOPED_GERROR_HPP
#include <cxxabi.h>
#include <stdexcept>
-namespace security_containers {
+namespace vasum {
namespace utils {
std::string getTypeName(const std::type_info& ti)
}
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <string>
#include <typeinfo>
-namespace security_containers {
+namespace vasum {
namespace utils {
std::string getTypeName(const std::type_info& ti);
}
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_TYPE_INFO_HPP
} // namespace
-namespace security_containers {
+namespace vasum {
namespace utils {
bool activateVT(const int& vt)
}
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#ifndef COMMON_UTILS_VT_HPP
#define COMMON_UTILS_VT_HPP
-namespace security_containers {
+namespace vasum {
namespace utils {
bool activateVT(const int& vt);
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // COMMON_UTILS_VT_HPP
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
- <policy user="${SECURITY_CONTAINERS_USER}">
+ <policy user="${VASUM_USER}">
<allow own="org.tizen.containers.zone.daemon"/>
<allow send_destination="org.tizen.containers.zone.daemon"/>
<allow receive_sender="org.tizen.containers.zone.daemon"/>
#include "logger/logger.hpp"
-namespace security_containers {
+namespace vasum {
namespace container_daemon {
namespace {
}
} // namespace container_daemon
-} // namespace security_containers
+} // namespace vasum
#include <condition_variable>
-namespace security_containers {
+namespace vasum {
namespace container_daemon {
} // namespace container_daemon
-} // namespace security_containers
+} // namespace vasum
#endif // CONTAINER_DAEMON_DAEMON_CONNECTION_HPP
#include <string>
-namespace security_containers {
+namespace vasum {
namespace container_daemon {
namespace api {
} // namespace api
} // namespace container_daemon
-} // namespace security_containers
+} // namespace vasum
#endif // CONTAINER_DAEMON_DAEMON_DBUS_DEFINITIONS_HPP
#include "logger/logger.hpp"
-namespace security_containers {
+namespace vasum {
namespace container_daemon {
}
} // namespace container_daemon
-} // namespace security_containers
+} // namespace vasum
#include <memory>
-namespace security_containers {
+namespace vasum {
namespace container_daemon {
class Daemon {
} // namespace container_daemon
-} // namespace security_containers
+} // namespace vasum
#endif // CONTAINER_DAEMON_DAEMON_HPP
#include "base-exception.hpp"
-namespace security_containers {
+namespace vasum {
namespace container_daemon {
/**
- * Base class for exceptions in Security Containers Container Daemon
+ * Base class for exceptions in Vasum Container Daemon
*/
-struct ContainerDaemonException: public SecurityContainersException {
+struct ContainerDaemonException: public VasumException {
- ContainerDaemonException(const std::string& error = "") : SecurityContainersException(error) {}
+ ContainerDaemonException(const std::string& error = "") : VasumException(error) {}
};
} // container_daemon
-} // security_containers
+} // vasum
#endif // CONTAINER_DAEMON_EXCEPTION_HPP
/**
* @file
* @author Jan Olszak (j.olszak@samsung.com)
- * @brief Main file for the Security Containers Daemon
+ * @brief Main file for the Vasum Daemon
*/
// Always log to console in DEBUG mode
#include <iostream>
using namespace logger;
-using namespace security_containers;
+using namespace vasum;
namespace po = boost::program_options;
namespace {
const std::string PROGRAM_NAME_AND_VERSION =
- "Security Containers Containers Daemon " PROGRAM_VERSION;
+ "Vasum Containers Daemon " PROGRAM_VERSION;
} // namespace
#include <csignal>
-namespace security_containers {
+namespace vasum {
namespace container_daemon {
}
} // namespace container_daemon
-} // namespace security_containers
+} // namespace vasum
#define CONTAINER_DAEMON_RUNNER_HPP
-namespace security_containers {
+namespace vasum {
namespace container_daemon {
} // namespace container_daemon
-} // namespace security_containers
+} // namespace vasum
#endif // CONTAINER_DAEMON_RUNNER_HPP
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
- <policy user="${SECURITY_CONTAINERS_USER}">
+ <policy user="${VASUM_USER}">
<allow own="org.tizen.containers.zone"/>
<allow send_destination="org.tizen.containers.zone"/>
<allow receive_sender="org.tizen.containers.zone"/>
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.
-PROJECT_NAME = security-containers
+PROJECT_NAME = Vasum
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
%define script_dir %{_sbindir}
-# Security Containers Server's user info - it should already exist in the system
-%define scs_user security-containers
+# Vasum Server's user info - it should already exist in the system
+%define vsm_user security-containers
# The group that has read and write access to /dev/input/event* devices.
# It may vary between platforms.
%define input_event_group input
# The group that has write access to /dev/tty* devices.
%define tty_group tty
-Name: security-containers
+Name: vasum
Version: 0.1.1
Release: 0
Source0: %{name}-%{version}.tar.gz
(display, input devices) to the other container.
%files
-%manifest packaging/security-containers.manifest
+%manifest packaging/vasum.manifest
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/security-containers-server
-%dir /etc/security-containers
-%dir /etc/security-containers/containers
-%dir /etc/security-containers/lxc-templates
-%dir /etc/security-containers/templates
-%config /etc/security-containers/daemon.conf
-%config /etc/security-containers/containers/*.conf
-%attr(755,root,root) /etc/security-containers/lxc-templates/*.sh
-%config /etc/security-containers/templates/*.conf
-%{_unitdir}/security-containers.service
-%{_unitdir}/multi-user.target.wants/security-containers.service
+%attr(755,root,root) %{_bindir}/vasum-server
+%dir /etc/vasum
+%dir /etc/vasum/containers
+%dir /etc/vasum/lxc-templates
+%dir /etc/vasum/templates
+%config /etc/vasum/daemon.conf
+%config /etc/vasum/containers/*.conf
+%attr(755,root,root) /etc/vasum/lxc-templates/*.sh
+%config /etc/vasum/templates/*.conf
+%{_unitdir}/vasum.service
+%{_unitdir}/multi-user.target.wants/vasum.service
/etc/dbus-1/system.d/org.tizen.containers.host.conf
%prep
-DSCRIPT_INSTALL_DIR=%{script_dir} \
-DSYSTEMD_UNIT_DIR=%{_unitdir} \
-DPYTHON_SITELIB=%{python_sitelib} \
- -DSECURITY_CONTAINERS_USER=%{scs_user} \
+ -DVASUM_USER=%{vsm_user} \
-DINPUT_EVENT_GROUP=%{input_event_group} \
-DDISK_GROUP=%{disk_group} \
-DTTY_GROUP=%{tty_group}
%install
%make_install
mkdir -p %{buildroot}/%{_unitdir}/multi-user.target.wants
-ln -s ../security-containers.service %{buildroot}/%{_unitdir}/multi-user.target.wants/security-containers.service
+ln -s ../vasum.service %{buildroot}/%{_unitdir}/multi-user.target.wants/vasum.service
%clean
rm -rf %{buildroot}
systemctl daemon-reload || :
fi
# set needed caps on the binary to allow restart without loosing them
-setcap CAP_SYS_ADMIN,CAP_MAC_OVERRIDE,CAP_SYS_TTY_CONFIG+ei %{_bindir}/security-containers-server
+setcap CAP_SYS_ADMIN,CAP_MAC_OVERRIDE,CAP_SYS_TTY_CONFIG+ei %{_bindir}/vasum-server
%preun
# Stop the service before uninstall
if [ $1 == 0 ]; then
- systemctl stop security-containers.service || :
+ systemctl stop vasum.service || :
fi
%postun
systemctl daemon-reload || :
if [ $1 -ge 1 ]; then
# TODO: at this point an appropriate notification should show up
- eval `systemctl show security-containers --property=MainPID`
+ eval `systemctl show vasum --property=MainPID`
if [ -n "$MainPID" -a "$MainPID" != "0" ]; then
kill -USR1 $MainPID
fi
- echo "Security Containers updated. Reboot is required for the changes to take effect..."
+ echo "Vasum updated. Reboot is required for the changes to take effect..."
else
- echo "Security Containers removed. Reboot is required for the changes to take effect..."
+ echo "Vasum removed. Reboot is required for the changes to take effect..."
fi
## Client Package ##############################################################
%package client
-Summary: Security Containers Client
+Summary: Vasum Client
Group: Development/Libraries
-Requires: security-containers = %{version}-%{release}
+Requires: vasum = %{version}-%{release}
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%description client
-Library interface to the security-containers daemon
+Library interface to the vasum daemon
%files client
-%manifest packaging/libsecurity-containers-client.manifest
+%manifest packaging/libvasum-client.manifest
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libsecurity-containers.so.0.0.1
-%{_libdir}/libsecurity-containers.so.0
+%attr(755,root,root) %{_libdir}/libvasum.so.0.0.1
+%{_libdir}/libvasum.so.0
%post client -p /sbin/ldconfig
## Devel Package ###############################################################
%package devel
-Summary: Security Containers Client Devel
+Summary: Vasum Client Devel
Group: Development/Libraries
-Requires: security-containers = %{version}-%{release}
-Requires: security-containers-client = %{version}-%{release}
+Requires: vasum = %{version}-%{release}
+Requires: vasum-client = %{version}-%{release}
%description devel
Development package including the header files for the client library
%files devel
-%manifest packaging/security-containers.manifest
+%manifest packaging/vasum.manifest
%defattr(644,root,root,755)
-%{_libdir}/libsecurity-containers.so
-%{_includedir}/security-containers
+%{_libdir}/libvasum.so
+%{_includedir}/vasum
%{_libdir}/pkgconfig/*.pc
## Container Support Package ###################################################
# TODO move to a separate repository
%package container-support
-Summary: Security Containers Support
+Summary: Vasum Support
Group: Security/Other
-Conflicts: security-containers
+Conflicts: vasum
%description container-support
Containers support installed inside every container.
%files container-support
-%manifest packaging/security-containers-container-support.manifest
+%manifest packaging/vasum-container-support.manifest
%defattr(644,root,root,755)
/etc/dbus-1/system.d/org.tizen.containers.zone.conf
## Container Daemon Package ####################################################
# TODO move to a separate repository
%package container-daemon
-Summary: Security Containers Containers Daemon
+Summary: Vasum Containers Daemon
Group: Security/Other
-Requires: security-containers-container-support = %{version}-%{release}
+Requires: vasum-container-support = %{version}-%{release}
%description container-daemon
Daemon running inside every container.
%files container-daemon
-%manifest packaging/security-containers-container-daemon.manifest
+%manifest packaging/vasum-container-daemon.manifest
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/security-containers-container-daemon
+%attr(755,root,root) %{_bindir}/vasum-container-daemon
/etc/dbus-1/system.d/org.tizen.containers.zone.daemon.conf
## Command Line Interface ######################################################
%package cli
-Summary: Security Containers Command Line Interface
+Summary: Vasum Command Line Interface
Group: Security/Other
-Requires: security-containers-client = %{version}-%{release}
+Requires: vasum-client = %{version}-%{release}
%description cli
-Command Line Interface for security-containers.
+Command Line Interface for vasum.
%files cli
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/security-containers-cli
+%attr(755,root,root) %{_bindir}/vasum-cli
## Test Package ################################################################
%package tests
-Summary: Security Containers Tests
+Summary: Vasum Tests
Group: Development/Libraries
-Requires: security-containers = %{version}-%{release}
-Requires: security-containers-client = %{version}-%{release}
+Requires: vasum = %{version}-%{release}
+Requires: vasum-client = %{version}-%{release}
Requires: python
Requires: python-xml
Requires: boost-test
Unit tests for both: server and client and integration tests.
%files tests
-%manifest packaging/security-containers-server-tests.manifest
+%manifest packaging/vasum-server-tests.manifest
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/security-containers-server-unit-tests
-%attr(755,root,root) %{script_dir}/sc_all_tests.py
-%attr(755,root,root) %{script_dir}/sc_int_tests.py
-%attr(755,root,root) %{script_dir}/sc_launch_test.py
-%{script_dir}/sc_test_parser.py
-%{_datadir}/security-containers/tests
-%attr(755,root,root) %{_datadir}/security-containers/lxc-templates
-%{python_sitelib}/sc_integration_tests
+%attr(755,root,root) %{_bindir}/vasum-server-unit-tests
+%attr(755,root,root) %{script_dir}/vsm_all_tests.py
+%attr(755,root,root) %{script_dir}/vsm_int_tests.py
+%attr(755,root,root) %{script_dir}/vsm_launch_test.py
+%{script_dir}/vsm_test_parser.py
+%{_datadir}/vasum/tests
+%attr(755,root,root) %{_datadir}/vasum/lxc-templates
+%{python_sitelib}/vsm_integration_tests
/etc/dbus-1/system.d/org.tizen.containers.tests.conf
#include <string>
-namespace security_containers {
+namespace vasum {
namespace api {
const std::string ERROR_FORBIDDEN = "org.tizen.containers.Error.Forbidden";
const std::string ERROR_FORWARDED = "org.tizen.containers.Error.Forwarded";
const std::string METHOD_PROXY_CALL = "ProxyCall";
} // namespace api
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_COMMON_DBUS_DEFINITIONS_HPP
# @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
#
-MESSAGE(STATUS "Installing configs to " ${SC_CONFIG_INSTALL_DIR})
+MESSAGE(STATUS "Installing configs to " ${VSM_CONFIG_INSTALL_DIR})
FILE(GLOB container_CONF containers/*.conf)
FILE(GLOB admin_CONF lxc-templates/*.sh)
FILE(GLOB template_CONF templates/*.conf)
## Generate ####################################################################
-CONFIGURE_FILE(systemd/security-containers.service.in
- ${CMAKE_BINARY_DIR}/systemd/security-containers.service)
+CONFIGURE_FILE(systemd/vasum.service.in
+ ${CMAKE_BINARY_DIR}/systemd/vasum.service)
## Install #####################################################################
INSTALL(FILES daemon.conf
- DESTINATION ${SC_CONFIG_INSTALL_DIR})
+ DESTINATION ${VSM_CONFIG_INSTALL_DIR})
# preprocess d-bus configs
CONFIGURE_FILE(dbus-1/system.d/org.tizen.containers.host.conf.in
DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/)
INSTALL(FILES ${container_CONF}
- DESTINATION ${SC_CONFIG_INSTALL_DIR}/containers)
+ DESTINATION ${VSM_CONFIG_INSTALL_DIR}/containers)
INSTALL(PROGRAMS ${admin_CONF}
- DESTINATION ${SC_CONFIG_INSTALL_DIR}/lxc-templates)
+ DESTINATION ${VSM_CONFIG_INSTALL_DIR}/lxc-templates)
INSTALL(PROGRAMS ${template_CONF}
- DESTINATION ${SC_CONFIG_INSTALL_DIR}/templates)
+ DESTINATION ${VSM_CONFIG_INSTALL_DIR}/templates)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/systemd/security-containers.service
+INSTALL(FILES ${CMAKE_BINARY_DIR}/systemd/vasum.service
DESTINATION ${SYSTEMD_UNIT_DIR})
"containersPath" : "/opt/usr/containers",
"containerImagePath" : "/opt/usr/containers/img/system-data.img",
"containerTemplatePath" : "templates",
- "containerNewConfigPrefix" : "/var/lib/security-containers",
+ "containerNewConfigPrefix" : "/var/lib/vasum",
"runMountPointPrefix" : "/var/run/containers",
"foregroundId" : "private",
"defaultId" : "private",
- "lxcTemplatePrefix" : "/etc/security-containers/lxc-templates",
+ "lxcTemplatePrefix" : "/etc/vasum/lxc-templates",
"inputConfig" : {"enabled" : false,
"device" : "gpio_keys.6",
"code" : 139,
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
- <policy user="${SECURITY_CONTAINERS_USER}">
+ <policy user="${VASUM_USER}">
<allow own="org.tizen.containers.host"/>
<allow send_destination="org.tizen.containers.host"/>
<allow receive_sender="org.tizen.containers.host"/>
[Unit]
-Description=Security Containers Server
+Description=Vasum Server
ConditionVirtualization=no
[Service]
Type=simple
-ExecStart=${CMAKE_INSTALL_PREFIX}/bin/security-containers-server
+ExecStart=${CMAKE_INSTALL_PREFIX}/bin/vasum-server
Restart=on-failure
ExecReload=/bin/kill -HUP $MAINPID
#include <cassert>
-namespace security_containers {
+namespace vasum {
namespace {
const std::string& lxcTemplatePrefix,
const ContainerConfig& config)
: mConfig(config),
- mDom(containersPath, config.name),
- mId(mDom.getName()),
+ mZone(containersPath, config.name),
+ mId(mZone.getName()),
mDetachOnExit(false),
mDestroyOnExit(false)
{
LOGD(mId << ": Instantiating ContainerAdmin object");
- if (!mDom.isDefined()) {
+ if (!mZone.isDefined()) {
const std::string lxcTemplate = utils::getAbsolutePath(config.lxcTemplate,
lxcTemplatePrefix);
args.add("--ipv4");
args.add(config.ipv4.c_str());
}
- if (!mDom.create(lxcTemplate, args.c_array())) {
+ if (!mZone.create(lxcTemplate, args.c_array())) {
throw ContainerOperationException("Could not create zone");
}
}
LOGD(mId << ": Destroying ContainerAdmin object...");
if (mDestroyOnExit) {
- if (!mDom.stop()) {
+ if (!mZone.stop()) {
LOGE(mId << ": Failed to stop the container");
}
- if (!mDom.destroy()) {
+ if (!mZone.destroy()) {
LOGE(mId << ": Failed to destroy the container");
}
}
if (!mDetachOnExit) {
// Try to forcefully stop
- if (!mDom.stop()) {
+ if (!mZone.stop()) {
LOGE(mId << ": Failed to stop the container");
}
}
args.add("/sbin/init");
}
- if (!mDom.start(args.c_array())) {
+ if (!mZone.start(args.c_array())) {
throw ContainerOperationException("Could not start container");
}
return;
}
- if (!mDom.shutdown(SHUTDOWN_WAIT)) {
+ if (!mZone.shutdown(SHUTDOWN_WAIT)) {
// force stop
- if (!mDom.stop()) {
+ if (!mZone.stop()) {
throw ContainerOperationException("Could not stop container");
}
}
{
LOGD(mId << ": Destroying procedure started...");
- if (!mDom.destroy()) {
+ if (!mZone.destroy()) {
throw ContainerOperationException("Could not destroy container");
}
bool ContainerAdmin::isRunning()
{
- return mDom.getState() == lxc::LxcZone::State::RUNNING;
+ return mZone.getState() == lxc::LxcZone::State::RUNNING;
}
bool ContainerAdmin::isStopped()
{
- return mDom.getState() == lxc::LxcZone::State::STOPPED;
+ return mZone.getState() == lxc::LxcZone::State::STOPPED;
}
void ContainerAdmin::suspend()
{
LOGD(mId << ": Pausing...");
- if (!mDom.freeze()) {
+ if (!mZone.freeze()) {
throw ContainerOperationException("Could not pause container");
}
LOGD(mId << ": Paused");
void ContainerAdmin::resume()
{
LOGD(mId << ": Resuming...");
- if (!mDom.unfreeze()) {
+ if (!mZone.unfreeze()) {
throw ContainerOperationException("Could not resume container");
}
LOGD(mId << ": Resumed");
bool ContainerAdmin::isPaused()
{
- return mDom.getState() == lxc::LxcZone::State::FROZEN;
+ return mZone.getState() == lxc::LxcZone::State::FROZEN;
}
void ContainerAdmin::setSchedulerParams(std::uint64_t, std::uint64_t, std::int64_t)
//void ContainerAdmin::setSchedulerParams(std::uint64_t cpuShares, std::uint64_t vcpuPeriod, std::int64_t vcpuQuota)
{
-// assert(mDom);
+// assert(mZone);
//
// int maxParams = 3;
// int numParamsBuff = 0;
// virTypedParamsAddULLong(¶msTmp, &numParamsBuff, &maxParams, VIR_DOMAIN_SCHEDULER_VCPU_PERIOD, vcpuPeriod);
// virTypedParamsAddLLong(¶msTmp, &numParamsBuff, &maxParams, VIR_DOMAIN_SCHEDULER_VCPU_QUOTA, vcpuQuota);
//
-// if (virDomainSetSchedulerParameters(mDom.get(), params.get(), numParamsBuff) < 0) {
+// if (virDomainSetSchedulerParameters(mZone.get(), params.get(), numParamsBuff) < 0) {
// LOGE(mId << ": Error while setting the container's scheduler params:\n"
// << libvirt::libvirtFormatError());
// throw ContainerOperationException();
std::int64_t ContainerAdmin::getSchedulerQuota()
{
-// assert(mDom);
+// assert(mZone);
//
// int numParamsBuff;
-// std::unique_ptr<char, void(*)(void*)> type(virDomainGetSchedulerType(mDom.get(), &numParamsBuff), free);
+// std::unique_ptr<char, void(*)(void*)> type(virDomainGetSchedulerType(mZone.get(), &numParamsBuff), free);
//
// if (type == NULL || numParamsBuff <= 0 || strcmp(type.get(), "posix") != 0) {
// LOGE(mId << ": Error while getting the container's scheduler type:\n"
//
// std::unique_ptr<virTypedParameter[]> params(new virTypedParameter[numParamsBuff]);
//
-// if (virDomainGetSchedulerParameters(mDom.get(), params.get(), &numParamsBuff) < 0) {
+// if (virDomainGetSchedulerParameters(mZone.get(), params.get(), &numParamsBuff) < 0) {
// LOGE(mId << ": Error while getting the container's scheduler params:\n"
// << libvirt::libvirtFormatError());
// throw ContainerOperationException();
}
-} // namespace security_containers
+} // namespace vasum
#include "lxc/zone.hpp"
-namespace security_containers {
+namespace vasum {
enum class SchedulerLevel {
private:
const ContainerConfig& mConfig;
- lxc::LxcZone mDom;
+ lxc::LxcZone mZone;
const std::string mId;
bool mDetachOnExit;
bool mDestroyOnExit;
};
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_CONTAINER_ADMIN_HPP
#include <vector>
-namespace security_containers {
+namespace vasum {
struct ContainerConfig {
};
-}
-
+} // namespace vasum
#endif // SERVER_CONTAINER_CONFIG_HPP
#include <boost/filesystem.hpp>
#include <boost/system/system_error.hpp>
-namespace security_containers {
+namespace vasum {
namespace {
mDetachOnExit = true;
}
-} // namespace security_containers
+} // namespace vasum
#include "dbus/connection.hpp"
-namespace security_containers {
+namespace vasum {
/**
};
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_CONTAINER_CONNECTION_TRANSPORT_HPP
#include "logger/logger.hpp"
-namespace security_containers {
+namespace vasum {
namespace {
}
-} // namespace security_containers
+} // namespace vasum
#include <condition_variable>
-namespace security_containers {
+namespace vasum {
class ContainerConnection {
};
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_CONTAINER_CONNECTION_HPP
#include "common-dbus-definitions.hpp"
-namespace security_containers {
+namespace vasum {
namespace api {
namespace container {
} // namespace container
} // namespace api
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_CONTAINER_DBUS_DEFINITIONS_HPP
#include <thread>
-namespace security_containers {
+namespace vasum {
namespace fs = boost::filesystem;
connect();
LOGI(getId() << ": Reconnected");
return;
- } catch (SecurityContainersException&) {
+ } catch (VasumException&) {
LOGT(getId() << ": Reconnect try " << i + 1 << " has been unsuccessful");
}
}
declareUnit(mProvisionConfig, std::move(unit));
}
-} // namespace security_containers
+} // namespace vasum
#include <boost/regex.hpp>
-namespace security_containers {
+namespace vasum {
class Container {
};
-}
-
+} // namespace vasum
#endif // SERVER_CONTAINER_HPP
#include <vector>
-namespace security_containers {
+namespace vasum {
-const std::string CONTAINERS_MANAGER_CONFIG_PATH = "/etc/security-containers/config/daemon.conf";
+const std::string CONTAINERS_MANAGER_CONFIG_PATH = "/etc/vasum/config/daemon.conf";
struct ContainersManagerConfig {
};
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_CONTAINERS_MANAGER_CONFIG_HPP
#include <climits>
-namespace security_containers {
+namespace vasum {
namespace {
if (!activeContainer.empty() && caller != activeContainer) {
mContainers[activeContainer]->sendNotification(caller, application, message);
}
- } catch(const SecurityContainersException&) {
+ } catch(const VasumException&) {
LOGE("Notification from " << caller << " hasn't been sent");
}
}
// NOTE: other possible implementations include:
// 1. Sending file descriptors opened directly in each container through DBUS
// using something like g_dbus_message_set_unix_fd_list()
- // 2. SCS forking and calling setns(MNT) in each container and opening files
+ // 2. VSM forking and calling setns(MNT) in each container and opening files
// by itself, then passing FDs to the main process
// Now when the main process has obtained FDs (by either of those methods)
// it can do the copying by itself.
throw ContainerOperationException("Failed to save new config file.");
}
- // restrict new config file so that only owner (security-containers) can write it
+ // restrict new config file so that only owner (vasum) can write it
fs::permissions(resultPath, fs::perms::owner_all |
fs::perms::group_read |
fs::perms::others_read);
LOGI("Generating config from " << configPath << " to " << newConfigPath);
generateNewConfig(id, configPath, newConfigPath);
- } catch (SecurityContainersException& e) {
+ } catch (VasumException& e) {
LOGE("Generate config failed: " << e.what());
utils::launchAsRoot(std::bind(removeAllWrapper, containerPathStr));
result->setError(api::ERROR_INTERNAL, "Failed to generate config");
LOGT("Creating new container");
try {
createContainer(newConfigPath);
- } catch (SecurityContainersException& e) {
+ } catch (VasumException& e) {
LOGE("Creating new container failed: " << e.what());
utils::launchAsRoot(std::bind(removeAllWrapper, containerPathStr));
result->setError(api::ERROR_INTERNAL, "Failed to create container");
auto destroyer = [id, result, this] {
try {
destroyContainer(id);
- } catch (const SecurityContainersException& e) {
+ } catch (const VasumException& e) {
LOGE("Error during container destruction: " << e.what());
result->setError(api::ERROR_INTERNAL, "Failed to destroy container");
return;
result->setVoid();
}
-} // namespace security_containers
+} // namespace vasum
#include <memory>
-namespace security_containers {
+namespace vasum {
class ContainersManager final {
};
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_CONTAINERS_MANAGER_HPP
#include "base-exception.hpp"
-namespace security_containers {
+namespace vasum {
/**
- * Base class for exceptions in Security Containers Server
+ * Base class for exceptions in Vasum Server
*/
-struct ServerException: public SecurityContainersException {
+struct ServerException: public VasumException {
- ServerException(const std::string& error = "") : SecurityContainersException(error) {}
+ ServerException(const std::string& error = "") : VasumException(error) {}
};
/**
#include "logger/logger.hpp"
-namespace security_containers {
+namespace vasum {
namespace {
}
-} // namespace security_containers
+} // namespace vasum
#include <condition_variable>
-namespace security_containers {
+namespace vasum {
class HostConnection {
};
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_HOST_CONNECTION_HPP
#include "common-dbus-definitions.hpp"
-namespace security_containers {
+namespace vasum {
namespace api {
namespace host {
} // namespace host
} // namespace api
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_HOST_DBUS_DEFINITIONS_HPP
#include <string>
-namespace security_containers {
+namespace vasum {
struct InputConfig {
};
-} // namespace security_containers
+} // namespace vasum
#endif /* SERVER_INPUT_MONITOR_CONFIG_HPP */
#include <vector>
#include <functional>
-using namespace security_containers::utils;
+using namespace vasum::utils;
namespace fs = boost::filesystem;
-namespace security_containers {
+namespace vasum {
namespace {
const int MAX_TIME_WINDOW_SEC = 10;
LOGT("Event sequence not detected");
return false;
}
-} // namespace security_containers
+} // namespace vasum
#include <list>
-namespace security_containers {
+namespace vasum {
class InputMonitor {
public:
guint mSourceId;
};
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_INPUT_MONITOR_HPP
/**
* @file
* @author Jan Olszak (j.olszak@samsung.com)
- * @brief Main file for the Security Containers Daemon
+ * @brief Main file for the Vasum Daemon
*/
// Always log to console in DEBUG mode
#include <iostream>
using namespace logger;
-using namespace security_containers;
+using namespace vasum;
namespace po = boost::program_options;
namespace {
const std::string PROGRAM_NAME_AND_VERSION =
- "Security Containers Server " PROGRAM_VERSION;
+ "Vasum Server " PROGRAM_VERSION;
} // namespace
("root,r", "Don't drop root privileges at startup")
("version,v", "show application version")
("log-level,l", po::value<std::string>()->default_value("DEBUG"), "set log level")
- ("config,c", po::value<std::string>()->default_value("/etc/security-containers/daemon.conf"), "server configuration file")
+ ("config,c", po::value<std::string>()->default_value("/etc/vasum/daemon.conf"), "server configuration file")
;
po::variables_map vm;
#include <string>
-namespace security_containers {
+namespace vasum {
/**
* A single allow rule for proxy call dispatching.
};
-} // namespace security_containers
+} // namespace vasum
#endif /* SERVER_PROXY_CALL_CONFIG_HPP */
#include "proxy-call-policy.hpp"
-namespace security_containers {
+namespace vasum {
namespace {
const std::string ANY = "*";
}
-} // namespace security_containers
+} // namespace vasum
#include <vector>
-namespace security_containers {
+namespace vasum {
class ProxyCallPolicy {
};
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_PROXY_CALL_POLICY_HPP
#include <boost/filesystem.hpp>
-#ifndef SECURITY_CONTAINERS_USER
-#error "SECURITY_CONTAINERS_USER must be defined!"
+#ifndef VASUM_USER
+#error "VASUM_USER must be defined!"
#endif
#ifndef INPUT_EVENT_GROUP
extern char** environ;
-namespace security_containers {
+namespace vasum {
Server::Server(const std::string& configPath, bool runAsRoot)
ContainersManagerConfig config;
config::loadFromFile(configPath, config);
- struct passwd* pwd = ::getpwnam(SECURITY_CONTAINERS_USER);
+ struct passwd* pwd = ::getpwnam(VASUM_USER);
if (pwd == NULL) {
- LOGE("getpwnam failed to find user '" << SECURITY_CONTAINERS_USER << "'");
+ LOGE("getpwnam failed to find user '" << VASUM_USER << "'");
return false;
}
uid_t uid = pwd->pw_uid;
gid_t gid = pwd->pw_gid;
- LOGD("security-containers UID = " << uid << ", GID = " << gid);
+ LOGD("vasum UID = " << uid << ", GID = " << gid);
// create directory for dbus socket (if needed)
if (!config.runMountPointPrefix.empty()) {
}
-} // namespace security_containers
+} // namespace vasum
#include <string>
-namespace security_containers {
+namespace vasum {
class Server {
};
-} // namespace security_containers
+} // namespace vasum
#endif // SERVER_SERVER_HPP
## Defines for further package installation ####################################
-SET(TEST_DEST_DIR "${PYTHON_SITELIB}/sc_integration_tests")
+SET(TEST_DEST_DIR "${PYTHON_SITELIB}/vsm_integration_tests")
## Search for .py files available ##############################################
FILE(GLOB py_SCRIPTS *.py)
-FILE(GLOB main_SCRIPT sc_int_tests.py)
+FILE(GLOB main_SCRIPT vsm_int_tests.py)
LIST(REMOVE_ITEM py_SCRIPTS ${main_SCRIPT})
-__all__ = ["sc_test_utils",
+__all__ = ["vsm_test_utils",
]
-'''! Module used to collect list of containers based on the security-containers configuration files.
+'''! Module used to collect list of containers based on the vasum configuration files.
@author: Michal Witanowski (m.witanowski@samsung.com)
'''
import os
import json
import xml.etree.ElementTree as ET
-from sc_integration_tests.common import sc_test_utils
+from vsm_integration_tests.common import vsm_test_utils
from pprint import pprint
class ConfigChecker:
- '''! This class verifies security-containers configuration files and collects dictionary with
+ '''! This class verifies vasum configuration files and collects dictionary with
containers existing in the system (name and rootfs path).
'''
# load main daemon JSON config file
if not os.path.isfile(mainConfigPath):
raise Exception(mainConfigPath + " not found. " +
- "Please verify that security containers is properly installed.")
+ "Please verify that vasum is properly installed.")
with open(mainConfigPath) as daemonConfigStr:
daemonConfigData = json.load(daemonConfigStr)
daemonConfigDir = os.path.dirname(os.path.abspath(mainConfigPath))
containerConfigPath = os.path.join(daemonConfigDir, configPath)
if not os.path.isfile(containerConfigPath):
raise Exception(containerConfigPath + " not found. " +
- "Please verify that security containers is properly installed.")
+ "Please verify that vasum is properly installed.")
with open(containerConfigPath) as containerConfigStr:
containerConfigData = json.load(containerConfigStr)
libvirtConfigPath = os.path.join(daemonConfigDir, "containers",
containerConfigData["config"])
- output, ret = sc_test_utils.launchProc("virt-xml-validate " + libvirtConfigPath)
+ output, ret = vsm_test_utils.launchProc("virt-xml-validate " + libvirtConfigPath)
if ret == 0:
self.__parseLibvirtXML(libvirtConfigPath)
else:
@author: Michal Witanowski (m.witanowski@samsung.com)
'''
import unittest
-from sc_integration_tests.common import sc_test_utils
+from vsm_integration_tests.common import vsm_test_utils
from config_checker import *
import xml.etree.ElementTree as ET
-# security-containers daemon user name and user ID
-SCS_USER_NAME = "security-containers"
-SCS_UID = 377
+# vasum daemon user name and user ID
+VSM_USER_NAME = "security-containers"
+VSM_UID = 377
DAEMON_DBUS_SOCKET_NAME = "org.tizen.containers.zone"
DBUS_CONFIG_PATH = "etc/dbus-1/system.d/" + DAEMON_DBUS_SOCKET_NAME + ".conf"
# main daemon config
-DAEMON_CONFIG_PATH = "/etc/security-containers/daemon.conf"
+DAEMON_CONFIG_PATH = "/etc/vasum/daemon.conf"
class ContainerImageTestCase(unittest.TestCase):
'''
self.configChecker = ConfigChecker(DAEMON_CONFIG_PATH)
- def test01_scsUserExistence(self):
- '''! Verifies if "security-containers" user with an appropriate UID exists within the
+ def test01_vsmUserExistence(self):
+ '''! Verifies if "vasum" user with an appropriate UID exists within the
containers.
'''
for containerName, containerPath in self.configChecker.containers.iteritems():
# chroot into a container and get UID of the user
- output, ret = sc_test_utils.launchProc("chroot " + containerPath +
- " /usr/bin/id -u " + SCS_USER_NAME)
+ output, ret = vsm_test_utils.launchProc("chroot " + containerPath +
+ " /usr/bin/id -u " + VSM_USER_NAME)
- self.assertEqual(ret, 0, "User '" + SCS_USER_NAME + "' does not exist in '" +
+ self.assertEqual(ret, 0, "User '" + VSM_USER_NAME + "' does not exist in '" +
containerName + "' container.")
# cast to integer to remove white spaces, etc.
uid = int(output)
- self.assertEqual(uid, SCS_UID, "Invalid UID of '" + SCS_USER_NAME + "' in '" +
+ self.assertEqual(uid, VSM_UID, "Invalid UID of '" + VSM_USER_NAME + "' in '" +
containerName + "' container: got " + str(uid) +
- ", should be " + str(SCS_UID))
+ ", should be " + str(VSM_UID))
def test02_dbusConfig(self):
'''! Verifies if dbus configuration file exists within containers.
root = tree.getroot()
self.assertEqual(root.tag, "busconfig", "Invalid root node name")
- # validate "security-containers" access to the dbus
+ # validate "vasum" access to the dbus
ownCheck = False
sendDestinationCheck = False
receiveSenderCheck = False
if "user" not in elem.attrib:
continue
- self.assertEqual(elem.attrib["user"], SCS_USER_NAME, "dbus configuration allows '" +
+ self.assertEqual(elem.attrib["user"], VSM_USER_NAME, "dbus configuration allows '" +
elem.attrib["user"] + "' user to access the dbus socket.")
for allowNode in elem.iterfind("allow"):
# @author Jacek Pielaszkiewicz (j.pielaszkie@samsung.com)
#
-from sc_integration_tests.common import sc_test_utils
+from vsm_integration_tests.common import vsm_test_utils
import subprocess
import string
import sys
rc=0
try:
- out=sc_test_utils.launchProc(run_cmd)
+ out=vsm_test_utils.launchProc(run_cmd)
except Exception:
rc=1
@author: Jacek Pielaszkiewicz (j.pielaszkie@samsung.com)
'''
import unittest
-from sc_integration_tests.common import sc_test_utils
+from vsm_integration_tests.common import vsm_test_utils
from network_common import *
class NetworkTestCase(unittest.TestCase):
#!/usr/bin/env python
-'''@package: sc_integration_tests
+'''@package: vsm_integration_tests
@author: Lukasz Kostyra (l.kostyra@samsung.com)
-Security-containers integration tests launcher. Launches all integration tests.
+Vasum integration tests launcher. Launches all integration tests.
'''
import unittest
-from sc_integration_tests.network_tests import *
+from vsm_integration_tests.network_tests import *
-from sc_integration_tests.image_tests import *
+from vsm_integration_tests.image_tests import *
# add tests here...
test_groups = [
+++ /dev/null
-#!/usr/bin/env python
-
-import sc_launch_test
-import sys
-
-# insert other test binaries to this array
-_testCmdTable = ["security-containers-server-unit-tests"]
-
-for test in _testCmdTable:
- sc_launch_test.launchTest([test] + sys.argv[1:])
--- /dev/null
+#!/usr/bin/env python
+
+import vsm_launch_test
+import sys
+
+# insert other test binaries to this array
+_testCmdTable = ["vasum-server-unit-tests"]
+
+for test in _testCmdTable:
+ vsm_launch_test.launchTest([test] + sys.argv[1:])
#!/usr/bin/env python
from xml.dom import minidom
-from sc_test_parser import Logger, Parser
+from vsm_test_parser import Logger, Parser
import subprocess
import argparse
import os
_gdbCmd = ["gdb", "--args"]
def main():
- argparser = argparse.ArgumentParser(description="Test binary launcher for security-containers.")
+ argparser = argparse.ArgumentParser(description="Test binary launcher for vasum.")
group = argparser.add_mutually_exclusive_group()
group.add_argument('--valgrind', action='store_true',
help='Launch test binary inside Valgrind (assuming it is installed).')
if not self.__failedTests:
return
- commandPrefix = "sc_launch_test.py " + bin + " -t "
+ commandPrefix = "vsm_launch_test.py " + bin + " -t "
self.infoTitle("Some tests failed. Use following command(s) to launch them explicitly:")
for test in self.__failedTests:
self.error(self.__indentChar + commandPrefix + test)
self.error('Terminated by ' + siginfo)
if signum in [5, 6, 8, 11]:
self.error("\nUse following command to launch debugger:")
- self.error(self.__indentChar + "sc_launch_test.py --gdb " + bin)
+ self.error(self.__indentChar + "vsm_launch_test.py --gdb " + bin)
class Parser(object):
## Subdirectories ##############################################################
-SET(SC_TEST_CONFIG_INSTALL_DIR ${SC_DATA_INSTALL_DIR}/tests)
-SET(SC_TEST_LXC_TEMPLATES_INSTALL_DIR ${SC_DATA_INSTALL_DIR}/lxc-templates/tests)
-ADD_DEFINITIONS(-DSC_TEST_CONFIG_INSTALL_DIR="${SC_TEST_CONFIG_INSTALL_DIR}")
-ADD_DEFINITIONS(-DSC_TEST_LXC_TEMPLATES_INSTALL_DIR="${SC_TEST_LXC_TEMPLATES_INSTALL_DIR}")
+SET(VSM_TEST_CONFIG_INSTALL_DIR ${VSM_DATA_INSTALL_DIR}/tests)
+SET(VSM_TEST_LXC_TEMPLATES_INSTALL_DIR ${VSM_DATA_INSTALL_DIR}/lxc-templates/tests)
+ADD_DEFINITIONS(-DVSM_TEST_CONFIG_INSTALL_DIR="${VSM_TEST_CONFIG_INSTALL_DIR}")
+ADD_DEFINITIONS(-DVSM_TEST_LXC_TEMPLATES_INSTALL_DIR="${VSM_TEST_LXC_TEMPLATES_INSTALL_DIR}")
ADD_SUBDIRECTORY(dbus/configs)
ADD_SUBDIRECTORY(server/configs)
# @author Mateusz Malicki (m.malicki2@samsung.com)
#
-MESSAGE(STATUS "Installing configs for the Client Unit Tests to " ${SC_TEST_CONFIG_INSTALL_DIR})
+MESSAGE(STATUS "Installing configs for the Client Unit Tests to " ${VSM_TEST_CONFIG_INSTALL_DIR})
## Generate ####################################################################
CONFIGURE_FILE(ut-client/test-dbus-daemon.conf.in
## Install #####################################################################
INSTALL(FILES ${client_manager_CONF_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/client/ut-client)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/client/ut-client)
INSTALL(FILES ${client_container_CONF_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/client/ut-client/containers)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/client/ut-client/containers)
{
"name" : "ut-containers-manager-console1-dbus",
"lxcTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
+ "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
"ipv4Gateway" : "",
"ipv4" : "",
"privilege" : 20,
{
"name" : "ut-containers-manager-console2-dbus",
"lxcTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
+ "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
"ipv4Gateway" : "",
"ipv4" : "",
"privilege" : 20,
{
"name" : "ut-containers-manager-console3-dbus",
"lxcTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
+ "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
"ipv4Gateway" : "",
"ipv4" : "",
"privilege" : 20,
"containerTemplatePath" : "",
"containerNewConfigPrefix" : "",
"runMountPointPrefix" : "",
- "lxcTemplatePrefix" : "@SC_TEST_LXC_TEMPLATES_INSTALL_DIR@",
+ "lxcTemplatePrefix" : "@VSM_TEST_LXC_TEMPLATES_INSTALL_DIR@",
"inputConfig" : {"enabled" : false,
"device" : "/dev/doesnotexist",
"code" : 139,
#include <config.hpp>
#include "ut.hpp"
-#include <security-containers-client.h>
+#include <vasum-client.h>
#include "utils/latch.hpp"
#include "utils/scoped-dir.hpp"
#include <tuple>
#include <utility>
-using namespace security_containers;
-using namespace security_containers::utils;
+using namespace vasum;
+using namespace vasum::utils;
namespace {
const std::string TEST_DBUS_CONFIG_PATH =
- SC_TEST_CONFIG_INSTALL_DIR "/client/ut-client/test-dbus-daemon.conf";
+ VSM_TEST_CONFIG_INSTALL_DIR "/client/ut-client/test-dbus-daemon.conf";
const std::string CONTAINERS_PATH = "/tmp/ut-containers"; // the same as in daemon.conf
struct Loop {
# @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
#
-MESSAGE(STATUS "Installing configs for the DBus Unit Tests to " ${SC_TEST_CONFIG_INSTALL_DIR})
+MESSAGE(STATUS "Installing configs for the DBus Unit Tests to " ${VSM_TEST_CONFIG_INSTALL_DIR})
FILE(GLOB dbus_CONF ut-connection/*.conf)
## Install #####################################################################
INSTALL(FILES ${dbus_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/dbus/ut-connection)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/dbus/ut-connection)
#include "dbus/connection.hpp"
-namespace security_containers {
+namespace vasum {
DbusTestClient::DbusTestClient()
}
-} // namespace security_containers
+} // namespace vasum
#include <memory>
-namespace security_containers {
+namespace vasum {
/**
};
-} // namespace security_containers
+} // namespace vasum
#endif // UNIT_TESTS_DBUS_TEST_CLIENT_HPP
#include <string>
-namespace security_containers {
+namespace vasum {
const std::string DBUS_SOCKET_FILE = "/tmp/container_socket";
"</node>";
-} // namespace security_containers
+} // namespace vasum
#endif // UNIT_TESTS_DBUS_TEST_COMMON_HPP
#include "logger/logger.hpp"
-namespace security_containers {
+namespace vasum {
DbusTestServer::DbusTestServer()
}
-} // namespace security_containers
+} // namespace vasum
#include <condition_variable>
-namespace security_containers {
+namespace vasum {
/**
};
-} // namespace security_containers
+} // namespace vasum
#endif // UNIT_TESTS_DBUS_TEST_SERVER_HPP
BOOST_AUTO_TEST_SUITE(DbusSuite)
-using namespace security_containers;
-using namespace security_containers::utils;
+using namespace vasum;
+using namespace vasum::utils;
using namespace dbus;
namespace {
const char* DBUS_DAEMON_PROC = "/usr/bin/dbus-daemon";
const char* const DBUS_DAEMON_ARGS[] = {
DBUS_DAEMON_PROC,
- "--config-file=" SC_TEST_CONFIG_INSTALL_DIR "/dbus/ut-connection/ut-dbus.conf",
+ "--config-file=" VSM_TEST_CONFIG_INSTALL_DIR "/dbus/ut-connection/ut-dbus.conf",
"--nofork",
NULL
};
#include <chrono>
#include <boost/filesystem.hpp>
-using namespace security_containers;
-using namespace security_containers::ipc;
+using namespace vasum;
+using namespace vasum::ipc;
namespace fs = boost::filesystem;
namespace {
FILE(GLOB LXC_TEMPLATES *.sh)
INSTALL(PROGRAMS ${LXC_TEMPLATES}
- DESTINATION ${SC_TEST_LXC_TEMPLATES_INSTALL_DIR})
+ DESTINATION ${VSM_TEST_LXC_TEMPLATES_INSTALL_DIR})
namespace {
-using namespace security_containers;
-using namespace security_containers::lxc;
+using namespace vasum;
+using namespace vasum::lxc;
const std::string LXC_PATH = "/tmp/ut-lxc/";
const std::string ZONE_NAME = "ut-zone";
-const std::string TEMPLATE = SC_TEST_LXC_TEMPLATES_INSTALL_DIR "/minimal.sh";
+const std::string TEMPLATE = VSM_TEST_LXC_TEMPLATES_INSTALL_DIR "/minimal.sh";
const char* TEMPLATE_ARGS[] = {NULL};
struct Fixture {
# @author Jan Olszak (j.olszak@samsung.com)
#
-MESSAGE(STATUS "Installing configs for the Server Unit Tests to " ${SC_TEST_CONFIG_INSTALL_DIR})
+MESSAGE(STATUS "Installing configs for the Server Unit Tests to " ${VSM_TEST_CONFIG_INSTALL_DIR})
FILE(GLOB server_manager_CONF ut-server/*.conf)
FILE(GLOB server_container_CONF ut-server/containers/*.conf)
## Install #####################################################################
INSTALL(FILES ${server_manager_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-server)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-server)
INSTALL(FILES ${server_manager_CONF_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-server)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-server)
INSTALL(FILES ${server_container_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-server/containers)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-server/containers)
INSTALL(FILES ${manager_manager_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager)
INSTALL(FILES ${manager_manager_CONF_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager)
INSTALL(FILES ${manager_container_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/containers)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/containers)
INSTALL(FILES ${manager_container_CONF_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/containers)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/containers)
INSTALL(FILES ${manager_container_TEMPLATE_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/templates)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/templates)
INSTALL(FILES ${container_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-container)
INSTALL(FILES ${container_container_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container/containers)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-container/containers)
INSTALL(FILES ${container_container_CONF_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container/containers)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-container/containers)
INSTALL(FILES ${admin_container_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container-admin/containers)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-container-admin/containers)
INSTALL(FILES ${connection_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container-connection)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-container-connection)
INSTALL(FILES dbus-1/system.d/org.tizen.containers.tests.conf
DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/)
{
"name" : "ut-container-test-dbus",
"lxcTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-container/ut-dbus.conf --fork; read"],
+ "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-container/ut-dbus.conf --fork; read"],
"ipv4Gateway" : "",
"ipv4" : "",
"privilege" : 10,
"containersPath" : "/tmp/ut-containers",
"containerImagePath" : "",
"containerTemplatePath" : "templates",
- "containerNewConfigPrefix" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
- "lxcTemplatePrefix" : "@SC_TEST_LXC_TEMPLATES_INSTALL_DIR@",
+ "containerNewConfigPrefix" : "@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
+ "lxcTemplatePrefix" : "@VSM_TEST_LXC_TEMPLATES_INSTALL_DIR@",
"inputConfig" : {"enabled" : false,
"device" : "/dev/doesnotexist",
"code" : 139,
"containersPath" : "/tmp/ut-containers",
"containerImagePath" : "",
"containerTemplatePath" : "templates",
- "containerNewConfigPrefix" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
- "lxcTemplatePrefix" : "@SC_TEST_LXC_TEMPLATES_INSTALL_DIR@",
+ "containerNewConfigPrefix" : "@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
+ "lxcTemplatePrefix" : "@VSM_TEST_LXC_TEMPLATES_INSTALL_DIR@",
"inputConfig" : {"enabled" : false,
"device" : "/dev/doesnotexist",
"code" : 139,
"containersPath" : "/tmp/ut-containers",
"containerImagePath" : "",
"containerTemplatePath" : "templates",
- "containerNewConfigPrefix" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
- "lxcTemplatePrefix" : "@SC_TEST_LXC_TEMPLATES_INSTALL_DIR@",
+ "containerNewConfigPrefix" : "@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
+ "lxcTemplatePrefix" : "@VSM_TEST_LXC_TEMPLATES_INSTALL_DIR@",
"inputConfig" : {"enabled" : false,
"device" : "/dev/doesnotexist",
"code" : 139,
{
"name" : "ut-containers-manager-console1-dbus",
"lxcTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
+ "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
"ipv4Gateway" : "",
"ipv4" : "",
"privilege" : 20,
{
"name" : "ut-containers-manager-console2-dbus",
"lxcTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
+ "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
"ipv4Gateway" : "",
"ipv4" : "",
"privilege" : 20,
{
"name" : "ut-containers-manager-console3-dbus",
"lxcTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
+ "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
"ipv4Gateway" : "",
"ipv4" : "",
"privilege" : 20,
"containersPath" : "/tmp/ut-containers",
"containerImagePath" : "",
"containerTemplatePath" : "templates",
- "containerNewConfigPrefix" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
+ "containerNewConfigPrefix" : "@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
"runMountPointPrefix" : "",
- "lxcTemplatePrefix" : "@SC_TEST_LXC_TEMPLATES_INSTALL_DIR@",
+ "lxcTemplatePrefix" : "@VSM_TEST_LXC_TEMPLATES_INSTALL_DIR@",
"inputConfig" : {"enabled" : false,
"device" : "/dev/doesnotexist",
"code" : 139,
{
"name" : "~NAME~",
"lxcTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
+ "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf --fork; read"],
"ipv4Gateway" : "",
"ipv4" : "",
"privilege" : 20,
"containersPath" : "/tmp/ut-containers",
"containerImagePath" : "",
"containerTemplatePath" : "templates",
- "containerNewConfigPrefix" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
- "lxcTemplatePrefix" : "@SC_TEST_LXC_TEMPLATES_INSTALL_DIR@",
+ "containerNewConfigPrefix" : "@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
+ "lxcTemplatePrefix" : "@VSM_TEST_LXC_TEMPLATES_INSTALL_DIR@",
"inputConfig" : {"enabled" : false,
"device" : "/dev/doesnotexist",
"code" : 139,
"containersPath" : "/tmp/ut-containers",
"containerImagePath" : "",
"containerTemplatePath" : "templates",
- "containerNewConfigPrefix" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
+ "containerNewConfigPrefix" : "@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/",
"runMountPointPrefix" : "",
- "lxcTemplatePrefix" : "@SC_TEST_LXC_TEMPLATES_INSTALL_DIR@",
+ "lxcTemplatePrefix" : "@VSM_TEST_LXC_TEMPLATES_INSTALL_DIR@",
"inputConfig" : {"enabled" : false,
"device" : "/dev/doesnotexist",
"code" : 139,
"runMountPointPrefix" : "",
"foregroundId" : "ut-server-container1",
"defaultId" : "ut-server-container1",
- "lxcTemplatePrefix" : "@SC_TEST_LXC_TEMPLATES_INSTALL_DIR@",
+ "lxcTemplatePrefix" : "@VSM_TEST_LXC_TEMPLATES_INSTALL_DIR@",
"inputConfig" : {"enabled" : false,
"device" : "/dev/doesnotexist",
"code" : 139,
"runMountPointPrefix" : "",
"foregroundId" : "ut-server-container1",
"defaultId" : "ut-server-container1",
- "lxcTemplatePrefix" : "@SC_TEST_LXC_TEMPLATES_INSTALL_DIR@",
+ "lxcTemplatePrefix" : "@VSM_TEST_LXC_TEMPLATES_INSTALL_DIR@",
"inputConfig" : {"enabled" : false,
"device" : "gpio-keys.4",
"code" : 139,
#include <string>
-namespace security_containers {
+namespace vasum {
namespace testapi {
} // namespace testapi
-} // namespace security_containers
+} // namespace vasum
#endif // UNIT_TESTS_SERVER_TEST_DBUS_DEFINITIONS_HPP
#include "utils/scoped-dir.hpp"
#include "config/manager.hpp"
-using namespace security_containers;
+using namespace vasum;
namespace {
-const std::string TEST_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-container-admin/containers/test.conf";
-const std::string TEST_NO_SHUTDOWN_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-container-admin/containers/test-no-shutdown.conf";
-const std::string BUGGY_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-container-admin/containers/buggy.conf";
-const std::string MISSING_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-container-admin/containers/missing.conf";
+const std::string TEST_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-container-admin/containers/test.conf";
+const std::string TEST_NO_SHUTDOWN_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-container-admin/containers/test-no-shutdown.conf";
+const std::string BUGGY_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-container-admin/containers/buggy.conf";
+const std::string MISSING_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-container-admin/containers/missing.conf";
const std::string CONTAINERS_PATH = "/tmp/ut-containers";
-const std::string LXC_TEMPLATES_PATH = SC_TEST_LXC_TEMPLATES_INSTALL_DIR;
+const std::string LXC_TEMPLATES_PATH = VSM_TEST_LXC_TEMPLATES_INSTALL_DIR;
struct Fixture {
utils::ScopedGlibLoop mLoop;
BOOST_AUTO_TEST_SUITE(ContainerConnectionSuite)
-using namespace security_containers;
-using namespace security_containers::utils;
+using namespace vasum;
+using namespace vasum::utils;
using namespace dbus;
namespace {
const char* DBUS_DAEMON_PROC = "/usr/bin/dbus-daemon";
const char* const DBUS_DAEMON_ARGS[] = {
DBUS_DAEMON_PROC,
- "--config-file=" SC_TEST_CONFIG_INSTALL_DIR "/server/ut-container-connection/ut-dbus.conf",
+ "--config-file=" VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-container-connection/ut-dbus.conf",
"--nofork",
NULL
};
#include <chrono>
-using namespace security_containers;
+using namespace vasum;
using namespace config;
namespace {
-const std::string TEST_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-container/containers/test.conf";
-const std::string TEST_DBUS_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-container/containers/test-dbus.conf";
-const std::string BUGGY_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-container/containers/buggy.conf";
+const std::string TEST_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-container/containers/test.conf";
+const std::string TEST_DBUS_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-container/containers/test-dbus.conf";
+const std::string BUGGY_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-container/containers/buggy.conf";
const std::string MISSING_CONFIG_PATH = "/this/is/a/missing/file/path/config.conf";
const std::string CONTAINERS_PATH = "/tmp/ut-containers";
-const std::string LXC_TEMPLATES_PATH = SC_TEST_LXC_TEMPLATES_INSTALL_DIR;
+const std::string LXC_TEMPLATES_PATH = VSM_TEST_LXC_TEMPLATES_INSTALL_DIR;
struct Fixture {
utils::ScopedGlibLoop mLoop;
#include <condition_variable>
#include <boost/filesystem.hpp>
-using namespace security_containers;
+using namespace vasum;
using namespace config;
-using namespace security_containers::utils;
+using namespace vasum::utils;
using namespace dbus;
namespace {
-const std::string TEST_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/test-daemon.conf";
-const std::string TEST_DBUS_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/test-dbus-daemon.conf";
-const std::string EMPTY_DBUS_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/empty-dbus-daemon.conf";
-const std::string BUGGY_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/buggy-daemon.conf";
-const std::string BUGGY_FOREGROUND_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/buggy-foreground-daemon.conf";
-const std::string BUGGY_DEFAULTID_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/buggy-default-daemon.conf";
-const std::string TEST_CONTAINER_CONF_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/containers/";
+const std::string TEST_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/test-daemon.conf";
+const std::string TEST_DBUS_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/test-dbus-daemon.conf";
+const std::string EMPTY_DBUS_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/empty-dbus-daemon.conf";
+const std::string BUGGY_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/buggy-daemon.conf";
+const std::string BUGGY_FOREGROUND_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/buggy-foreground-daemon.conf";
+const std::string BUGGY_DEFAULTID_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/buggy-default-daemon.conf";
+const std::string TEST_CONTAINER_CONF_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/containers/";
const std::string MISSING_CONFIG_PATH = "/this/is/a/missing/file/path/missing-daemon.conf";
const int EVENT_TIMEOUT = 5000;
const int TEST_DBUS_CONNECTION_CONTAINERS_COUNT = 3;
}
struct Fixture {
- security_containers::utils::ScopedGlibLoop mLoop;
+ vasum::utils::ScopedGlibLoop mLoop;
utils::ScopedDir mContainersPathGuard;
utils::ScopedDir mRunGuard;
#include <string>
-using namespace security_containers;
-using namespace security_containers::utils;
+using namespace vasum;
+using namespace vasum::utils;
namespace {
const std::string CONTAINERS_PATH = "/tmp/ut-containers"; // the same as in daemon.conf
struct Fixture {
- security_containers::utils::ScopedDir mContainersPathGuard;
+ vasum::utils::ScopedDir mContainersPathGuard;
Fixture()
: mContainersPathGuard(CONTAINERS_PATH)
BOOST_FIXTURE_TEST_SUITE(ServerSuite, Fixture)
-using namespace security_containers;
+using namespace vasum;
using namespace config;
-const std::string TEST_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-server/test-daemon.conf";
-const std::string BUGGY_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-server/buggy-daemon.conf";
+const std::string TEST_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-server/test-daemon.conf";
+const std::string BUGGY_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-server/buggy-daemon.conf";
const std::string MISSING_CONFIG_PATH = "/this/is/a/missing/file/path/missing-daemon.conf";
/**
* @file
* @author Jan Olszak (j.olszak@samsung.com)
- * @brief Main file for the Security Containers Daemon unit tests
+ * @brief Main file for the Vasum Daemon unit tests
*/
#include "config.hpp"
# @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
#
-MESSAGE(STATUS "Installing configs for the Utils Unit Tests to " ${SC_TEST_CONFIG_INSTALL_DIR})
+MESSAGE(STATUS "Installing configs for the Utils Unit Tests to " ${VSM_TEST_CONFIG_INSTALL_DIR})
FILE(GLOB fs_CONF ut-fs/*.txt)
## Install #####################################################################
INSTALL(FILES ${fs_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/utils/ut-fs)
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/utils/ut-fs)
#include <stdexcept>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <sys/types.h>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // UNIT_TESTS_UTILS_SCOPED_DAEMON_HPP
#include <boost/filesystem.hpp>
-namespace security_containers {
+namespace vasum {
namespace utils {
namespace fs = boost::filesystem;
}
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#include <string>
-namespace security_containers {
+namespace vasum {
namespace utils {
} // namespace utils
-} // namespace security_containers
+} // namespace vasum
#endif // UNIT_TESTS_UTILS_SCOPED_DIR_HPP
BOOST_AUTO_TEST_SUITE(CallbackGuardSuite)
-using namespace security_containers::utils;
+using namespace vasum::utils;
const int unsigned TIMEOUT = 1000;
BOOST_AUTO_TEST_SUITE(UtilsFSSuite)
-using namespace security_containers;
-using namespace security_containers::utils;
+using namespace vasum;
+using namespace vasum::utils;
namespace {
-const std::string FILE_PATH = SC_TEST_CONFIG_INSTALL_DIR "/utils/ut-fs/file.txt";
+const std::string FILE_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/utils/ut-fs/file.txt";
const std::string FILE_CONTENT = "File content\n"
"Line 1\n"
"Line 2\n";
BOOST_AUTO_TEST_SUITE(UtilsGlibLoopSuite)
-using namespace security_containers;
-using namespace security_containers::utils;
+using namespace vasum;
+using namespace vasum::utils;
namespace {
BOOST_AUTO_TEST_SUITE(UtilsPathsSuite)
-using namespace security_containers::utils;
+using namespace vasum::utils;
BOOST_AUTO_TEST_CASE(CreateFilePathTest)
{