From: Piotr Bartosiewicz
Date: Thu, 20 Nov 2014 14:23:08 +0000 (+0100)
Subject: Merge remote-tracking branch 'origin/unstable' into tizen
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F30580%2F1;p=platform%2Fcore%2Fsecurity%2Fvasum.git
Merge remote-tracking branch 'origin/unstable' into tizen
Conflicts:
packaging/security-containers.spec
server/CMakeLists.txt
tests/unit_tests/CMakeLists.txt
tests/unit_tests/client/ut-client.cpp
Change-Id: I9bc4f97213d9112766345411ceac2436a7d15d05
---
500265fc4034012002a5cc6d4317f1a9b026e41e
diff --cc packaging/security-containers.spec
index 4453648,99c0d1d..ee5ee83
--- a/packaging/security-containers.spec
+++ b/packaging/security-containers.spec
@@@ -27,11 -26,9 +26,10 @@@ BuildRequires: pkgconfig(libLogger
BuildRequires: pkgconfig(libSimpleDbus)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(libsystemd-journal)
+BuildRequires: pkgconfig(libsystemd-daemon)
- BuildRequires: pkgconfig(libvirt-glib-1.0)
BuildRequires: pkgconfig(sqlite3)
- Requires: libvirt-daemon >= 1.2.4
Requires(post): libcap-tools
+ Requires: bridge-utils
%description
This package provides a daemon used to manage containers - start, stop and switch
diff --cc server/CMakeLists.txt
index 333171a,3c1d89c..8c7604a
--- a/server/CMakeLists.txt
+++ b/server/CMakeLists.txt
@@@ -29,8 -30,8 +30,8 @@@ ADD_EXECUTABLE(${SERVER_CODENAME} ${pro
## Link libraries ##############################################################
FIND_PACKAGE(Boost COMPONENTS program_options system filesystem regex)
- PKG_CHECK_MODULES(SERVER_DEPS REQUIRED libvirt libvirt-glib-1.0 json gio-2.0 libsystemd-journal
- libcap-ng libLogger libSimpleDbus libConfig libsystemd-daemon)
-PKG_CHECK_MODULES(SERVER_DEPS REQUIRED lxc json gio-2.0 libsystemd-journal
++PKG_CHECK_MODULES(SERVER_DEPS REQUIRED lxc json gio-2.0 libsystemd-journal libsystemd-daemon
+ libcap-ng libLogger libSimpleDbus libConfig)
INCLUDE_DIRECTORIES(${COMMON_FOLDER})
INCLUDE_DIRECTORIES(SYSTEM ${SERVER_DEPS_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
diff --cc server/containers-manager.cpp
index 466a4e6,6f76ee6..62dbc14
--- a/server/containers-manager.cpp
+++ b/server/containers-manager.cpp
@@@ -672,17 -619,9 +665,9 @@@ void ContainersManager::handleAddContai
LOGI("Generating config from " << configPath << " to " << newConfigPath);
generateNewConfig(id, configPath, newConfigPath);
- LOGI("Generating config from " << libvirtConfigPath << " to " << newLibvirtConfigPath);
- generateNewConfig(id, libvirtConfigPath, newLibvirtConfigPath);
-
- LOGI("Generating config from " << libvirtNetworkPath << " to " << newLibvirtNetworkPath);
- generateNewConfig(id, libvirtNetworkPath, newLibvirtNetworkPath);
-
- LOGI("Generating config from " << libvirtNetworkFilterPath << " to " << newLibvirtNetworkFilterPath);
- generateNewConfig(id, libvirtNetworkFilterPath, newLibvirtNetworkFilterPath);
} catch (SecurityContainersException& e) {
LOGE(e.what());
- removeAllWrapper(containerPathStr);
+ utils::launchAsRoot(std::bind(removeAllWrapper, containerPathStr));
result->setError(api::host::ERROR_CONTAINER_CREATE_FAILED, e.what());
return;
}
diff --cc tests/unit_tests/CMakeLists.txt
index caea433,ec795db..7ab9e00
--- a/tests/unit_tests/CMakeLists.txt
+++ b/tests/unit_tests/CMakeLists.txt
@@@ -35,9 -36,8 +36,8 @@@ ADD_EXECUTABLE(${UT_SERVER_CODENAME} ${
## Link libraries ##############################################################
FIND_PACKAGE (Boost COMPONENTS unit_test_framework system filesystem regex)
- PKG_CHECK_MODULES(UT_SERVER_DEPS REQUIRED libvirt libvirt-glib-1.0 json gio-2.0
- libsystemd-journal libcap-ng libLogger libSimpleDbus libConfig
- libsystemd-daemon)
-PKG_CHECK_MODULES(UT_SERVER_DEPS REQUIRED lxc json gio-2.0
++PKG_CHECK_MODULES(UT_SERVER_DEPS REQUIRED lxc json gio-2.0 libsystemd-daemon
+ libsystemd-journal libcap-ng libLogger libSimpleDbus libConfig)
INCLUDE_DIRECTORIES(${COMMON_FOLDER} ${SERVER_FOLDER} ${UNIT_TESTS_FOLDER} ${CLIENT_FOLDER})
INCLUDE_DIRECTORIES(SYSTEM ${UT_SERVER_DEPS_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${UT_SERVER_CODENAME} ${UT_SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES})
diff --cc tests/unit_tests/client/ut-client.cpp
index 3a5e0e6,6e0aab0..d6b3fbb
--- a/tests/unit_tests/client/ut-client.cpp
+++ b/tests/unit_tests/client/ut-client.cpp
@@@ -46,16 -47,11 +47,17 @@@ namespace
const std::string TEST_DBUS_CONFIG_PATH =
SC_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 {
- Loop() { sc_start_glib_loop(); }
- ~Loop() { sc_stop_glib_loop(); }
+ Loop()
+ {
+ vsm_start_glib_loop();
+ }
+ ~Loop()
+ {
+ vsm_stop_glib_loop();
+ }
};
struct Fixture {
@@@ -70,26 -76,19 +82,26 @@@
const int EVENT_TIMEOUT = 5000; ///< ms
const std::map EXPECTED_DBUSES_STARTED = {
- {"ut-containers-manager-console1-dbus",
- "unix:path=/tmp/ut-run1/dbus/system_bus_socket"},
- {"ut-containers-manager-console2-dbus",
- "unix:path=/tmp/ut-run2/dbus/system_bus_socket"},
- {"ut-containers-manager-console3-dbus",
- "unix:path=/tmp/ut-run3/dbus/system_bus_socket"}};
-
-void convertDictToMap(ScArrayString keys,
- ScArrayString values,
+ {
+ "ut-containers-manager-console1-dbus",
- "unix:path=/tmp/ut-containers-manager/console1-dbus/dbus/system_bus_socket"
++ "unix:path=/tmp/ut-run1/dbus/system_bus_socket"
+ },
+ {
+ "ut-containers-manager-console2-dbus",
- "unix:path=/tmp/ut-containers-manager/console2-dbus/dbus/system_bus_socket"
++ "unix:path=/tmp/ut-run2/dbus/system_bus_socket"
+ },
+ {
+ "ut-containers-manager-console3-dbus",
- "unix:path=/tmp/ut-containers-manager/console3-dbus/dbus/system_bus_socket"
++ "unix:path=/tmp/ut-run3/dbus/system_bus_socket"
+ }
+};
+
+void convertDictToMap(VsmArrayString keys,
+ VsmArrayString values,
std::map& ret)
{
- ScArrayString iKeys;
- ScArrayString iValues;
+ VsmArrayString iKeys;
+ VsmArrayString iValues;
for (iKeys = keys, iValues = values; *iKeys && *iValues; iKeys++, iValues++) {
ret.insert(std::make_pair(*iKeys, *iValues));
}