Merge remote-tracking branch 'origin/unstable' into tizen 80/30580/1
authorPiotr Bartosiewicz <p.bartosiewi@partner.samsung.com>
Thu, 20 Nov 2014 14:23:08 +0000 (15:23 +0100)
committerPiotr Bartosiewicz <p.bartosiewi@partner.samsung.com>
Thu, 20 Nov 2014 14:23:08 +0000 (15:23 +0100)
Conflicts:
packaging/security-containers.spec
server/CMakeLists.txt
tests/unit_tests/CMakeLists.txt
tests/unit_tests/client/ut-client.cpp

Change-Id: I9bc4f97213d9112766345411ceac2436a7d15d05

1  2 
packaging/security-containers.spec
server/CMakeLists.txt
server/container.cpp
server/container.hpp
server/containers-manager.cpp
server/containers-manager.hpp
server/server.cpp
tests/unit_tests/CMakeLists.txt
tests/unit_tests/client/ut-client.cpp

@@@ -27,11 -26,9 +26,10 @@@ BuildRequires:  pkgconfig(libLogger
  BuildRequires:  pkgconfig(libSimpleDbus)
  BuildRequires:  pkgconfig(glib-2.0)
  BuildRequires:  pkgconfig(libsystemd-journal)
- BuildRequires:  pkgconfig(libvirt-glib-1.0)
 +BuildRequires:  pkgconfig(libsystemd-daemon)
  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
@@@ -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})
Simple merge
Simple merge
@@@ -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;
      }
Simple merge
Simple merge
@@@ -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})
@@@ -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 {
  
  const int EVENT_TIMEOUT = 5000; ///< ms
  const std::map<std::string, std::string> 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<std::string, std::string>& 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));
      }