Handle reconnecting to the dbus, add glib helper
authorLukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Tue, 6 May 2014 10:42:28 +0000 (12:42 +0200)
committerJan Olszak <j.olszak@samsung.com>
Mon, 19 May 2014 11:47:16 +0000 (13:47 +0200)
commit59e71108eaba98ea9eb7c024c5aa7bcbaf0f0ade
tree50ae0105184874903908dfd7b65ed9e33d7ca0fe
parentaf45e8595ecbca512030e96ef8951c1161cd4cc4
Handle reconnecting to the dbus, add glib helper

[Bug/Feature]   Handle reconnecting to the dbus in case of the
                connection loss. Also add a Glib helper for
                scheduling a timer function to the glib loop.
                Style cosmetics.
[Cause]         In case the DBUS daemon gets restarted we loose
                connection, we need to handle that case.
[Solution]      Detect nameLost event and react appropriately.
[Verification]  Built, installed, run tests.
                The reconnect has been tested by hand as follows:
                1. Run the security-containers-server
                2. Make sure it started properly
                3. Enter the container and restart dbus
                4. See SCS logs, make sure it reconnected
                5. Enter the container stop dbus and dbus.socket
                6. See SCS logs, make sure the container stopped

Change-Id: I1185d8d46e0ace8e96b4d4136fbca20bd603bea9
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
20 files changed:
common/dbus/connection.cpp
common/log/backend-stderr.cpp
common/utils/file-wait.cpp
common/utils/fs.cpp
common/utils/glib-loop.cpp
common/utils/glib-loop.hpp
common/utils/latch.cpp
common/utils/latch.hpp
server/container-connection-transport.cpp
server/container-connection.cpp
server/container.cpp
server/container.hpp
server/containers-manager.cpp
unit_tests/server/configs/CMakeLists.txt
unit_tests/server/configs/ut-container/containers/test-dbus.conf [new file with mode: 0644]
unit_tests/server/configs/ut-container/libvirt-config/test-dbus.xml.in [new file with mode: 0644]
unit_tests/server/configs/ut-container/ut-dbus.conf [new file with mode: 0644]
unit_tests/server/ut-container-connection.cpp
unit_tests/server/ut-container.cpp
unit_tests/utils/ut-glib-loop.cpp [new file with mode: 0644]