[Feature] Possibility to handle ipc and dbus requests without recompiling the code.
To build without dbus add --define 'without_dbus ON' to gbs arguments
[Cause] N/A
[Solution] N/A
[Verification] Build with --define 'without_dbus ON' and without it,
run tests for each build, check if server starts
Change-Id: Ibd00485c4b3a6451a1cb7046f3488ff77150b3ea
ADD_DEFINITIONS(-DINPUT_EVENT_GROUP="${INPUT_EVENT_GROUP}")
ADD_DEFINITIONS(-DDISK_GROUP="${DISK_GROUP}")
ADD_DEFINITIONS(-DTTY_GROUP="${TTY_GROUP}")
-#ADD_DEFINITIONS(-DDBUS_CONNECTION)
+IF(NOT WITHOUT_DBUS)
+ ADD_DEFINITIONS(-DDBUS_CONNECTION)
+ENDIF(NOT WITHOUT_DBUS)
## Python packages directory ###################################################
IF(NOT DEFINED PYTHON_SITELIB)
void HostIPCConnection::callGetZoneIds(api::ZoneIds& argOut)
{
api::Void argVoid;
- call(api::METHOD_GET_ZONE_ID_LIST, argVoid, argOut);
+ call(api::ipc::METHOD_GET_ZONE_ID_LIST, argVoid, argOut);
}
void HostIPCConnection::callGetActiveZoneId(api::ZoneId& argOut)
{
api::Void argVoid;
- call(api::METHOD_GET_ACTIVE_ZONE_ID, argVoid, argOut);
+ call(api::ipc::METHOD_GET_ACTIVE_ZONE_ID, argVoid, argOut);
}
void HostIPCConnection::callSetActiveZone(const api::ZoneId& argIn)
{
mClient->callSync<api::ZoneId, api::Void>(
- api::METHOD_SET_ACTIVE_ZONE,
+ api::ipc::METHOD_SET_ACTIVE_ZONE,
std::make_shared<api::ZoneId>(argIn));
}
void HostIPCConnection::callGetZoneInfo(const api::ZoneId& argIn, api::ZoneInfoOut& argOut)
{
argOut = *mClient->callSync<api::ZoneId, api::ZoneInfoOut>(
- api::METHOD_GET_ZONE_INFO,
+ api::ipc::METHOD_GET_ZONE_INFO,
std::make_shared<api::ZoneId>(argIn));
}
void HostIPCConnection::callSetNetdevAttrs(const api::SetNetDevAttrsIn& argIn)
{
mClient->callSync<api::SetNetDevAttrsIn, api::Void>(
- api::METHOD_SET_NETDEV_ATTRS,
+ api::ipc::METHOD_SET_NETDEV_ATTRS,
std::make_shared<api::SetNetDevAttrsIn>(argIn));
api::Void argVoid;
- call(api::METHOD_SET_NETDEV_ATTRS, argIn, argVoid);
+ call(api::ipc::METHOD_SET_NETDEV_ATTRS, argIn, argVoid);
}
void HostIPCConnection::callGetNetdevAttrs(const api::GetNetDevAttrsIn& argIn, api::GetNetDevAttrs& argOut)
{
argOut = *mClient->callSync<api::GetNetDevAttrsIn, api::GetNetDevAttrs>(
- api::METHOD_GET_NETDEV_ATTRS,
+ api::ipc::METHOD_GET_NETDEV_ATTRS,
std::make_shared<api::GetNetDevAttrsIn>(argIn));
}
void HostIPCConnection::callGetNetdevList(const api::ZoneId& argIn, api::NetDevList& argOut)
{
argOut = *mClient->callSync<api::ZoneId, api::NetDevList>(
- api::METHOD_GET_NETDEV_LIST,
+ api::ipc::METHOD_GET_NETDEV_LIST,
std::make_shared<api::ZoneId>(argIn));
}
void HostIPCConnection::callCreateNetdevVeth(const api::CreateNetDevVethIn& argIn)
{
mClient->callSync<api::CreateNetDevVethIn, api::Void>(
- api::METHOD_CREATE_NETDEV_VETH,
+ api::ipc::METHOD_CREATE_NETDEV_VETH,
std::make_shared<api::CreateNetDevVethIn>(argIn));
}
void HostIPCConnection::callCreateNetdevMacvlan(const api::CreateNetDevMacvlanIn& argIn)
{
mClient->callSync<api::CreateNetDevMacvlanIn, api::Void>(
- api::METHOD_CREATE_NETDEV_MACVLAN,
+ api::ipc::METHOD_CREATE_NETDEV_MACVLAN,
std::make_shared<api::CreateNetDevMacvlanIn>(argIn));
}
void HostIPCConnection::callCreateNetdevPhys(const api::CreateNetDevPhysIn& argIn)
{
mClient->callSync<api::CreateNetDevPhysIn, api::Void>(
- api::METHOD_CREATE_NETDEV_PHYS,
+ api::ipc::METHOD_CREATE_NETDEV_PHYS,
std::make_shared<api::CreateNetDevPhysIn>(argIn));
}
void HostIPCConnection::callDestroyNetdev(const api::DestroyNetDevIn& argIn)
{
mClient->callSync<api::DestroyNetDevIn, api::Void>(
- api::METHOD_DESTROY_NETDEV,
+ api::ipc::METHOD_DESTROY_NETDEV,
std::make_shared<api::DestroyNetDevIn>(argIn));
}
void HostIPCConnection::callDeleteNetdevIpAddress(const api::DeleteNetdevIpAddressIn& argIn)
{
mClient->callSync<api::DeleteNetdevIpAddressIn, api::Void>(
- api::METHOD_DELETE_NETDEV_IP_ADDRESS,
+ api::ipc::METHOD_DELETE_NETDEV_IP_ADDRESS,
std::make_shared<api::DeleteNetdevIpAddressIn>(argIn));
}
void HostIPCConnection::callDeclareFile(const api::DeclareFileIn& argIn, api::Declaration& argOut)
{
argOut = *mClient->callSync<api::DeclareFileIn, api::Declaration>(
- api::METHOD_DECLARE_FILE,
+ api::ipc::METHOD_DECLARE_FILE,
std::make_shared<api::DeclareFileIn>(argIn));
}
void HostIPCConnection::callDeclareMount(const api::DeclareMountIn& argIn, api::Declaration& argOut)
{
argOut = *mClient->callSync<api::DeclareMountIn, api::Declaration>(
- api::METHOD_DECLARE_MOUNT,
+ api::ipc::METHOD_DECLARE_MOUNT,
std::make_shared<api::DeclareMountIn>(argIn));
}
void HostIPCConnection::callDeclareLink(const api::DeclareLinkIn& argIn, api::Declaration& argOut)
{
argOut = *mClient->callSync<api::DeclareLinkIn, api::Declaration>(
- api::METHOD_DECLARE_LINK,
+ api::ipc::METHOD_DECLARE_LINK,
std::make_shared<api::DeclareLinkIn>(argIn));
}
void HostIPCConnection::callGetDeclarations(const api::ZoneId& argIn, api::Declarations& argOut)
{
argOut = *mClient->callSync<api::ZoneId, api::Declarations>(
- api::METHOD_GET_DECLARATIONS,
+ api::ipc::METHOD_GET_DECLARATIONS,
std::make_shared<api::ZoneId>(argIn));
}
void HostIPCConnection::callRemoveDeclaration(const api::RemoveDeclarationIn& argIn)
{
mClient->callSync<api::RemoveDeclarationIn, api::Void>(
- api::METHOD_REMOVE_DECLARATION,
+ api::ipc::METHOD_REMOVE_DECLARATION,
std::make_shared<api::RemoveDeclarationIn>(argIn));
}
void HostIPCConnection::callCreateZone(const api::CreateZoneIn& argIn)
{
mClient->callSync<api::CreateZoneIn, api::Void>(
- api::METHOD_CREATE_ZONE,
+ api::ipc::METHOD_CREATE_ZONE,
std::make_shared<api::CreateZoneIn>(argIn));
}
void HostIPCConnection::callDestroyZone(const api::ZoneId& argIn)
{
mClient->callSync<api::ZoneId, api::Void>(
- api::METHOD_DESTROY_ZONE,
+ api::ipc::METHOD_DESTROY_ZONE,
std::make_shared<api::ZoneId>(argIn));
}
void HostIPCConnection::callShutdownZone(const api::ZoneId& argIn)
{
mClient->callSync<api::ZoneId, api::Void>(
- api::METHOD_SHUTDOWN_ZONE,
+ api::ipc::METHOD_SHUTDOWN_ZONE,
std::make_shared<api::ZoneId>(argIn));
}
void HostIPCConnection::callStartZone(const api::ZoneId& argIn)
{
mClient->callSync<api::ZoneId, api::Void>(
- api::METHOD_START_ZONE,
+ api::ipc::METHOD_START_ZONE,
std::make_shared<api::ZoneId>(argIn));
}
void HostIPCConnection::callLockZone(const api::ZoneId& argIn)
{
mClient->callSync<api::ZoneId, api::Void>(
- api::METHOD_LOCK_ZONE,
+ api::ipc::METHOD_LOCK_ZONE,
std::make_shared<api::ZoneId>(argIn));
}
void HostIPCConnection::callUnlockZone(const api::ZoneId& argIn)
{
mClient->callSync<api::ZoneId, api::Void>(
- api::METHOD_UNLOCK_ZONE,
+ api::ipc::METHOD_UNLOCK_ZONE,
std::make_shared<api::ZoneId>(argIn));
}
void HostIPCConnection::callGrantDevice(const api::GrantDeviceIn& argIn)
{
mClient->callSync<api::GrantDeviceIn, api::Void>(
- api::METHOD_GRANT_DEVICE,
+ api::ipc::METHOD_GRANT_DEVICE,
std::make_shared<api::GrantDeviceIn>(argIn));
}
void HostIPCConnection::callRevokeDevice(const api::RevokeDeviceIn& argIn)
{
mClient->callSync<api::RevokeDeviceIn, api::Void>(
- api::METHOD_REVOKE_DEVICE,
+ api::ipc::METHOD_REVOKE_DEVICE,
std::make_shared<api::RevokeDeviceIn>(argIn));
}
void HostIPCConnection::callNotifyActiveZone(const api::NotifActiveZoneIn& argIn)
{
mClient->callSync<api::NotifActiveZoneIn, api::Void>(
- api::METHOD_NOTIFY_ACTIVE_ZONE,
+ api::ipc::METHOD_NOTIFY_ACTIVE_ZONE,
std::make_shared<api::NotifActiveZoneIn>(argIn));
}
api::FileMoveRequestStatus& argOut)
{
argOut = *mClient->callSync<api::FileMoveRequestIn, api::FileMoveRequestStatus>(
- api::METHOD_FILE_MOVE_REQUEST,
+ api::ipc::METHOD_FILE_MOVE_REQUEST,
std::make_shared<api::FileMoveRequestIn>(argIn));
}
void HostIPCConnection::signalSwitchToDefault()
{
- mClient->signal(api::SIGNAL_SWITCH_TO_DEFAULT,
+ mClient->signal(api::ipc::SIGNAL_SWITCH_TO_DEFAULT,
std::make_shared<api::Void>());
}
std::shared_ptr<api::Notification>& data) {
callback(*data);
};
- mClient->setSignalHandler<api::Notification>(api::SIGNAL_NOTIFICATION, callbackWrapper);
- return api::SIGNAL_NOTIFICATION;
+ mClient->setSignalHandler<api::Notification>(api::ipc::SIGNAL_NOTIFICATION, callbackWrapper);
+ return api::ipc::SIGNAL_NOTIFICATION;
}
void HostIPCConnection::unsubscribe(const SubscriptionId& id)
template<typename Data>
class DbusMethodResultBuilder: public MethodResultBuilder {
public:
- DbusMethodResultBuilder(const dbus::MethodResultBuilder::Pointer& methodResultBuilderPtr);
+ DbusMethodResultBuilder(const ::dbus::MethodResultBuilder::Pointer& methodResultBuilderPtr);
~DbusMethodResultBuilder() {}
private:
void setVoid() override;
void setError(const std::string& name, const std::string& message) override;
- dbus::MethodResultBuilder::Pointer mMethodResultBuilderPtr;
+ ::dbus::MethodResultBuilder::Pointer mMethodResultBuilderPtr;
std::function<GVariant*(std::shared_ptr<void>)> mSerialize;
};
template<typename Data>
-DbusMethodResultBuilder<Data>::DbusMethodResultBuilder(const dbus::MethodResultBuilder::Pointer& methodResultBuilderPtr)
+DbusMethodResultBuilder<Data>::DbusMethodResultBuilder(const ::dbus::MethodResultBuilder::Pointer& methodResultBuilderPtr)
: mMethodResultBuilderPtr(methodResultBuilderPtr)
{
mSerialize = [](const std::shared_ptr<void> data)->GVariant* {
-DVASUM_USER=%{vsm_user} \
-DINPUT_EVENT_GROUP=%{input_event_group} \
-DDISK_GROUP=%{disk_group} \
- -DTTY_GROUP=%{tty_group}
+ -DTTY_GROUP=%{tty_group} \
+ -DWITHOUT_DBUS=%{?without_dbus}
make -k %{?jobs:-j%jobs}
%install
mDbusConnection = dbus::DbusConnection::createSystem();
LOGT("Setting DBUS name");
- mDbusConnection->setName(api::BUS_NAME,
+ mDbusConnection->setName(api::dbus::BUS_NAME,
std::bind(&HostDbusConnection::onNameAcquired, this),
std::bind(&HostDbusConnection::onNameLost, this));
if (!waitForName(NAME_ACQUIRED_TIMEOUT)) {
- LOGE("Could not acquire dbus name: " << api::BUS_NAME);
- throw HostConnectionException("Could not acquire dbus name: " + api::BUS_NAME);
+ LOGE("Could not acquire dbus name: " << api::dbus::BUS_NAME);
+ throw HostConnectionException("Could not acquire dbus name: " + api::dbus::BUS_NAME);
}
LOGT("Registering DBUS interface");
using namespace std::placeholders;
- mDbusConnection->registerObject(api::OBJECT_PATH,
- api::DEFINITION,
+ mDbusConnection->registerObject(api::dbus::OBJECT_PATH,
+ api::dbus::DEFINITION,
std::bind(&HostDbusConnection::onMessageCall,
this, _1, _2, _3, _4, _5));
GVariant* parameters,
dbus::MethodResultBuilder::Pointer result)
{
- if (objectPath != api::OBJECT_PATH || interface != api::INTERFACE) {
+ if (objectPath != api::dbus::OBJECT_PATH || interface != api::dbus::INTERFACE) {
return;
}
- if (methodName == api::METHOD_SET_ACTIVE_ZONE) {
+ if (methodName == api::dbus::METHOD_SET_ACTIVE_ZONE) {
api::ZoneId zoneId;
config::loadFromGVariant(parameters, zoneId);
return;
}
- if (methodName == api::METHOD_PROXY_CALL) {
+ if (methodName == api::dbus::METHOD_PROXY_CALL) {
const gchar* target = NULL;
const gchar* targetBusName = NULL;
const gchar* targetObjectPath = NULL;
return;
}
- if (methodName == api::METHOD_GET_ZONE_ID_LIST) {
+ if (methodName == api::dbus::METHOD_GET_ZONE_ID_LIST) {
if (mGetZoneIdsCallback) {
auto rb = std::make_shared<api::DbusMethodResultBuilder<api::ZoneIds>>(result);
mGetZoneIdsCallback(rb);
return;
}
- if (methodName == api::METHOD_GET_ACTIVE_ZONE_ID) {
+ if (methodName == api::dbus::METHOD_GET_ACTIVE_ZONE_ID) {
if (mGetActiveZoneIdCallback) {
auto rb = std::make_shared<api::DbusMethodResultBuilder<api::ZoneId>>(result);
mGetActiveZoneIdCallback(rb);
return;
}
- if (methodName == api::METHOD_GET_ZONE_INFO) {
+ if (methodName == api::dbus::METHOD_GET_ZONE_INFO) {
api::ZoneId zoneId;
config::loadFromGVariant(parameters, zoneId);
return;
}
- if (methodName == api::METHOD_SET_NETDEV_ATTRS) {
+ if (methodName == api::dbus::METHOD_SET_NETDEV_ATTRS) {
api::SetNetDevAttrsIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_GET_NETDEV_ATTRS) {
+ if (methodName == api::dbus::METHOD_GET_NETDEV_ATTRS) {
api::GetNetDevAttrsIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_GET_NETDEV_LIST) {
+ if (methodName == api::dbus::METHOD_GET_NETDEV_LIST) {
api::ZoneId data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_CREATE_NETDEV_VETH) {
+ if (methodName == api::dbus::METHOD_CREATE_NETDEV_VETH) {
api::CreateNetDevVethIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_CREATE_NETDEV_MACVLAN) {
+ if (methodName == api::dbus::METHOD_CREATE_NETDEV_MACVLAN) {
api::CreateNetDevMacvlanIn data;
config::loadFromGVariant(parameters, data);
}
}
- if (methodName == api::METHOD_CREATE_NETDEV_PHYS) {
+ if (methodName == api::dbus::METHOD_CREATE_NETDEV_PHYS) {
api::CreateNetDevPhysIn data;
config::loadFromGVariant(parameters, data);
}
}
- if (methodName == api::METHOD_DESTROY_NETDEV) {
+ if (methodName == api::dbus::METHOD_DESTROY_NETDEV) {
api::DestroyNetDevIn data;
config::loadFromGVariant(parameters, data);
}
}
- if (methodName == api::METHOD_DELETE_NETDEV_IP_ADDRESS) {
+ if (methodName == api::dbus::METHOD_DELETE_NETDEV_IP_ADDRESS) {
api::DeleteNetdevIpAddressIn data;
config::loadFromGVariant(parameters, data);
if (mDeleteNetdevIpAddressCallback) {
}
}
- if (methodName == api::METHOD_DECLARE_FILE) {
+ if (methodName == api::dbus::METHOD_DECLARE_FILE) {
api::DeclareFileIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_DECLARE_MOUNT) {
+ if (methodName == api::dbus::METHOD_DECLARE_MOUNT) {
api::DeclareMountIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_DECLARE_LINK) {
+ if (methodName == api::dbus::METHOD_DECLARE_LINK) {
api::DeclareLinkIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_GET_DECLARATIONS) {
+ if (methodName == api::dbus::METHOD_GET_DECLARATIONS) {
api::ZoneId data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_REMOVE_DECLARATION) {
+ if (methodName == api::dbus::METHOD_REMOVE_DECLARATION) {
api::RemoveDeclarationIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_CREATE_ZONE) {
+ if (methodName == api::dbus::METHOD_CREATE_ZONE) {
api::CreateZoneIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_DESTROY_ZONE) {
+ if (methodName == api::dbus::METHOD_DESTROY_ZONE) {
api::ZoneId data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_SHUTDOWN_ZONE) {
+ if (methodName == api::dbus::METHOD_SHUTDOWN_ZONE) {
api::ZoneId data;
config::loadFromGVariant(parameters, data);
}
}
- if (methodName == api::METHOD_START_ZONE) {
+ if (methodName == api::dbus::METHOD_START_ZONE) {
api::ZoneId data;
config::loadFromGVariant(parameters, data);
}
}
- if (methodName == api::METHOD_LOCK_ZONE) {
+ if (methodName == api::dbus::METHOD_LOCK_ZONE) {
api::ZoneId data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_UNLOCK_ZONE) {
+ if (methodName == api::dbus::METHOD_UNLOCK_ZONE) {
api::ZoneId data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_GRANT_DEVICE) {
+ if (methodName == api::dbus::METHOD_GRANT_DEVICE) {
api::GrantDeviceIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_REVOKE_DEVICE) {
+ if (methodName == api::dbus::METHOD_REVOKE_DEVICE) {
api::RevokeDeviceIn data;
config::loadFromGVariant(parameters, data);
return;
}
- if (methodName == api::METHOD_NOTIFY_ACTIVE_ZONE) {
+ if (methodName == api::dbus::METHOD_NOTIFY_ACTIVE_ZONE) {
api::NotifActiveZoneIn data;
config::loadFromGVariant(parameters, data);
}
}
- if (methodName == api::METHOD_FILE_MOVE_REQUEST) {
+ if (methodName == api::dbus::METHOD_FILE_MOVE_REQUEST) {
api::FileMoveRequestIn data;
config::loadFromGVariant(parameters, data);
const std::string& signalName,
GVariant* /* parameters */)
{
- if (objectPath != api::OBJECT_PATH || interface != api::INTERFACE) {
+ if (objectPath != api::dbus::OBJECT_PATH || interface != api::dbus::INTERFACE) {
return;
}
- if (signalName == api::SIGNAL_SWITCH_TO_DEFAULT) {
+ if (signalName == api::dbus::SIGNAL_SWITCH_TO_DEFAULT) {
if (mSwitchToDefaultCallback) {
mSwitchToDefaultCallback();
}
notify.zone.c_str(),
notify.application.c_str(),
notify.message.c_str());
- mDbusConnection->emitSignal(api::OBJECT_PATH,
- api::INTERFACE,
- api::SIGNAL_NOTIFICATION,
+ mDbusConnection->emitSignal(api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::SIGNAL_NOTIFICATION,
parameters);
}
namespace vasum {
namespace api {
+namespace dbus {
const std::string BUS_NAME = "org.tizen.vasum.host";
const std::string OBJECT_PATH = "/org/tizen/vasum/host";
" </interface>"
"</node>";
+} // namespace dbus
} // namespace api
} // namespace vasum
{
typedef IPCMethodWrapper<api::ZoneIds> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_GET_ZONE_ID_LIST,
+ api::ipc::METHOD_GET_ZONE_ID_LIST,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<api::ZoneId> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_GET_ACTIVE_ZONE_ID,
+ api::ipc::METHOD_GET_ACTIVE_ZONE_ID,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::ZoneId, api::ZoneInfoOut> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_GET_ZONE_INFO,
+ api::ipc::METHOD_GET_ZONE_INFO,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::SetNetDevAttrsIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_SET_NETDEV_ATTRS,
+ api::ipc::METHOD_SET_NETDEV_ATTRS,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::GetNetDevAttrsIn, api::GetNetDevAttrs> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_GET_NETDEV_ATTRS,
+ api::ipc::METHOD_GET_NETDEV_ATTRS,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::ZoneId, api::NetDevList> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_GET_NETDEV_LIST,
+ api::ipc::METHOD_GET_NETDEV_LIST,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::CreateNetDevVethIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_CREATE_NETDEV_VETH,
+ api::ipc::METHOD_CREATE_NETDEV_VETH,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::CreateNetDevMacvlanIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_CREATE_NETDEV_MACVLAN,
+ api::ipc::METHOD_CREATE_NETDEV_MACVLAN,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::CreateNetDevPhysIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_CREATE_NETDEV_PHYS,
+ api::ipc::METHOD_CREATE_NETDEV_PHYS,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::DestroyNetDevIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_DESTROY_NETDEV,
+ api::ipc::METHOD_DESTROY_NETDEV,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::DeleteNetdevIpAddressIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_DELETE_NETDEV_IP_ADDRESS,
+ api::ipc::METHOD_DELETE_NETDEV_IP_ADDRESS,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::DeclareFileIn, api::Declaration> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_DECLARE_FILE,
+ api::ipc::METHOD_DECLARE_FILE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::DeclareMountIn, api::Declaration> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_DECLARE_MOUNT,
+ api::ipc::METHOD_DECLARE_MOUNT,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::DeclareLinkIn, api::Declaration> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_DECLARE_LINK,
+ api::ipc::METHOD_DECLARE_LINK,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::ZoneId, api::Declarations> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_GET_DECLARATIONS,
+ api::ipc::METHOD_GET_DECLARATIONS,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::RemoveDeclarationIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_REMOVE_DECLARATION,
+ api::ipc::METHOD_REMOVE_DECLARATION,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::ZoneId> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_SET_ACTIVE_ZONE,
+ api::ipc::METHOD_SET_ACTIVE_ZONE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::CreateZoneIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_CREATE_ZONE,
+ api::ipc::METHOD_CREATE_ZONE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::ZoneId> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_DESTROY_ZONE,
+ api::ipc::METHOD_DESTROY_ZONE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::ZoneId> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_SHUTDOWN_ZONE,
+ api::ipc::METHOD_SHUTDOWN_ZONE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::ZoneId> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_START_ZONE,
+ api::ipc::METHOD_START_ZONE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::ZoneId> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_LOCK_ZONE,
+ api::ipc::METHOD_LOCK_ZONE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::ZoneId> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_UNLOCK_ZONE,
+ api::ipc::METHOD_UNLOCK_ZONE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::GrantDeviceIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_GRANT_DEVICE,
+ api::ipc::METHOD_GRANT_DEVICE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::RevokeDeviceIn> Callback;
mService->setMethodHandler<Callback::out, Callback::in>(
- api::METHOD_REVOKE_DEVICE,
+ api::ipc::METHOD_REVOKE_DEVICE,
Callback::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::NotifActiveZoneIn> Method;
mService->setMethodHandler<Method::out, Method::in>(
- api::METHOD_NOTIFY_ACTIVE_ZONE,
+ api::ipc::METHOD_NOTIFY_ACTIVE_ZONE,
Method::getWrapper(callback));
}
{
typedef IPCSignalWrapper<const api::Void> Signal;
mService->setSignalHandler<Signal::in>(
- api::SIGNAL_SWITCH_TO_DEFAULT,
+ api::ipc::SIGNAL_SWITCH_TO_DEFAULT,
Signal::getWrapper(callback));
}
{
typedef IPCMethodWrapper<const api::FileMoveRequestIn, api::FileMoveRequestStatus> Method;
mService->setMethodHandler<Method::out, Method::in>(
- api::METHOD_FILE_MOVE_REQUEST,
+ api::ipc::METHOD_FILE_MOVE_REQUEST,
Method::getWrapper(callback));
}
void HostIPCConnection::sendNotification(const api::Notification& notification)
{
- mService->signal(api::SIGNAL_NOTIFICATION,
+ mService->signal(api::ipc::SIGNAL_NOTIFICATION,
std::make_shared<api::Notification>(notification));
}
namespace vasum {
namespace api {
+namespace ipc {
const vasum::ipc::MethodID METHOD_GET_ZONE_ID_LIST = 2;
const vasum::ipc::MethodID METHOD_GET_ACTIVE_ZONE_ID = 3;
const std::string FILE_MOVE_FAILED = "FILE_MOVE_FAILED";
const std::string FILE_MOVE_SUCCEEDED = "FILE_MOVE_SUCCEEDED";
+} // namespace ipc
} // namespace api
} // namespace vasum
#include "config.hpp"
-#ifdef DBUS_CONNECTION
-#include "host-dbus-definitions.hpp"
-#else
-#include "host-ipc-definitions.hpp"
-#endif
#include "common-definitions.hpp"
#include "dynamic-config-scheme.hpp"
#include "zones-manager.hpp"
} // namespace
-ZonesManager::ZonesManager(const std::string& configPath)
- : mWorker(utils::Worker::create())
- , mDetachOnExit(false)
+template<typename Connection>
+void ZonesManager::setHandlers(Connection& connection)
{
- LOGD("Instantiating ZonesManager object...");
+ using namespace std::placeholders;
+ connection.setGetZoneIdsCallback(bind(&ZonesManager::handleGetZoneIdsCall,
+ this, _1));
- config::loadFromJsonFile(configPath, mConfig);
- config::loadFromKVStoreWithJsonFile(mConfig.dbPath,
- configPath,
- mDynamicConfig,
- getVasumDbPrefix());
+ connection.setGetActiveZoneIdCallback(bind(&ZonesManager::handleGetActiveZoneIdCall,
+ this, _1));
+ connection.setGetZoneInfoCallback(bind(&ZonesManager::handleGetZoneInfoCall,
+ this, _1, _2));
- using namespace std::placeholders;
-#ifdef DBUS_CONNECTION
- mProxyCallPolicy.reset(new ProxyCallPolicy(mConfig.proxyCallRules));
- mHostConnection.setProxyCallCallback(bind(&ZonesManager::handleProxyCall,
- this, HOST_ID, _1, _2, _3, _4, _5, _6, _7));
-#endif
+ connection.setSetNetdevAttrsCallback(bind(&ZonesManager::handleSetNetdevAttrsCall,
+ this, _1, _2));
- mHostConnection.setGetZoneIdsCallback(bind(&ZonesManager::handleGetZoneIdsCall,
- this, _1));
+ connection.setGetNetdevAttrsCallback(bind(&ZonesManager::handleGetNetdevAttrsCall,
+ this, _1, _2));
- mHostConnection.setGetActiveZoneIdCallback(bind(&ZonesManager::handleGetActiveZoneIdCall,
- this, _1));
+ connection.setGetNetdevListCallback(bind(&ZonesManager::handleGetNetdevListCall,
+ this, _1, _2));
- mHostConnection.setGetZoneInfoCallback(bind(&ZonesManager::handleGetZoneInfoCall,
+ connection.setCreateNetdevVethCallback(bind(&ZonesManager::handleCreateNetdevVethCall,
this, _1, _2));
- mHostConnection.setSetNetdevAttrsCallback(bind(&ZonesManager::handleSetNetdevAttrsCall,
+ connection.setCreateNetdevMacvlanCallback(bind(&ZonesManager::handleCreateNetdevMacvlanCall,
this, _1, _2));
- mHostConnection.setGetNetdevAttrsCallback(bind(&ZonesManager::handleGetNetdevAttrsCall,
- this, _1, _2));
+ connection.setCreateNetdevPhysCallback(bind(&ZonesManager::handleCreateNetdevPhysCall,
+ this, _1, _2));
- mHostConnection.setGetNetdevListCallback(bind(&ZonesManager::handleGetNetdevListCall,
- this, _1, _2));
+ connection.setDestroyNetdevCallback(bind(&ZonesManager::handleDestroyNetdevCall,
+ this, _1, _2));
- mHostConnection.setCreateNetdevVethCallback(bind(&ZonesManager::handleCreateNetdevVethCall,
+ connection.setDeleteNetdevIpAddressCallback(bind(&ZonesManager::handleDeleteNetdevIpAddressCall,
this, _1, _2));
- mHostConnection.setCreateNetdevMacvlanCallback(bind(&ZonesManager::handleCreateNetdevMacvlanCall,
- this, _1, _2));
+ connection.setDeclareFileCallback(bind(&ZonesManager::handleDeclareFileCall,
+ this, _1, _2));
- mHostConnection.setCreateNetdevPhysCallback(bind(&ZonesManager::handleCreateNetdevPhysCall,
- this, _1, _2));
-
- mHostConnection.setDestroyNetdevCallback(bind(&ZonesManager::handleDestroyNetdevCall,
- this, _1, _2));
+ connection.setDeclareMountCallback(bind(&ZonesManager::handleDeclareMountCall,
+ this, _1, _2));
- mHostConnection.setDeleteNetdevIpAddressCallback(bind(&ZonesManager::handleDeleteNetdevIpAddressCall,
- this, _1, _2));
+ connection.setDeclareLinkCallback(bind(&ZonesManager::handleDeclareLinkCall,
+ this, _1, _2));
- mHostConnection.setDeclareFileCallback(bind(&ZonesManager::handleDeclareFileCall,
- this, _1, _2));
+ connection.setGetDeclarationsCallback(bind(&ZonesManager::handleGetDeclarationsCall,
+ this, _1, _2));
- mHostConnection.setDeclareMountCallback(bind(&ZonesManager::handleDeclareMountCall,
+ connection.setRemoveDeclarationCallback(bind(&ZonesManager::handleRemoveDeclarationCall,
this, _1, _2));
- mHostConnection.setDeclareLinkCallback(bind(&ZonesManager::handleDeclareLinkCall,
- this, _1, _2));
+ connection.setSetActiveZoneCallback(bind(&ZonesManager::handleSetActiveZoneCall,
+ this, _1, _2));
- mHostConnection.setGetDeclarationsCallback(bind(&ZonesManager::handleGetDeclarationsCall,
- this, _1, _2));
+ connection.setCreateZoneCallback(bind(&ZonesManager::handleCreateZoneCall,
+ this, _1, _2));
- mHostConnection.setRemoveDeclarationCallback(bind(&ZonesManager::handleRemoveDeclarationCall,
- this, _1, _2));
+ connection.setDestroyZoneCallback(bind(&ZonesManager::handleDestroyZoneCall,
+ this, _1, _2));
- mHostConnection.setSetActiveZoneCallback(bind(&ZonesManager::handleSetActiveZoneCall,
- this, _1, _2));
+ connection.setShutdownZoneCallback(bind(&ZonesManager::handleShutdownZoneCall,
+ this, _1, _2));
- mHostConnection.setCreateZoneCallback(bind(&ZonesManager::handleCreateZoneCall,
- this, _1, _2));
+ connection.setStartZoneCallback(bind(&ZonesManager::handleStartZoneCall,
+ this, _1, _2));
- mHostConnection.setDestroyZoneCallback(bind(&ZonesManager::handleDestroyZoneCall,
- this, _1, _2));
+ connection.setLockZoneCallback(bind(&ZonesManager::handleLockZoneCall,
+ this, _1, _2));
- mHostConnection.setShutdownZoneCallback(bind(&ZonesManager::handleShutdownZoneCall,
- this, _1, _2));
+ connection.setUnlockZoneCallback(bind(&ZonesManager::handleUnlockZoneCall,
+ this, _1, _2));
- mHostConnection.setStartZoneCallback(bind(&ZonesManager::handleStartZoneCall,
- this, _1, _2));
+ connection.setGrantDeviceCallback(bind(&ZonesManager::handleGrantDeviceCall,
+ this, _1, _2));
- mHostConnection.setLockZoneCallback(bind(&ZonesManager::handleLockZoneCall,
- this, _1, _2));
+ connection.setRevokeDeviceCallback(bind(&ZonesManager::handleRevokeDeviceCall,
+ this, _1, _2));
- mHostConnection.setUnlockZoneCallback(bind(&ZonesManager::handleUnlockZoneCall,
- this, _1, _2));
+ connection.setNotifyActiveZoneCallback(bind(&ZonesManager::handleNotifyActiveZoneCall,
+ this, "", _1, _2));
- mHostConnection.setGrantDeviceCallback(bind(&ZonesManager::handleGrantDeviceCall,
- this, _1, _2));
+ connection.setSwitchToDefaultCallback(bind(&ZonesManager::handleSwitchToDefaultCall,
+ this, ""));
- mHostConnection.setRevokeDeviceCallback(bind(&ZonesManager::handleRevokeDeviceCall,
- this, _1, _2));
+ connection.setFileMoveCallback(bind(&ZonesManager::handleFileMoveCall,
+ this, "", _1, _2));
+}
- mHostConnection.setNotifyActiveZoneCallback(bind(&ZonesManager::handleNotifyActiveZoneCall,
- this, "", _1, _2));
+ZonesManager::ZonesManager(const std::string& configPath)
+ : mWorker(utils::Worker::create())
+ , mDetachOnExit(false)
+{
+ LOGD("Instantiating ZonesManager object...");
- mHostConnection.setSwitchToDefaultCallback(bind(&ZonesManager::handleSwitchToDefaultCall,
- this, ""));
+ config::loadFromJsonFile(configPath, mConfig);
+ config::loadFromKVStoreWithJsonFile(mConfig.dbPath,
+ configPath,
+ mDynamicConfig,
+ getVasumDbPrefix());
- mHostConnection.setFileMoveCallback(bind(&ZonesManager::handleFileMoveCall,
- this, "", _1, _2));
+ setHandlers(mHostIPCConnection);
+#ifdef DBUS_CONNECTION
+ using namespace std::placeholders;
+ mProxyCallPolicy.reset(new ProxyCallPolicy(mConfig.proxyCallRules));
+ mHostDbusConnection.setProxyCallCallback(bind(&ZonesManager::handleProxyCall,
+ this, HOST_ID, _1, _2, _3, _4, _5, _6, _7));
+ setHandlers(mHostDbusConnection);
+#endif //DBUS_CONNECTION
for (const auto& zoneId : mDynamicConfig.zoneIds) {
insertZone(zoneId, getTemplatePathForExistingZone(zoneId));
return;
}
- mHostConnection.proxyCallAsync(targetBusName,
- targetObjectPath,
- targetInterface,
- targetMethod,
- parameters,
- asyncResultCallback);
+ mHostDbusConnection.proxyCallAsync(targetBusName,
+ targetObjectPath,
+ targetInterface,
+ targetMethod,
+ parameters,
+ asyncResultCallback);
}
-#endif
+#endif //DBUS_CONNECTION
void ZonesManager::handleGetZoneIdsCall(api::MethodResultBuilder::Pointer result)
{
#include "zone.hpp"
#include "zones-manager-config.hpp"
-#ifdef DBUS_CONNECTION
-#include "host-dbus-connection.hpp"
-#include "proxy-call-policy.hpp"
-#else
#include "host-ipc-connection.hpp"
-#endif
#include "input-monitor.hpp"
#include "utils/worker.hpp"
#include "api/method-result-builder.hpp"
+#ifdef DBUS_CONNECTION
+#include "host-dbus-connection.hpp"
+#include "proxy-call-policy.hpp"
+#endif //DBUS_CONNECTION
+
#include <string>
#include <memory>
private:
typedef std::recursive_mutex Mutex;
typedef std::unique_lock<Mutex> Lock;
-#ifdef DBUS_CONNECTION
- typedef HostDbusConnection HostConnection;
-#else
- typedef HostIPCConnection HostConnection;
-#endif
utils::Worker::Pointer mWorker;
Mutex mMutex; // used to protect mZones
ZonesManagerConfig mConfig; //TODO make it const
ZonesManagerDynamicConfig mDynamicConfig;
- HostConnection mHostConnection;
+#ifdef DBUS_CONNECTION
+ HostDbusConnection mHostDbusConnection;
+#endif //DBUS_CONNECTION
+ HostIPCConnection mHostIPCConnection;
// to hold InputMonitor pointer to monitor if zone switching sequence is recognized
std::unique_ptr<InputMonitor> mSwitchingSequenceMonitor;
// like set but keep insertion order
const std::string& targetMethod,
GVariant* parameters,
dbus::MethodResultBuilder::Pointer result);
-#endif
+#endif //DBUS_CONNECTION
// Handlers --------------------------------------------------------
void handleGetZoneIdsCall(api::MethodResultBuilder::Pointer result);
void handleGetActiveZoneIdCall(api::MethodResultBuilder::Pointer result);
api::MethodResultBuilder::Pointer result);
void handleRevokeDeviceCall(const api::RevokeDeviceIn& data,
api::MethodResultBuilder::Pointer result);
+
+ template<typename Connection>
+ void setHandlers(Connection& connnection);
};
* @brief Unit tests of the client C API
*/
-#ifndef DBUS_CONNECTION
-
#include <config.hpp>
#include "ut.hpp"
#include <vasum-client.h>
#include "host-ipc-definitions.hpp"
#include "logger/logger.hpp"
+#ifdef DBUS_CONNECTION
+#include "utils/glib-loop.hpp"
+#endif //DBUS_CONNECTION
+
#include <map>
#include <string>
#include <utility>
struct Fixture {
utils::ScopedDir mZonesPathGuard;
utils::ScopedDir mRunGuard;
+#ifdef DBUS_CONNECTION
+ utils::ScopedGlibLoop mLoop;
+#endif //DBUS_CONNECTION
std::unique_ptr<ZonesManager> cm;
BOOST_AUTO_TEST_SUITE_END()
-
-#endif /* !DBUS_CONNECTION */
${CMAKE_BINARY_DIR}/ut-zones-manager/test-daemon.conf @ONLY)
FILE(GLOB manager_manager_CONF_GEN ${CMAKE_BINARY_DIR}/ut-zones-manager/*.conf)
-CONFIGURE_FILE(ut-zones-manager/templates/console-dbus.conf.in
- ${CMAKE_BINARY_DIR}/ut-zones-manager/templates/console-dbus.conf @ONLY)
-CONFIGURE_FILE(ut-zones-manager/templates/console-ipc.conf.in
- ${CMAKE_BINARY_DIR}/ut-zones-manager/templates/console-ipc.conf @ONLY)
FILE(GLOB manager_templates_CONF_GEN ${CMAKE_BINARY_DIR}/ut-zones-manager/templates/*.conf)
+++ /dev/null
-{
- "lxcTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-zones-manager/ut-dbus.conf --fork; read"],
- "requestedState" : "running",
- "ipv4Gateway" : "",
- "ipv4" : "",
- "privilege" : 20,
- "vt" : -1,
- "switchToDefaultAfterTimeout" : true,
- "cpuQuotaForeground" : -1,
- "cpuQuotaBackground" : 1000,
- "shutdownTimeout" : 10,
- "runMountPoint" : "/tmp/ut-run/~NAME~",
- "provisions" : [],
- "permittedToSend" : [ "/tmp/.*" ],
- "permittedToRecv" : [ "/tmp/.*" ],
- "validLinkPrefixes" : []
-}
+++ /dev/null
-{
- "lxcTemplate" : "minimal.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; read"],
- "requestedState" : "running",
- "ipv4Gateway" : "",
- "ipv4" : "",
- "privilege" : 20,
- "vt" : -1,
- "switchToDefaultAfterTimeout" : true,
- "cpuQuotaForeground" : -1,
- "cpuQuotaBackground" : 1000,
- "shutdownTimeout" : 10,
- "runMountPoint" : "/tmp/ut-run/~NAME~",
- "provisions" : [],
- "permittedToSend" : [ "/tmp/.*" ],
- "permittedToRecv" : [ "/tmp/.*" ],
- "validLinkPrefixes" : []
-}
#include "test-dbus-definitions.hpp"
#include "dbus/connection.hpp"
#include "dbus/exception.hpp"
-#else
+#endif //DBUS_CONNECTION
#include "host-ipc-definitions.hpp"
#include <api/messages.hpp>
#include <epoll/thread-dispatcher.hpp>
#include <ipc/client.hpp>
-#endif
#include "exception.hpp"
#include "utils/glib-loop.hpp"
using namespace vasum::utils;
#ifdef DBUS_CONNECTION
using namespace dbus;
-#endif
+#endif //DBUS_CONNECTION
+
namespace {
const std::string NON_EXISTANT_ZONE_ID = "NON_EXISTANT_ZONE_ID";
const std::string ZONES_PATH = "/tmp/ut-zones"; // the same as in daemon.conf
const std::string SIMPLE_TEMPLATE = "console";
-#ifdef DBUS_CONNECTION
-const std::string ZONE_ACCESS_TEMPLATE = "console-dbus";
-#else
-const std::string ZONE_ACCESS_TEMPLATE = "console-ipc";
-#endif
#ifdef DBUS_CONNECTION
/**
};
}
-class DbusAccessory {
+class HostDbusAccessory {
public:
static const int HOST_ID = 0;
)> TestApiMethodCallback;
typedef std::function<void()> VoidResultCallback;
typedef std::function<void(const api::Notification)> NotificationCallback;
-
typedef std::map<std::string, std::string> Connections;
- DbusAccessory()
+ HostDbusAccessory()
: mId(0),
mClient(DbusConnection::create(acquireAddress())),
mNameAcquired(false),
{
}
- DbusAccessory(int id)
+ HostDbusAccessory(int id)
: mId(id),
mClient(DbusConnection::create(acquireAddress())),
mNameAcquired(false),
void setName(const std::string& name)
{
mClient->setName(name,
- std::bind(&DbusAccessory::onNameAcquired, this),
- std::bind(&DbusAccessory::onDisconnect, this));
+ std::bind(&HostDbusAccessory::onNameAcquired, this),
+ std::bind(&HostDbusAccessory::onDisconnect, this));
if(!waitForName()) {
mClient.reset();
void signalSubscribe(const DbusConnection::SignalCallback& callback)
{
- mClient->signalSubscribe(callback, isHost() ? api::BUS_NAME : api::BUS_NAME);
+ mClient->signalSubscribe(callback, isHost() ? api::dbus::BUS_NAME : api::dbus::BUS_NAME);
}
void subscribeNotification(const NotificationCallback& callback)
const std::string& signalName,
GVariant* parameters)
{
- if (objectPath == api::OBJECT_PATH &&
- interface == api::INTERFACE &&
- signalName == api::SIGNAL_NOTIFICATION &&
+ if (objectPath == api::dbus::OBJECT_PATH &&
+ interface == api::dbus::INTERFACE &&
+ signalName == api::dbus::SIGNAL_NOTIFICATION &&
g_variant_is_of_type(parameters, G_VARIANT_TYPE("(sss)"))) {
const gchar* zone = NULL;
callback({zone, application, message});
}
};
- mClient->signalSubscribe(handler, api::BUS_NAME);
+ mClient->signalSubscribe(handler, api::dbus::BUS_NAME);
}
void signalSwitchToDefault()
{
// emit signal from dbus connection
- mClient->emitSignal(api::OBJECT_PATH,
- api::INTERFACE,
- api::SIGNAL_SWITCH_TO_DEFAULT,
+ mClient->emitSignal(api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::SIGNAL_SWITCH_TO_DEFAULT,
nullptr);
}
void callMethodNotify()
{
GVariant* parameters = g_variant_new("(ss)", TEST_APP_NAME.c_str(), TEST_MESSAGE.c_str());
- mClient->callMethod(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_NOTIFY_ACTIVE_ZONE,
+ mClient->callMethod(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_NOTIFY_ACTIVE_ZONE,
parameters,
"()");
}
std::string callMethodMove(const std::string& dest, const std::string& path)
{
GVariant* parameters = g_variant_new("(ss)", dest.c_str(), path.c_str());
- GVariantPtr result = mClient->callMethod(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_FILE_MOVE_REQUEST,
+ GVariantPtr result = mClient->callMethod(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_FILE_MOVE_REQUEST,
parameters,
"(s)");
interface.c_str(),
method.c_str(),
parameters);
- GVariantPtr result = mClient->callMethod(isHost() ? api::BUS_NAME :
- api::BUS_NAME,
- isHost() ? api::OBJECT_PATH :
- api::OBJECT_PATH,
- isHost() ? api::INTERFACE :
- api::INTERFACE,
- api::METHOD_PROXY_CALL,
+ GVariantPtr result = mClient->callMethod(isHost() ? api::dbus::BUS_NAME :
+ api::dbus::BUS_NAME,
+ isHost() ? api::dbus::OBJECT_PATH :
+ api::dbus::OBJECT_PATH,
+ isHost() ? api::dbus::INTERFACE :
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_PROXY_CALL,
packedParameters,
"(v)");
GVariant* unpackedResult = NULL;
std::vector<std::string> callMethodGetZoneIds()
{
assert(isHost());
- GVariantPtr result = mClient->callMethod(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_GET_ZONE_ID_LIST,
+ GVariantPtr result = mClient->callMethod(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_GET_ZONE_ID_LIST,
NULL,
"(as)");
std::string callMethodGetActiveZoneId()
{
assert(isHost());
- GVariantPtr result = mClient->callMethod(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_GET_ACTIVE_ZONE_ID,
+ GVariantPtr result = mClient->callMethod(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_GET_ACTIVE_ZONE_ID,
NULL,
"(s)");
{
assert(isHost());
GVariant* parameters = g_variant_new("(s)", id.c_str());
- GVariantPtr result = mClient->callMethod(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_SET_ACTIVE_ZONE,
+ GVariantPtr result = mClient->callMethod(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_SET_ACTIVE_ZONE,
parameters,
"()");
assert(isHost());
GVariant* parameters = g_variant_new("(ss)", id.c_str(), templateName.c_str());
- mClient->callMethodAsync(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_CREATE_ZONE,
+ mClient->callMethodAsync(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_CREATE_ZONE,
parameters,
"()",
dropException(asyncResult));
assert(isHost());
GVariant* parameters = g_variant_new("(s)", id.c_str());
- mClient->callMethodAsync(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_DESTROY_ZONE,
+ mClient->callMethodAsync(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_DESTROY_ZONE,
parameters,
"()",
dropException(asyncResult));
assert(isHost());
GVariant* parameters = g_variant_new("(s)", id.c_str());
- mClient->callMethodAsync(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_SHUTDOWN_ZONE,
+ mClient->callMethodAsync(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_SHUTDOWN_ZONE,
parameters,
"()",
dropException(asyncResult));
assert(isHost());
GVariant* parameters = g_variant_new("(s)", id.c_str());
- mClient->callMethodAsync(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_START_ZONE,
+ mClient->callMethodAsync(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_START_ZONE,
parameters,
"()",
dropException(asyncResult));
{
assert(isHost());
GVariant* parameters = g_variant_new("(s)", id.c_str());
- GVariantPtr result = mClient->callMethod(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_LOCK_ZONE,
+ GVariantPtr result = mClient->callMethod(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_LOCK_ZONE,
parameters,
"()");
}
{
assert(isHost());
GVariant* parameters = g_variant_new("(s)", id.c_str());
- GVariantPtr result = mClient->callMethod(api::BUS_NAME,
- api::OBJECT_PATH,
- api::INTERFACE,
- api::METHOD_UNLOCK_ZONE,
+ GVariantPtr result = mClient->callMethod(api::dbus::BUS_NAME,
+ api::dbus::OBJECT_PATH,
+ api::dbus::INTERFACE,
+ api::dbus::METHOD_UNLOCK_ZONE,
parameters,
"()");
}
}
};
-typedef DbusAccessory HostAccessory;
-
-#else
-//#ifdef DBUS_CONNECTION
+#endif //DBUS_CONNECTION
class HostIPCAccessory {
public:
std::vector<std::string> callMethodGetZoneIds()
{
- const auto out = mClient.callSync<api::Void, api::ZoneIds>(api::METHOD_GET_ZONE_ID_LIST,
+ const auto out = mClient.callSync<api::Void, api::ZoneIds>(api::ipc::METHOD_GET_ZONE_ID_LIST,
std::make_shared<api::Void>());
return out->values;
}
std::string callMethodGetActiveZoneId()
{
- const auto out = mClient.callSync<api::Void, api::ZoneId>(api::METHOD_GET_ACTIVE_ZONE_ID,
+ const auto out = mClient.callSync<api::Void, api::ZoneId>(api::ipc::METHOD_GET_ACTIVE_ZONE_ID,
std::make_shared<api::Void>());
return out->value;
}
void callMethodSetActiveZone(const std::string& id)
{
- mClient.callSync<api::ZoneId, api::Void>(api::METHOD_SET_ACTIVE_ZONE,
+ mClient.callSync<api::ZoneId, api::Void>(api::ipc::METHOD_SET_ACTIVE_ZONE,
std::make_shared<api::ZoneId>(api::ZoneId{id}));
}
result();
}
};
- mClient.callAsync<api::CreateZoneIn, api::Void>(api::METHOD_CREATE_ZONE,
+ mClient.callAsync<api::CreateZoneIn, api::Void>(api::ipc::METHOD_CREATE_ZONE,
std::make_shared<api::CreateZoneIn>(api::CreateZoneIn{id, templateName}),
asyncResult);
}
result();
}
};
- mClient.callAsync<api::ZoneId, api::Void>(api::METHOD_DESTROY_ZONE,
+ mClient.callAsync<api::ZoneId, api::Void>(api::ipc::METHOD_DESTROY_ZONE,
std::make_shared<api::ZoneId>(api::ZoneId{id}),
asyncResult);
}
result();
}
};
- mClient.callAsync<api::ZoneId, api::Void>(api::METHOD_SHUTDOWN_ZONE,
+ mClient.callAsync<api::ZoneId, api::Void>(api::ipc::METHOD_SHUTDOWN_ZONE,
std::make_shared<api::ZoneId>(api::ZoneId{id}),
asyncResult);
}
result();
}
};
- mClient.callAsync<api::ZoneId, api::Void>(api::METHOD_START_ZONE,
+ mClient.callAsync<api::ZoneId, api::Void>(api::ipc::METHOD_START_ZONE,
std::make_shared<api::ZoneId>(api::ZoneId{id}),
asyncResult);
}
void callMethodLockZone(const std::string& id)
{
- mClient.callSync<api::ZoneId, api::Void>(api::METHOD_LOCK_ZONE,
+ mClient.callSync<api::ZoneId, api::Void>(api::ipc::METHOD_LOCK_ZONE,
std::make_shared<api::ZoneId>(api::ZoneId{id}),
EVENT_TIMEOUT*10); //Prevent from IPCTimeoutException see LockUnlockZone
}
void callMethodUnlockZone(const std::string& id)
{
- mClient.callSync<api::ZoneId, api::Void>(api::METHOD_UNLOCK_ZONE,
+ mClient.callSync<api::ZoneId, api::Void>(api::ipc::METHOD_UNLOCK_ZONE,
std::make_shared<api::ZoneId>(api::ZoneId{id}),
EVENT_TIMEOUT*10); //Prevent from IPCTimeoutException see LockUnlockZone
}
auto callbackWrapper = [callback] (const ipc::PeerID, std::shared_ptr<api::Notification>& data) {
callback(*data);
};
- mClient.setSignalHandler<api::Notification>(api::SIGNAL_NOTIFICATION,
+ mClient.setSignalHandler<api::Notification>(api::ipc::SIGNAL_NOTIFICATION,
callbackWrapper);
}
void signalSwitchToDefault()
{
- mClient.signal<api::Void>(api::SIGNAL_SWITCH_TO_DEFAULT, std::make_shared<api::Void>());
+ mClient.signal<api::Void>(api::ipc::SIGNAL_SWITCH_TO_DEFAULT, std::make_shared<api::Void>());
}
void callMethodNotify()
{
mClient.callSync<api::NotifActiveZoneIn, api::Void>(
- api::METHOD_NOTIFY_ACTIVE_ZONE,
+ api::ipc::METHOD_NOTIFY_ACTIVE_ZONE,
std::make_shared<api::NotifActiveZoneIn>(api::NotifActiveZoneIn{TEST_APP_NAME, TEST_MESSAGE}),
EVENT_TIMEOUT*10); //Prevent from IPCTimeoutException see LockUnlockZone
}
std::string callMethodMove(const std::string& dest, const std::string& path)
{
auto result = mClient.callSync<api::FileMoveRequestIn, api::FileMoveRequestStatus>(
- api::METHOD_FILE_MOVE_REQUEST,
+ api::ipc::METHOD_FILE_MOVE_REQUEST,
std::make_shared<api::FileMoveRequestIn>(api::FileMoveRequestIn{dest, path}),
EVENT_TIMEOUT*10);
return result->value;
ipc::Client mClient;
};
-typedef HostIPCAccessory HostAccessory;
-
-#endif //DBUS_CONNECTION
-
template<class Predicate>
bool spinWaitFor(int timeoutMs, Predicate pred)
{
return true;
}
+} // namespace
+
struct Fixture {
vasum::utils::ScopedGlibLoop mLoop;
{}
};
-} // namespace
+struct IPCFixture : Fixture {
+ typedef HostIPCAccessory HostAccessory;
+};
+
+#ifdef DBUS_CONNECTION
+struct DbusFixture : Fixture {
+ typedef HostDbusAccessory HostAccessory;
+};
+#endif //DBUS_CONNECTION
+
+#ifdef DBUS_CONNECTION
+#define ACCESSORS IPCFixture, DbusFixture
+#else //DBUS_CONNECTION
+#define ACCESSORS IPCFixture
+#endif //DBUS_CONNECTION
BOOST_FIXTURE_TEST_SUITE(ZonesManagerSuite, Fixture)
BOOST_CHECK(cm.getRunningForegroundZoneId() == "zone3");
}
-BOOST_AUTO_TEST_CASE(StartStopWithZoneAccess)
-{
- ZonesManager cm(TEST_CONFIG_PATH);
- cm.createZone("zone1", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone2", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone3", ZONE_ACCESS_TEMPLATE);
- cm.restoreAll();
-}
-
#ifdef ZONE_CONNECTION
BOOST_AUTO_TEST_CASE(NotifyActiveZone)
{
ZonesManager cm(TEST_CONFIG_PATH);
- cm.createZone("zone1", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone2", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone3", ZONE_ACCESS_TEMPLATE);
+ cm.createZone("zone1", SIMPLE_TEMPLATE);
+ cm.createZone("zone2", SIMPLE_TEMPLATE);
+ cm.createZone("zone3", SIMPLE_TEMPLATE);
cm.restoreAll();
Latch signalReceivedLatch;
BOOST_AUTO_TEST_CASE(MoveFile)
{
ZonesManager cm(TEST_CONFIG_PATH);
- cm.createZone("zone1", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone2", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone3", ZONE_ACCESS_TEMPLATE);
+ cm.createZone("zone1", SIMPLE_TEMPLATE);
+ cm.createZone("zone2", SIMPLE_TEMPLATE);
+ cm.createZone("zone3", SIMPLE_TEMPLATE);
cm.restoreAll();
Latch notificationLatch;
}
#endif
-BOOST_AUTO_TEST_CASE(SwitchToDefault)
+MULTI_FIXTURE_TEST_CASE(SwitchToDefault, F, ACCESSORS)
{
ZonesManager cm(TEST_CONFIG_PATH);
- cm.createZone("zone1", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone2", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone3", ZONE_ACCESS_TEMPLATE);
+ cm.createZone("zone1", SIMPLE_TEMPLATE);
+ cm.createZone("zone2", SIMPLE_TEMPLATE);
+ cm.createZone("zone3", SIMPLE_TEMPLATE);
cm.restoreAll();
- HostAccessory host;
+ typename F::HostAccessory host;
auto isDefaultFocused = [&cm]() -> bool {
return cm.getRunningForegroundZoneId() == "zone1";
BOOST_CHECK(spinWaitFor(EVENT_TIMEOUT, isDefaultFocused));
}
-BOOST_AUTO_TEST_CASE(AllowSwitchToDefault)
+MULTI_FIXTURE_TEST_CASE(AllowSwitchToDefault, F, ACCESSORS)
{
ZonesManager cm(TEST_CONFIG_PATH);
- cm.createZone("zone1", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone2", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone3", ZONE_ACCESS_TEMPLATE);
+ cm.createZone("zone1", SIMPLE_TEMPLATE);
+ cm.createZone("zone2", SIMPLE_TEMPLATE);
+ cm.createZone("zone3", SIMPLE_TEMPLATE);
cm.restoreAll();
- HostAccessory host;
+ typename F::HostAccessory host;
auto isDefaultFocused = [&cm]() -> bool {
return cm.getRunningForegroundZoneId() == "zone1";
}
#ifdef DBUS_CONNECTION
-BOOST_AUTO_TEST_CASE(ProxyCall)
+MULTI_FIXTURE_TEST_CASE(ProxyCall, F, DbusFixture)
{
ZonesManager cm(TEST_CONFIG_PATH);
- cm.createZone("zone1", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone2", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone3", ZONE_ACCESS_TEMPLATE);
+ cm.createZone("zone1", SIMPLE_TEMPLATE);
+ cm.createZone("zone2", SIMPLE_TEMPLATE);
+ cm.createZone("zone3", SIMPLE_TEMPLATE);
cm.restoreAll();
- HostAccessory host;
+ typename F::HostAccessory host;
host.setName(testapi::BUS_NAME);
auto handler = [](const std::string& argument, MethodResultBuilder::Pointer result) {
DbusCustomException,
WhatEquals("Proxy call forbidden"));
}
-#endif // DBUS_CONNECTION
+#endif //DBUS_CONNECTION
namespace {
} // namespace
-BOOST_AUTO_TEST_CASE(GetZoneIds)
+MULTI_FIXTURE_TEST_CASE(GetZoneIds, F, ACCESSORS)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", SIMPLE_TEMPLATE);
cm.createZone("zone2", SIMPLE_TEMPLATE);
cm.createZone("zone3", SIMPLE_TEMPLATE);
- HostAccessory host;
+ typename F::HostAccessory host;
std::vector<std::string> zoneIds = {"zone1",
"zone2",
BOOST_CHECK(returnedIds == zoneIds);// order should be preserved
}
-BOOST_AUTO_TEST_CASE(GetActiveZoneId)
+MULTI_FIXTURE_TEST_CASE(GetActiveZoneId, F, ACCESSORS)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", SIMPLE_TEMPLATE);
cm.createZone("zone3", SIMPLE_TEMPLATE);
cm.restoreAll();
- HostAccessory host;
+ typename F::HostAccessory host;
std::vector<std::string> zoneIds = {"zone1",
"zone2",
BOOST_CHECK(host.callMethodGetActiveZoneId() == "");
}
-BOOST_AUTO_TEST_CASE(SetActiveZone)
+MULTI_FIXTURE_TEST_CASE(SetActiveZone, F, ACCESSORS)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", SIMPLE_TEMPLATE);
cm.createZone("zone3", SIMPLE_TEMPLATE);
cm.restoreAll();
- HostAccessory host;
+ typename F::HostAccessory host;
std::vector<std::string> zoneIds = {"zone1",
"zone2",
WhatEquals("Could not activate stopped or paused zone"));
}
-BOOST_AUTO_TEST_CASE(CreateDestroyZone)
+MULTI_FIXTURE_TEST_CASE(CreateDestroyZone, F, ACCESSORS)
{
const std::string zone1 = "test1";
const std::string zone2 = "test2";
callDone.set();
};
- HostAccessory host;
+ typename F::HostAccessory host;
// create zone1
host.callAsyncMethodCreateZone(zone1, SIMPLE_TEMPLATE, resultCallback);
BOOST_CHECK_EQUAL(cm.getRunningForegroundZoneId(), "");
}
-BOOST_AUTO_TEST_CASE(CreateDestroyZonePersistence)
+MULTI_FIXTURE_TEST_CASE(CreateDestroyZonePersistence, F, ACCESSORS)
{
const std::string zone = "test1";
ZonesManager cm(TEST_CONFIG_PATH);
cm.restoreAll();
- HostAccessory host;
+ typename F::HostAccessory host;
return host.callMethodGetZoneIds();
};
// create zone
{
ZonesManager cm(TEST_CONFIG_PATH);
- HostAccessory host;
+ typename F::HostAccessory host;
host.callAsyncMethodCreateZone(zone, SIMPLE_TEMPLATE, resultCallback);
BOOST_REQUIRE(callDone.wait(EVENT_TIMEOUT));
}
// destroy zone
{
ZonesManager cm(TEST_CONFIG_PATH);
- HostAccessory host;
+ typename F::HostAccessory host;
host.callAsyncMethodDestroyZone(zone, resultCallback);
BOOST_REQUIRE(callDone.wait(EVENT_TIMEOUT));
}
BOOST_CHECK(getZoneIds().empty());
}
-BOOST_AUTO_TEST_CASE(ZoneStatePersistence)
+MULTI_FIXTURE_TEST_CASE(ZoneStatePersistence, F, ACCESSORS)
{
const std::string zone1 = "zone1";
const std::string zone2 = "zone2";
// firts run
{
ZonesManager cm(TEST_CONFIG_PATH);
- HostAccessory host;
+ typename F::HostAccessory host;
// zone1 - created
host.callAsyncMethodCreateZone(zone1, SIMPLE_TEMPLATE, resultCallback);
}
}
-BOOST_AUTO_TEST_CASE(StartShutdownZone)
+MULTI_FIXTURE_TEST_CASE(StartShutdownZone, F, ACCESSORS)
{
const std::string zone1 = "zone1";
const std::string zone2 = "zone2";
ZonesManager cm(TEST_CONFIG_PATH);
- cm.createZone(zone1, ZONE_ACCESS_TEMPLATE);
- cm.createZone(zone2, ZONE_ACCESS_TEMPLATE);
+ cm.createZone(zone1, SIMPLE_TEMPLATE);
+ cm.createZone(zone2, SIMPLE_TEMPLATE);
Latch callDone;
auto resultCallback = [&]() {
callDone.set();
};
- HostAccessory host;
+ typename F::HostAccessory host;
// start zone1
host.callAsyncMethodStartZone(zone1, resultCallback);
BOOST_CHECK_EQUAL(cm.getRunningForegroundZoneId(), "");
}
-BOOST_AUTO_TEST_CASE(LockUnlockZone)
+MULTI_FIXTURE_TEST_CASE(LockUnlockZone, F, ACCESSORS)
{
ZonesManager cm(TEST_CONFIG_PATH);
- cm.createZone("zone1", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone2", ZONE_ACCESS_TEMPLATE);
- cm.createZone("zone3", ZONE_ACCESS_TEMPLATE);
+ cm.createZone("zone1", SIMPLE_TEMPLATE);
+ cm.createZone("zone2", SIMPLE_TEMPLATE);
+ cm.createZone("zone3", SIMPLE_TEMPLATE);
cm.restoreAll();
- HostAccessory host;
+ typename F::HostAccessory host;
std::vector<std::string> zoneIds = {"zone1",
"zone2",
//This try catch clause is for prevent from test crashing
//and should be removed after resolve following errors
//TODO: Abort when zone is locked on destroying ZonesManager
- HostAccessory host2; //TODO: After IPCTimeoutException host is useless -- fix it
+ typename F::HostAccessory host2; //TODO: After IPCTimeoutException host is useless -- fix it
try { host2.callMethodUnlockZone(zoneId); } catch (...) {};
throw;
}