Merge lp:~michihenning/unity-scopes-api/config-fixes into lp:unity-scopes-api/devel

Proposed by Michi Henning
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 319
Merged at revision: 323
Proposed branch: lp:~michihenning/unity-scopes-api/config-fixes
Merge into: lp:unity-scopes-api/devel
Diff against target: 3858 lines (+1129/-643)
103 files modified
CMakeLists.txt (+13/-14)
CONFIGFILES (+208/-0)
RELEASE_NOTES.md (+13/-2)
data/CMakeLists.txt (+2/-10)
data/Registry.ini.in (+0/-10)
data/Runtime.ini.in (+0/-5)
data/SSRegistry.ini.in (+0/-7)
data/SSRuntime.ini.in (+0/-5)
data/Zmq.ini.in (+0/-3)
data/libunity-scopes.pc.in (+3/-1)
data/scope-registry.conf.in (+1/-1)
data/smart-scopes-proxy.conf.in (+1/-1)
debian/changelog (+24/-3)
debian/libunity-scopes-doc.install (+1/-1)
debian/libunity-scopes1.install (+3/-4)
debian/libunity-scopes1.symbols (+15/-12)
demo/CMakeLists.txt (+0/-1)
demo/README (+1/-1)
demo/Registry.ini.in (+0/-5)
demo/Runtime.ini.in (+0/-2)
demo/Zmq.ini.in (+0/-3)
demo/click/scope-click/CMakeLists.txt (+1/-1)
demo/stand-alone/CMakeLists.txt (+0/-1)
demo/stand-alone/Runtime.ini.in (+0/-2)
demo/stand-alone/Zmq.ini.in (+0/-3)
doc/Doxyfile-devel.in (+1/-1)
doc/Doxyfile.in (+1/-1)
doc/index.html (+3/-3)
include/CMakeLists.txt (+4/-4)
include/unity/scopes/Runtime.h (+9/-0)
include/unity/scopes/internal/ConfigBase.h (+13/-3)
include/unity/scopes/internal/DfltConfig.h.in (+17/-3)
include/unity/scopes/internal/MiddlewareBase.h (+3/-1)
include/unity/scopes/internal/RegistryConfig.h (+0/-10)
include/unity/scopes/internal/RegistryObject.h (+3/-2)
include/unity/scopes/internal/RuntimeConfig.h (+4/-2)
include/unity/scopes/internal/RuntimeImpl.h (+6/-7)
include/unity/scopes/internal/ScopeConfig.h (+2/-4)
include/unity/scopes/internal/smartscopes/SSConfig.h (+62/-0)
include/unity/scopes/internal/smartscopes/SSRegistryObject.h (+6/-2)
include/unity/scopes/internal/zmq_middleware/ZmqConfig.h (+0/-2)
include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h (+6/-2)
scoperegistry/CMakeLists.txt (+1/-1)
scoperegistry/scoperegistry.cpp (+6/-24)
scoperunner/CMakeLists.txt (+1/-1)
smartscopesproxy/CMakeLists.txt (+1/-1)
smartscopesproxy/smartscopesproxy.cpp (+9/-9)
src/scopes/Runtime.cpp (+6/-1)
src/scopes/internal/ConfigBase.cpp (+89/-7)
src/scopes/internal/MiddlewareFactory.cpp (+1/-1)
src/scopes/internal/RegistryConfig.cpp (+33/-33)
src/scopes/internal/RegistryObject.cpp (+59/-27)
src/scopes/internal/RuntimeConfig.cpp (+45/-20)
src/scopes/internal/RuntimeImpl.cpp (+30/-41)
src/scopes/internal/ScopeConfig.cpp (+57/-35)
src/scopes/internal/smartscopes/CMakeLists.txt (+1/-0)
src/scopes/internal/smartscopes/SSConfig.cpp (+129/-0)
src/scopes/internal/smartscopes/SSRegistryObject.cpp (+7/-8)
src/scopes/internal/zmq_middleware/ZmqConfig.cpp (+36/-15)
src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp (+64/-66)
src/scopes/internal/zmq_middleware/ZmqObject.cpp (+6/-33)
test/gtest/scopes/Activation/Activation_test.cpp (+1/-1)
test/gtest/scopes/Activation/Registry.ini.in (+0/-2)
test/gtest/scopes/Activation/Zmq.ini.in (+1/-2)
test/gtest/scopes/Filters/Filters_test.cpp (+1/-1)
test/gtest/scopes/Filters/Registry.ini.in (+0/-2)
test/gtest/scopes/Filters/Zmq.ini.in (+1/-2)
test/gtest/scopes/Invocation/Invocation_test.cpp (+3/-3)
test/gtest/scopes/Invocation/Registry.ini.in (+0/-2)
test/gtest/scopes/Invocation/Zmq.ini.in (+1/-2)
test/gtest/scopes/Registry/RegistryTest.ini.in (+0/-2)
test/gtest/scopes/Registry/Registry_test.cpp (+3/-0)
test/gtest/scopes/Registry/Runtime.ini.in (+1/-0)
test/gtest/scopes/Registry/Zmq.ini.in (+1/-2)
test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp (+1/-1)
test/gtest/scopes/Runtime/Registry.ini.in (+0/-2)
test/gtest/scopes/Runtime/Runtime_test.cpp (+9/-9)
test/gtest/scopes/Runtime/Zmq.ini.in (+1/-2)
test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp (+31/-15)
test/gtest/scopes/internal/RegistryConfig/Registry.ini.in (+0/-2)
test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp (+0/-1)
test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in (+0/-1)
test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in (+0/-2)
test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in (+1/-2)
test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp (+0/-29)
test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in (+1/-3)
test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in (+1/-2)
test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp (+4/-4)
test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in (+1/-2)
test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in (+0/-5)
test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in (+1/-2)
test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp (+4/-2)
test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp (+33/-32)
test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in (+1/-2)
test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp (+3/-8)
test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in (+0/-5)
test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in (+1/-2)
test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp (+6/-6)
test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in (+1/-2)
test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in (+1/-2)
test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp (+6/-8)
test/whitespace/check_whitespace.py (+1/-1)
unity-scopes.map (+1/-0)
To merge this branch: bzr merge lp:~michihenning/unity-scopes-api/config-fixes
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Marcus Tomlinson (community) Approve
Michal Hruby (community) Approve
Review via email: mp+217878@code.launchpad.net

Commit message

Phase 1 of the config clean-up.

Summary of changes:

- The Zmq sockets now live in /run/user/<uid>/zmq

- The config files now provide sensible defaults. It's possible to run without any config whatsoever, in which case default values are used for everything.

- scoperegistry, scoperunner, and smartscopesproxy are now installed in /usr/lib/<arch> (instead of a subdir of /usr/lib/arch).

- Many minor clean-ups in the code for better naming, readability, typos, etc.

- Added documentation in CONFIGFILES for the various config parameters. Next step will be to integrate this into the doxygen doc and get rid of this file.

- Added a check to see whether unknown config parameters are present in a config file. That avoids problems due to silly typos, when someone mis-spells a config parameter name and then wonders why it doesn't have any effect.

- Lots of clean-up in the messages produced by the demo scopes, for consistency.

Description of the change

Phase 1 of the config clean-up.

Summary of changes:

- The Zmq sockets now live in /run/user/<uid>/zmq

- The config files now provide sensible defaults. It's possible to run without any config whatsoever, in which case default values are used for everything.

- scoperegistry, scoperunner, and smartscopesproxy are now installed in /usr/lib/<arch> (instead of a subdir of /usr/lib/arch).

- Many minor clean-ups in the code for better naming, readability, typos, etc.

- Added documentation in CONFIGFILES for the various config parameters. Next step will be to integrate this into the doxygen doc and get rid of this file.

- Added a check to see whether unknown config parameters are present in a config file. That avoids problems due to silly typos, when someone mis-spells a config parameter name and then wonders why it doesn't have any effect.

- Lots of clean-up in the messages produced by the demo scopes, for consistency.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote :

Test are failing under CI because XDG_RUNTIME_DIR is not set. The code falls back to /run/user/<euid>, but /run/user doesn't exist, so the Zmq sockets can't be created.

Not sure why there is no /run/user when building under CI. I was under the impression that it should aways be there? It certainly exists on the phone and the desktop without me having to do anything special.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

- scoperegistry, scoperunner, and smartscopesproxy are now installed in /usr/lib/<arch> (instead of a subdir of /usr/lib/arch).

Why this change? There is loads of stuff in the /usr/lib/arch/, we should keep some namespacing - at least a ../arch/unity-scopes/ dir.

77 + The default value is "$XDG_RUNTIME_DIR/<effective UID>/zmq". If XDG_RUNTIME_DIR is not
78 + set, "/run/user/<effective UID>/zmq" is used.

The fallback note seems out-of-date, plus $XDG_RUNTIME_DIR already includes UID.

80 +- EndpointDir.Private (string)

Can you remind you why do we even have this? Scopes will only have access to their own endpoint directory and aggregating scopes (+registry, +dash) need to access them all, so isn't this option obsolete?

111 + The default value is "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/scoperunner".
116 + The default value is "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/scopes".

Arch-specific binaries can't go into /usr/share/ (and SCOPES_DEFAULT_CONFIGDIR == /usr/share/unity-scopes-api). Moreover the default config files still point to @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperunner/scoperunner and @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/unity-scopes.

121 + by OEMs. The default value is "@CMAKE_INSTALL_PREFIX@/custom/@LIB_INSTALL_PREFIX@/scopes".

Shouldn't this be without the CMAKE_INSTALL_PREFIX prefix? :)

126 + The defaul value is "$HOME/.local/sahre/unity-scopes".

Typos - "defaul", "sahre".

I also noticed Registry.ini's endpoint option disappeared, is it now just Zmq.ini's EndpointDir.Public + "Registry"?

422 - void run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file);
423 + void run_scope(ScopeBase *const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file);

:/ Break in public API. How about overload instead?

477 +static constexpr char const* DFLT_SCOPERUNNER_PATH = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/scoperunner";
478..484

Please keep in sync with the default config files.

review: Needs Fixing
Revision history for this message
Michi Henning (michihenning) wrote :

Thanks heaps for the thorough review!

> - scoperegistry, scoperunner, and smartscopesproxy are now installed in
> /usr/lib/<arch> (instead of a subdir of /usr/lib/arch).
>
> Why this change? There is loads of stuff in the /usr/lib/arch/, we should keep
> some namespacing - at least a ../arch/unity-scopes/ dir.

I agree. It's /usr/lib/<arch>/unity-scopes now.

> 77 + The default value is "$XDG_RUNTIME_DIR/<effective UID>/zmq". If
> XDG_RUNTIME_DIR is not
> 78 + set, "/run/user/<effective UID>/zmq" is used.
>
> The fallback note seems out-of-date, plus $XDG_RUNTIME_DIR already includes
> UID.

Fixed, thanks!

> 80 +- EndpointDir.Private (string)
>
> Can you remind you why do we even have this? Scopes will only have access to
> their own endpoint directory and aggregating scopes (+registry, +dash) need to
> access them all, so isn't this option obsolete?

That's a hangover from the days where I wasn't sure how we would secure access to the endpoints. I agree, we can hardwire the priv subdir.

Basically, public endpoints go into $XDG_RUNTIME_DIR/zmq, and private ones into $XDG_RUNTIME_DIR/zmq/priv.

Fixed.

> 111 + The default value is
> "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/scoperunner".
> 116 + The default value is
> "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/scopes".

That's a doc bug, thanks for that! The actual install location is under /usr/lib/<arch>

> Arch-specific binaries can't go into /usr/share/ (and SCOPES_DEFAULT_CONFIGDIR
> == /usr/share/unity-scopes-api). Moreover the default config files still point
> to @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperunner/scoperunner and
> @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/unity-scopes.
>
> 121 + by OEMs. The default value is
> "@CMAKE_INSTALL_PREFIX@/custom/@LIB_INSTALL_PREFIX@/scopes".
>
> Shouldn't this be without the CMAKE_INSTALL_PREFIX prefix? :)
>
> 126 + The defaul value is "$HOME/.local/sahre/unity-scopes".
>
> Typos - "defaul", "sahre".

Fixed.

> I also noticed Registry.ini's endpoint option disappeared, is it now just
> Zmq.ini's EndpointDir.Public + "Registry"?

Yes. There is no point in having a separate config item for this.

> 422 - void run_scope(ScopeBase *const scope_base, std::string const&
> scope_ini_file);
> 423 + void run_scope(ScopeBase *const scope_base, std::string const&
> runtime_ini_file, std::string const& scope_ini_file);
>
> :/ Break in public API. How about overload instead?

Yes, that's better! Fixed, thanks!

> 477 +static constexpr char const* DFLT_SCOPERUNNER_PATH =
> "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/scoperunner";
> 478..484
>
> Please keep in sync with the default config files.

Yes! :-)

There is no need to install any config files now. Everything defaults to something sensible, so I've removed the installation of the config files.

I also removed an inconsistency: we used unity-scopes as a subdir for /usr/lib/<arch>, but unity-scopes-api as a subddir for /usr/share. They are both unity-scopes subdirs now.

Revision history for this message
Michal Hruby (mhr3) wrote :

> I also removed an inconsistency: we used unity-scopes as a subdir for
> /usr/lib/<arch>, but unity-scopes-api as a subddir for /usr/share. They are
> both unity-scopes subdirs now.

The unity-scopes directory was used as a scopes install directory though, does that mean it's now both scopes install dir AND location for our internal binaries (registries, runner)? I don't think that's a good idea.

Revision history for this message
Michi Henning (michihenning) wrote :

No, all it means is that we now have /usr/share/doc/unity-scopes (instead of /usr/share/doc/unity-scopes-api). And we have /usr/lib/<arch>/unity-scopes, which is consistent with the /usr/share naming.

The scopes are installed in /usr/lib/<arch>/unity-scopes/scopes, so there is a subdirectory for them.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

> No, all it means is that we now have /usr/share/doc/unity-scopes (instead of
> /usr/share/doc/unity-scopes-api). And we have /usr/lib/<arch>/unity-scopes,
> which is consistent with the /usr/share naming.
>
> The scopes are installed in /usr/lib/<arch>/unity-scopes/scopes, so there is a
> subdirectory for them.

In that case I have to NACK that, all the scopes are already installing in /usr/lib/<arch>/unity-scopes/, and we do not want to go over each and every one of them (again!) and change their install location. (same for scopes in /custom).

Otherwise the rest is looking good to me.

review: Needs Fixing
Revision history for this message
Michi Henning (michihenning) wrote :

> In that case I have to NACK that, all the scopes are already installing in
> /usr/lib/<arch>/unity-scopes/, and we do not want to go over each and every
> one of them (again!) and change their install location. (same for scopes in
> /custom).

Yes, fair enough, I've changed that.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Together with the few changes made to RegistryObject, I'm happy to approve.

review: Approve
Revision history for this message
Michal Hruby (mhr3) wrote :

Alright, gave this a spin on an actual device, first of all, please merge lp:~mhr3/unity-scopes-api/fix-paths so upstart is actually able to run the registries. Next, smart-scopes-proxy doesn't start and is complaining that it can't find its SSRuntime.ini.

It's also odd that we still have the DFLT_RUNTIME_INI, DFLT_REGISTRY_INI etc consts even though they don't point to real files.

Last thing is that we're putting the binaries in .../unity-scopes - imo that dir should be reserved only for scopes. Although it will only ever contain scopes that are controlled by us (and packaged as .debs), so not a big deal.

Revision history for this message
Michal Hruby (mhr3) :
review: Needs Fixing
Revision history for this message
Michi Henning (michihenning) wrote :

> Alright, gave this a spin on an actual device, first of all, please merge
> lp:~mhr3/unity-scopes-api/fix-paths so upstart is actually able to run the
> registries

Thanks for that! One change:

- boost::filesystem::path path(configfile);
- if (path.extension() != ".ini")
+ if (configfile.find(".ini") == string::npos)

This isn't the same. The new version tests whether configfile *contains* ".ini", not whether it *ends with* ".ini". I've reverted this for the moment because avoiding boost here and doing a suffix test with std::string only is rather messy. (C++ has pretty much the most dysfunctional and unusable string class I've ever come acros...)

> . Next, smart-scopes-proxy doesn't start and is complaining that it
> can't find its SSRuntime.ini.

My apologies for missing that! I was going to do that as part of stage 2, but it looks like that's not possible, so I've added proper config for smartscopesproxy.

> It's also odd that we still have the DFLT_RUNTIME_INI, DFLT_REGISTRY_INI etc
> consts even though they don't point to real files.

The semantics are:

- if an explicit path is provided, use it.

- if no explicit path is provided, try the DFLT path.

  - If that default path exists, use it, otherwise use the hard-wired default values for attributes

That way, we can run without any config files, but can still drop a config file in place if we want to change something.

> Last thing is that we're putting the binaries in .../unity-scopes - imo that
> dir should be reserved only for scopes. Although it will only ever contain
> scopes that are controlled by us (and packaged as .debs), so not a big deal.

Well, I hear you :-) I wasn't happy about the weird path we had: /usr/lib/<arch>/scoperunner/scoperunner.

I don't think it matters that the three binaries are in the same directory as the scopes. We could make a bin subdirectory or some such, though. Would that improve things? (I'm open to either approach.)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Ok, I will re-review the latest changes. (Setting to "Needs Fixing" to remove the "Approve")

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

1447 +// For example, if a config file contains "Smartscopes.Registry.Idenity" instead
1448 +// of "SS.Registry.Identity" (did you spot it?), we print a warning,

This should read: '"Smartscopes.Registry.Idenity" instead of "Smartscopes.Registry.Identity"'

1298 - RuntimeImpl::UPtr reg_rt = RuntimeImpl::create(ss_reg_id, DFLT_SS_RUNTIME_INI);
1299 + RuntimeImpl::UPtr reg_rt = RuntimeImpl::create(ss_reg_id, config_file);

This change breaks the smart scopes proxy. As reg_rt->registry_identity() now returns the identity of the main registry and not the SS registry.

To fix this, smartscopesproxy.cpp line 143: needs to change
from: "reg_mw->add_registry_object(reg_rt->registry_identity(), reg);"
to: "reg_mw->add_registry_object(reg_rt->ss_registry_identity(), reg);"

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote :

> This should read: '"Smartscopes.Registry.Idenity" instead of
> "Smartscopes.Registry.Identity"'
>
> [...]
>
> To fix this, smartscopesproxy.cpp line 143: needs to change
> from: "reg_mw->add_registry_object(reg_rt->registry_identity(), reg);"
> to: "reg_mw->add_registry_object(reg_rt->ss_registry_identity(), reg);"

Thanks heaps for that! I just pushed those changes.

Revision history for this message
Michal Hruby (mhr3) wrote :

> > Last thing is that we're putting the binaries in .../unity-scopes - imo that
> > dir should be reserved only for scopes. Although it will only ever contain
> > scopes that are controlled by us (and packaged as .debs), so not a big deal.
>
> Well, I hear you :-) I wasn't happy about the weird path we had:
> /usr/lib/<arch>/scoperunner/scoperunner.
>
> I don't think it matters that the three binaries are in the same directory as
> the scopes. We could make a bin subdirectory or some such, though. Would that
> improve things? (I'm open to either approach.)

Meh, let's keep it the way it is, as I said, no biggie.

Thanks for the other fixes, looks merge-able to me now :)

review: Approve
Revision history for this message
Michi Henning (michihenning) wrote :

> > Thanks for the other fixes, looks merge-able to me now :)

Phew, me wiping big beads of sweat off my forehead… ;-)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> Thanks heaps for that! I just pushed those changes.

Ah cool, thanks! Looks good to me too :)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> FAILED: Autolanding.

ahhhh...

319. By Michi Henning

Merged devel and resolved conflict.

Revision history for this message
Michi Henning (michihenning) wrote :

> ahhhh...

There always is something…

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote :

Another beer…

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-05-02 13:26:56 +0000
+++ CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -171,18 +171,18 @@
171 add_definitions(-DENABLE_IPC_MONITOR)171 add_definitions(-DENABLE_IPC_MONITOR)
172endif()172endif()
173173
174set(SCOPES_DEFAULT_CONFIGDIR ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT})174# Scopes library name. Also used as a prefix in various places, and as a subdirectory
175# name for installed files. Changing this will also require corresponding changes
176# to the debian files.
177set(UNITY_SCOPES_LIB unity-scopes)
175178
176# API version179# API version
177set(UNITY_SCOPES_MAJOR 0)180set(UNITY_SCOPES_MAJOR 0)
178set(UNITY_SCOPES_MINOR 4)181set(UNITY_SCOPES_MINOR 4)
179set(UNITY_SCOPES_MICRO 4)182set(UNITY_SCOPES_MICRO 4)
180183
181# Scopes library
182set(UNITY_SCOPES_LIB unity-scopes)
183
184# Version for testing, with all symbols visible184# Version for testing, with all symbols visible
185set(UNITY_SCOPES_TEST_LIB unity-scopes-test)185set(UNITY_SCOPES_TEST_LIB ${UNITY_SCOPES_LIB}-test)
186186
187pkg_check_modules(JSONCPP jsoncpp REQUIRED)187pkg_check_modules(JSONCPP jsoncpp REQUIRED)
188188
@@ -243,9 +243,10 @@
243243
244# Library install prefix244# Library install prefix
245set(LIB_INSTALL_PREFIX lib/${CMAKE_LIBRARY_ARCHITECTURE})245set(LIB_INSTALL_PREFIX lib/${CMAKE_LIBRARY_ARCHITECTURE})
246
247set(LIBDIR ${CMAKE_INSTALL_LIBDIR})246set(LIBDIR ${CMAKE_INSTALL_LIBDIR})
248set(HDR_INSTALL_DIR include/unity-scopes-${UNITY_SCOPES_MAJOR})247
248set(LIBSUBDIR ${LIBDIR}/${UNITY_SCOPES_LIB}})
249set(HDR_INSTALL_DIR include/${UNITY_SCOPES_LIB}-${UNITY_SCOPES_MAJOR})
249250
250# Tests251# Tests
251include(CTest)252include(CTest)
@@ -344,7 +345,7 @@
344# out all symbols that (recursively) are in the unity::scopes::internal namespace,345# out all symbols that (recursively) are in the unity::scopes::internal namespace,
345# except for a few exceptions that are needed by the scoperegistry, scoperunner,346# except for a few exceptions that are needed by the scoperegistry, scoperunner,
346# smartscopesproxy, and any other binaries that reach into the internal namespace.347# smartscopesproxy, and any other binaries that reach into the internal namespace.
347set(symbol_map "${CMAKE_SOURCE_DIR}/unity-scopes.map")348set(symbol_map "${CMAKE_SOURCE_DIR}/${UNITY_SCOPES_LIB}.map")
348set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES349set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES
349 LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}")350 LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}")
350set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES LINK_DEPENDS ${symbol_map})351set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES LINK_DEPENDS ${symbol_map})
@@ -368,8 +369,6 @@
368369
369option(DEVEL_DOCS "Enable detailed Doxygen documentation")370option(DEVEL_DOCS "Enable detailed Doxygen documentation")
370371
371set(CMAKE_INSTALL_DOCDIR doc)
372
373find_package(Doxygen)372find_package(Doxygen)
374find_program(DOT_EXECUTABLE dot /usr/bin)373find_program(DOT_EXECUTABLE dot /usr/bin)
375if (NOT DOXYGEN_FOUND OR NOT DOT_EXECUTABLE)374if (NOT DOXYGEN_FOUND OR NOT DOT_EXECUTABLE)
@@ -382,14 +381,14 @@
382 configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_BINARY_DIR}/doc/Doxyfile @ONLY IMMEDIATE)381 configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_BINARY_DIR}/doc/Doxyfile @ONLY IMMEDIATE)
383 endif()382 endif()
384 configure_file(${PROJECT_SOURCE_DIR}/doc/index.html ${PROJECT_BINARY_DIR}/doc/index.html COPYONLY)383 configure_file(${PROJECT_SOURCE_DIR}/doc/index.html ${PROJECT_BINARY_DIR}/doc/index.html COPYONLY)
385 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${PROJECT}/index.html384 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB}/index.html
386 COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/Doxyfile385 COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/Doxyfile
387 DEPENDS ${PROJECT_BINARY_DIR}/doc/Doxyfile386 DEPENDS ${PROJECT_BINARY_DIR}/doc/Doxyfile
388 ${PROJECT_SOURCE_DIR}/doc/tutorial.dox387 ${PROJECT_SOURCE_DIR}/doc/tutorial.dox
389 ${UNITY_SCOPES_LIB_SRC}388 ${UNITY_SCOPES_LIB_SRC}
390 ${UNITY_SCOPES_LIB_HDRS})389 ${UNITY_SCOPES_LIB_HDRS})
391 add_custom_target(doc ALL390 add_custom_target(doc ALL
392 DEPENDS ${PROJECT_BINARY_DIR}/doc/${PROJECT}/index.html)391 DEPENDS ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB}/index.html)
393 install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/${PROJECT}392 install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB}
394 DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_INSTALL_DOCDIR})393 DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/doc)
395endif()394endif()
396395
=== added file 'CONFIGFILES'
--- CONFIGFILES 1970-01-01 00:00:00 +0000
+++ CONFIGFILES 2014-05-08 12:06:13 +0000
@@ -0,0 +1,208 @@
1This document outlines how the scopes run time is configured.
2In general, if a recognized key is not set in a configuration
3file, a default value applies as detailed below.
4
5The following configuration files are used by the scopes run time:
6
7
8Runtime.ini
9-----------
10
11If no specific file is provided to the scopes run time, the default path is
12"/usr/lib/<arch>/unity-scopes/Runtime.ini".
13
14If that file does not exist, the default values apply.
15
16The only recognized group in this file is [Runtime].
17
18The following keys are recognized:
19
20- Registry.Identity (string)
21
22 The identity of the local registry. If not set, the default value is "Registry".
23 To run a scope without a registry, for example, using the scoperunner for testing, the identity
24 can be the empty string.
25
26- Registry.ConfigFile (string)
27
28 The path to the registry configuration file. The default value is
29 "/usr/lib/<arch>/unity-scopes/Registry.ini".
30
31- Smartscopes.Registry.Identity (string)
32
33 The identity of the remote registry. If not set, the default value is "SSRegistry".
34 Setting this value explicitly to the empty string disables use of the remote registry.
35
36- Smartscopes.ConfigFile (string)
37
38 The path to the smartscopes configuration file. The default value is
39 "/usr/lib/<arch>/unity-scopes/Smartscopes.ini".
40
41- Default.Middleware (string)
42
43 The middleware to be used by default. The default value is "Zmq".
44
45- <middleware>.ConfigFile
46
47 The path to the configuration file for the middleware, with the value of
48 Default.Middleware substituted for <middleware>, For example,
49
50 Zmq.ConfigFile = <path>
51
52 The default value is "/usr/lib/<arch>/unity-scopes/Zmq.ini".
53
54
55Zmq.ini
56-------
57
58If no specific file is provided to the scopes run time, the default path is
59"/usr/lib/<arch>/unity-scopes/Zmq.ini".
60
61If that file does not exist, the default values for keys apply.
62
63The only recognized group in this file is [Zmq].
64
65The following keys are recognized:
66
67- EndpointDir (string)
68
69 The directory in which the public endpoint of a scope (or the registry) is created.
70 This endpoint must be accessible to any process.
71
72 The default value is "$XDG_RUNTIME_DIR/zmq". If XDG_RUNTIME_DIR is not
73 set, initialization fails.
74
75 Private endpoints are created in "<EndpointDir.Public>/priv".
76
77
78Registry.ini
79------------
80
81If no specific file is provided to the scopes run time, the default path is
82"/usr/lib/<arch>/unity-scopes/Registry.ini".
83
84If that file does not exist, the default values for keys apply.
85
86The only recognized group in this file is [Registry].
87
88The following keys are recognized:
89
90- Middleware
91
92 The middleware used by the registry, such as "Zmq". The default value is "Zmq".
93
94- <Middleware>.ConfigFile
95
96 <Middleware> must match the value of the Middleware key, for example:
97
98 Zmq.Middleware = path/to/SomeFile.ini
99
100- Scoperunner.Path
101
102 The path to the scoperunner executable. The path must be an absolute path.
103 The default value is "/usr/lib/<arch>/scoperunner".
104
105- Scope.InstallDir
106
107 The directory in which to look for subdirectories containing scope .so and .ini files.
108 The default value is "/usr/lib/<arch>/unity-scopes".
109
110- OEM.InstallDir
111
112 The directory in which to look for subdirectories containing scope .so and .ini files added
113 by OEMs. The default value is "/custom/usr/lib/<arch>/unity-scopes".
114
115- Click.InstallDir
116
117 The directory in which to look for subdirectories containing scopes installed from click packages.
118 The default value is "$HOME/.local/share/unity-scopes".
119
120
121Smartscopes.ini
122--------------
123
124If no specific file is provided to the scopes run time, the default path is
125"/usr/lib/<arch>/unity-scopes/Smartscopes.ini".
126
127If that file does not exist, the default values for keys apply.
128
129The only recognized group in this file is [Smartscopes].
130
131The following keys are recognized:
132
133- Http.Reply.Timeout
134
135 The amount of time (in seconds) to wait for a reply from the smartscopes server.
136
137- Registry.Refresh.Rate
138
139 The amount of time (in seconds) between a metadata refresh from the smartscopes server.
140
141- Registry.Refresh.Fail.Timeout
142
143 The amount of time (in seconds) in between retry attempts if a metadata refresh from
144 the smartscopes server fails.
145
146- Scope.Identity
147
148 The identity for proxy scope provided by smartscopesproxy.
149 The default value is "SmartScope".
150
151
152<scope_id>.ini
153--------------
154
155The recognized groups in this file are:
156
157- ScopeConfig
158- Appearance
159
160The following keys are recognized in the ScopeConfig group:
161
162- Override
163
164 Determines whether an OEM scope is allowed to override a Canonical scope. This key is used only by Canonical
165 scopes. If true, the Canonical scope can be replaced by an OEM scope with the same ID. The default value
166 is false.
167
168 For OEM scopes and click scopes, the setting of this key is ignored.
169
170- DisplayName
171
172 The display name of a scope (mandatory, localizable).
173
174- Description
175
176 The description of a scope (mandatory, localizable).
177
178- Author
179
180 The author of the scope (mandatory).
181
182- Art
183
184 Artwork to be shown for the scope. The default value is the empty string.
185
186- Icon
187
188 The icon to be shown for the scope. The default value is the empty string.
189
190- SearchHint
191
192 A search hint for on-screen display (localizable). The default value is the empty string.
193
194- HotKey
195
196 The hot key for the scope. The default value is the empty string.
197
198- Invisible
199
200 Whether the scope is hidden in the UI. The default value is false.
201
202- ScopeRunner
203
204 The path to a custom scoperunner binary. If not set, the default scoperunner is used.
205
206The following keys are recognized in the Appearance group:
207
208- TODO: document this
0209
=== modified file 'RELEASE_NOTES.md'
--- RELEASE_NOTES.md 2014-05-06 11:32:05 +0000
+++ RELEASE_NOTES.md 2014-05-08 12:06:13 +0000
@@ -3,8 +3,19 @@
33
4Changes in version 0.4.44Changes in version 0.4.4
5========================5========================
6 * The register_annotation() method of SearchReply is now deprecated - push(Annotation const&) should be used instead.6 - The register_annotation() method of SearchReply is now deprecated - push(Annotation const&) should
7 The display order of annotations with respect to results and categories got updated in the documentation of that method.7 be used instead. The display order of annotations with respect to results and categories
8 got updated in the documentation of that method.
9
10 - Simplified configuration with sensible defaults for all values.
11
12 - scoperunner, scoperegistry, and smartscopesproxy are now install in /usr/lib/<arch>
13 (instead of in a subdirectory of <arch>).
14
15 - Runtime::run_scope() now has an overload to accept a path to Runtime.ini. If no file name is passed,
16 the system-wide Runtime.ini is used.
17
18 - UNIX domain sockets for Zmq are now placed under /user/run/<uid>/zmq by default.
819
9Changes in version 0.4.220Changes in version 0.4.2
10========================21========================
1122
=== modified file 'data/CMakeLists.txt'
--- data/CMakeLists.txt 2014-03-06 10:55:17 +0000
+++ data/CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -2,14 +2,6 @@
2configure_file(lib${UNITY_SCOPES_LIB}.pc.in lib${UNITY_SCOPES_LIB}.pc @ONLY)2configure_file(lib${UNITY_SCOPES_LIB}.pc.in lib${UNITY_SCOPES_LIB}.pc @ONLY)
3install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${UNITY_SCOPES_LIB}.pc DESTINATION ${LIB_INSTALL_PREFIX}/pkgconfig)3install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${UNITY_SCOPES_LIB}.pc DESTINATION ${LIB_INSTALL_PREFIX}/pkgconfig)
44
5# scope framework config files
6configure_file(Runtime.ini.in Runtime.ini @ONLY)
7configure_file(Registry.ini.in Registry.ini @ONLY)
8configure_file(Zmq.ini.in Zmq.ini @ONLY)
9configure_file(SSRuntime.ini.in SSRuntime.ini @ONLY)
10configure_file(SSRegistry.ini.in SSRegistry.ini @ONLY)
11install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Runtime.ini ${CMAKE_CURRENT_BINARY_DIR}/Registry.ini ${CMAKE_CURRENT_BINARY_DIR}/SSRuntime.ini ${CMAKE_CURRENT_BINARY_DIR}/SSRegistry.ini ${CMAKE_CURRENT_BINARY_DIR}/Zmq.ini DESTINATION ${SCOPES_DEFAULT_CONFIGDIR})
12
13# upstart job for smart scopes proxy5# upstart job for smart scopes proxy
14configure_file(smart-scopes-proxy.conf.in smart-scopes-proxy.conf @ONLY)6configure_file(smart-scopes-proxy.conf.in smart-scopes-proxy.conf @ONLY)
15install(FILES ${CMAKE_CURRENT_BINARY_DIR}/smart-scopes-proxy.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions)7install(FILES ${CMAKE_CURRENT_BINARY_DIR}/smart-scopes-proxy.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions)
@@ -21,6 +13,6 @@
21# Empty directory for scopes to put their conf files into13# Empty directory for scopes to put their conf files into
22# If we start install our own conf files here, this can be14# If we start install our own conf files here, this can be
23# removed (installing files implicitly creates the subdirs)15# removed (installing files implicitly creates the subdirs)
24file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes)16file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB})
25install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes17install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}
26DESTINATION ${CMAKE_INSTALL_LIBDIR})18DESTINATION ${CMAKE_INSTALL_LIBDIR})
2719
=== removed file 'data/Registry.ini.in'
--- data/Registry.ini.in 2014-03-06 10:55:17 +0000
+++ data/Registry.ini.in 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1[Registry]
2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/Registry
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini
6Scope.InstallDir = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/unity-scopes
7OEM.InstallDir = /custom/lib/@CMAKE_LIBRARY_ARCHITECTURE@/unity-scopes
8Scoperunner.Path = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperunner/scoperunner
9SS.Registry.Identity = SSRegistry
10SS.Registry.Endpoint = ipc:///tmp/SSRegistry
110
=== removed file 'data/Runtime.ini.in'
--- data/Runtime.ini.in 2013-12-13 11:25:44 +0000
+++ data/Runtime.ini.in 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
1[Runtime]
2Registry.Identity = Registry
3Registry.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Registry.ini
4Default.Middleware = Zmq
5Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini
60
=== removed file 'data/SSRegistry.ini.in'
--- data/SSRegistry.ini.in 2014-03-06 10:55:17 +0000
+++ data/SSRegistry.ini.in 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1[Registry]
2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/SSRegistry
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini
6Scope.InstallDir = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/unity-scopes
7Scoperunner.Path = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperunner/scoperunner
80
=== removed file 'data/SSRuntime.ini.in'
--- data/SSRuntime.ini.in 2014-02-04 13:57:56 +0000
+++ data/SSRuntime.ini.in 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
1[Runtime]
2Registry.Identity = SSRegistry
3Registry.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/SSRegistry.ini
4Default.Middleware = Zmq
5Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini
60
=== removed file 'data/Zmq.ini.in'
--- data/Zmq.ini.in 2013-11-29 12:20:25 +0000
+++ data/Zmq.ini.in 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1[Zmq]
2EndpointDir.Public = /tmp
3EndpointDir.Private = /tmp
40
=== modified file 'data/libunity-scopes.pc.in'
--- data/libunity-scopes.pc.in 2014-03-06 10:58:11 +0000
+++ data/libunity-scopes.pc.in 2014-05-08 12:06:13 +0000
@@ -19,7 +19,9 @@
19prefix=@CMAKE_INSTALL_PREFIX@19prefix=@CMAKE_INSTALL_PREFIX@
20includedir=${prefix}/@HDR_INSTALL_DIR@20includedir=${prefix}/@HDR_INSTALL_DIR@
21libdir=${prefix}/@LIBDIR@21libdir=${prefix}/@LIBDIR@
22scopesdir=${libdir}/unity-scopes22scopesdir=${libdir}/@UNITY_SCOPES_LIB@
23scoperegistry_bin=${libdir}/@UNITY_SCOPES_LIB@/scoperegistry
24scoperunner_bin=${libdir}/@UNITY_SCOPES_LIB@/scoperunner
2325
24Name: lib@UNITY_SCOPES_LIB@26Name: lib@UNITY_SCOPES_LIB@
25Description: Unity Scopes API library27Description: Unity Scopes API library
2628
=== modified file 'data/scope-registry.conf.in'
--- data/scope-registry.conf.in 2014-02-12 10:21:41 +0000
+++ data/scope-registry.conf.in 2014-05-08 12:06:13 +0000
@@ -7,4 +7,4 @@
7respawn7respawn
8respawn limit 10 608respawn limit 10 60
99
10exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperegistry/scoperegistry10exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@UNITY_SCOPES_LIB@/scoperegistry
1111
=== modified file 'data/smart-scopes-proxy.conf.in'
--- data/smart-scopes-proxy.conf.in 2014-03-06 14:05:06 +0000
+++ data/smart-scopes-proxy.conf.in 2014-05-08 12:06:13 +0000
@@ -9,4 +9,4 @@
99
10expect stop10expect stop
1111
12exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/smartscopesproxy/smartscopesproxy upstart12exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@UNITY_SCOPES_LIB@/smartscopesproxy upstart
1313
=== modified file 'debian/changelog'
--- debian/changelog 2014-05-02 13:26:56 +0000
+++ debian/changelog 2014-05-08 12:06:13 +0000
@@ -1,10 +1,31 @@
1unity-scopes-api (0.4.4-0ubuntu1) UNRELEASED; urgency=low1unity-scopes-api (0.4.4-0ubuntu1) UNRELEASED; urgency=low
22
3 * Implemented to_uri() and from_uri() conversions for CannedQuery.3 [ Michi Henning ]
4 * Ship scopes-client in libunity-scopes-cli package.4 * Simplified configuration files.
5 * Removed SS.Registry.Endpoint from Runtime.ini.
6 * Replaced SS.Registry.Identity with Smartscopes.Registry.Identity
7 * Added documentation for configuration parameters (see CONFIGFILES in
8 the root of the source tree)
9 * Runtime::run_scope() now has an overload to accept a path to Runtime.ini.
10 If no file name is passed, the system-wide Runtime.ini is used.
11 * UNIX domain sockets for Zmq are now placed under $XDG_RUNTIME_DIR/zmq.
12 * Install location for things under /usr/share is now unity-scopes instead
13 of unity-scopes-api.
14
15 [ Pawel Stolowski ]
5 * Renamed SearchReply::register_annotation() to push().16 * Renamed SearchReply::register_annotation() to push().
617
7 -- Pawel Stolowski <pawel.stolowski@ubuntu.com> Tue, 29 Apr 2014 13:39:03 +020018 -- Michi Henning <michi.henning@canonical.com> Thu, 01 May 2014 13:55:48 +1000
19
20unity-scopes-api (0.4.3+14.10.20140502.1-0ubuntu1) utopic; urgency=low
21
22 [ Tarmac ]
23 * Sync with devel branch.
24
25 [ Ubuntu daily release ]
26 * New rebuild forced
27
28 -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 02 May 2014 14:44:05 +0000
829
9unity-scopes-api (0.4.3+14.10.20140428-0ubuntu1) utopic; urgency=low30unity-scopes-api (0.4.3+14.10.20140428-0ubuntu1) utopic; urgency=low
1031
1132
=== modified file 'debian/libunity-scopes-doc.install'
--- debian/libunity-scopes-doc.install 2014-02-04 09:50:11 +0000
+++ debian/libunity-scopes-doc.install 2014-05-08 12:06:13 +0000
@@ -1,1 +1,1 @@
1usr/share/doc/unity-scopes-api/*1usr/share/doc/unity-scopes/*
22
=== modified file 'debian/libunity-scopes1.install'
--- debian/libunity-scopes1.install 2014-04-03 15:04:11 +0000
+++ debian/libunity-scopes1.install 2014-05-08 12:06:13 +0000
@@ -1,7 +1,6 @@
1usr/lib/*/libunity-scopes.so.*1usr/lib/*/libunity-scopes.so.*
2usr/lib/*/unity-scopes2usr/lib/*/unity-scopes
3usr/lib/*/scoperegistry/*3usr/lib/*/unity-scopes/scoperegistry
4usr/lib/*/scoperunner/*4usr/lib/*/unity-scopes/scoperunner
5usr/lib/*/smartscopesproxy/*5usr/lib/*/unity-scopes/smartscopesproxy
6usr/share/unity-scopes-api/*.ini
7usr/share/upstart/sessions/*.conf6usr/share/upstart/sessions/*.conf
87
=== modified file 'debian/libunity-scopes1.symbols'
--- debian/libunity-scopes1.symbols 2014-05-06 11:25:36 +0000
+++ debian/libunity-scopes1.symbols 2014-05-08 12:06:13 +0000
@@ -283,7 +283,8 @@
283 (c++)"unity::scopes::Runtime::create_scope_runtime(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140324283 (c++)"unity::scopes::Runtime::create_scope_runtime(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140324
284 (c++)"unity::scopes::Runtime::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1284 (c++)"unity::scopes::Runtime::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1
285 (c++)"unity::scopes::Runtime::destroy()@Base" 0.4.0+14.04.20140312.1285 (c++)"unity::scopes::Runtime::destroy()@Base" 0.4.0+14.04.20140312.1
286 (c++)"unity::scopes::Runtime::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.2+14.04.20140404.2286 (c++)"unity::scopes::Runtime::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme
287 (c++)"unity::scopes::Runtime::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme
287 (c++)"unity::scopes::Runtime::Runtime(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1288 (c++)"unity::scopes::Runtime::Runtime(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1
288 (c++)"unity::scopes::Runtime::~Runtime()@Base" 0.4.0+14.04.20140312.1289 (c++)"unity::scopes::Runtime::~Runtime()@Base" 0.4.0+14.04.20140312.1
289 (c++)"unity::scopes::Variant::deserialize_json(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.3+14.10.20140428290 (c++)"unity::scopes::Variant::deserialize_json(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.3+14.10.20140428
@@ -366,7 +367,8 @@
366 (c++)"unity::scopes::Registry::~Registry()@Base" 0.4.0+14.04.20140312.1367 (c++)"unity::scopes::Registry::~Registry()@Base" 0.4.0+14.04.20140312.1
367 (c++)"unity::scopes::internal::RuntimeImpl::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1368 (c++)"unity::scopes::internal::RuntimeImpl::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1
368 (c++)"unity::scopes::internal::RuntimeImpl::destroy()@Base" 0.4.0+14.04.20140312.1369 (c++)"unity::scopes::internal::RuntimeImpl::destroy()@Base" 0.4.0+14.04.20140312.1
369 (c++)"unity::scopes::internal::RuntimeImpl::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.2+14.04.20140404.2370 (c++)"unity::scopes::internal::RuntimeImpl::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme
371 (c++)"unity::scopes::internal::RuntimeImpl::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme
370 (c++)"unity::scopes::internal::RuntimeImpl::RuntimeImpl(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1372 (c++)"unity::scopes::internal::RuntimeImpl::RuntimeImpl(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1
371 (c++)"unity::scopes::internal::RuntimeImpl::~RuntimeImpl()@Base" 0.4.0+14.04.20140312.1373 (c++)"unity::scopes::internal::RuntimeImpl::~RuntimeImpl()@Base" 0.4.0+14.04.20140312.1
372 (c++)"unity::scopes::internal::ScopeConfig::ScopeConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1374 (c++)"unity::scopes::internal::ScopeConfig::ScopeConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1
@@ -395,14 +397,14 @@
395 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_remote_scopes()@Base" 0.4.0+14.04.20140312.1397 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_remote_scopes()@Base" 0.4.0+14.04.20140312.1
396 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::add(unity::scopes::internal::smartscopes::RemoteScope const&, unity::scopes::ScopeMetadata const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unity::scopes::ScopeMetadata, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, unity::scopes::ScopeMetadata> > >&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&)@Base" 0.4.0+14.04.20140324398 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::add(unity::scopes::internal::smartscopes::RemoteScope const&, unity::scopes::ScopeMetadata const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unity::scopes::ScopeMetadata, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, unity::scopes::ScopeMetadata> > >&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&)@Base" 0.4.0+14.04.20140324
397 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::locate(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1399 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::locate(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1
398 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::SSRegistryObject(std::shared_ptr<unity::scopes::internal::MiddlewareBase>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@Base" 0.4.0+14.04.20140312.1400 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::SSRegistryObject(std::shared_ptr<unity::scopes::internal::MiddlewareBase>, unity::scopes::internal::smartscopes::SSConfig const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@Base" 0replaceme
399 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::~SSRegistryObject()@Base" 0.4.0+14.04.20140312.1401 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::~SSRegistryObject()@Base" 0.4.0+14.04.20140312.1
400 (c++)"unity::scopes::internal::RuntimeConfig::RUNTIME_CONFIG_GROUP@Base" 0.4.2+14.04.20140404.2402 (c++)"unity::scopes::internal::smartscopes::SSConfig::SSConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme
403 (c++)"unity::scopes::internal::smartscopes::SSConfig::~SSConfig()@Base" 0replaceme
401 (c++)"unity::scopes::internal::RuntimeConfig::RuntimeConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.2+14.04.20140404.2404 (c++)"unity::scopes::internal::RuntimeConfig::RuntimeConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.2+14.04.20140404.2
402 (c++)"unity::scopes::internal::RuntimeConfig::~RuntimeConfig()@Base" 0.4.2+14.04.20140404.2405 (c++)"unity::scopes::internal::RuntimeConfig::~RuntimeConfig()@Base" 0.4.2+14.04.20140404.2
403 (c++)"unity::scopes::internal::MiddlewareBase::MiddlewareBase(unity::scopes::internal::RuntimeImpl*)@Base" 0.4.0+14.04.20140312.1406 (c++)"unity::scopes::internal::MiddlewareBase::MiddlewareBase(unity::scopes::internal::RuntimeImpl*)@Base" 0.4.0+14.04.20140312.1
404 (c++)"unity::scopes::internal::MiddlewareBase::~MiddlewareBase()@Base" 0.4.0+14.04.20140312.1407 (c++)"unity::scopes::internal::MiddlewareBase::~MiddlewareBase()@Base" 0.4.0+14.04.20140312.1
405 (c++)"unity::scopes::internal::RegistryConfig::REGISTRY_CONFIG_GROUP@Base" 0.4.0+14.04.20140312.1
406 (c++)"unity::scopes::internal::RegistryConfig::RegistryConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1408 (c++)"unity::scopes::internal::RegistryConfig::RegistryConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1
407 (c++)"unity::scopes::internal::RegistryConfig::~RegistryConfig()@Base" 0.4.0+14.04.20140312.1409 (c++)"unity::scopes::internal::RegistryConfig::~RegistryConfig()@Base" 0.4.0+14.04.20140312.1
408 (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::update_state(unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState)@Base" 0.4.2+14.04.20140404.2410 (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::update_state(unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState)@Base" 0.4.2+14.04.20140404.2
@@ -605,16 +607,15 @@
605 (c++)"unity::scopes::Category::title() const@Base" 0.4.0+14.04.20140312.1607 (c++)"unity::scopes::Category::title() const@Base" 0.4.0+14.04.20140312.1
606 (c++)"unity::scopes::Category::serialize() const@Base" 0.4.0+14.04.20140312.1608 (c++)"unity::scopes::Category::serialize() const@Base" 0.4.0+14.04.20140312.1
607 (c++)"unity::scopes::internal::RuntimeImpl::async_pool() const@Base" 0.4.3+14.10.20140428609 (c++)"unity::scopes::internal::RuntimeImpl::async_pool() const@Base" 0.4.3+14.10.20140428
608 (c++)"unity::scopes::internal::RuntimeImpl::configfile() const@Base" 0.4.2+14.04.20140404.2
609 (c++)"unity::scopes::internal::RuntimeImpl::future_queue() const@Base" 0.4.3+14.10.20140428610 (c++)"unity::scopes::internal::RuntimeImpl::future_queue() const@Base" 0.4.3+14.10.20140428
610 (c++)"unity::scopes::internal::RuntimeImpl::reply_reaper() const@Base" 0.4.0+14.04.20140312.1611 (c++)"unity::scopes::internal::RuntimeImpl::reply_reaper() const@Base" 0.4.0+14.04.20140312.1
612 (c++)"unity::scopes::internal::RuntimeImpl::ss_configfile() const@Base" 0replaceme
611 (c++)"unity::scopes::internal::RuntimeImpl::waiter_thread(std::shared_ptr<unity::scopes::internal::ThreadSafeQueue<std::future<void> > > const&) const@Base" 0.4.3+14.10.20140428613 (c++)"unity::scopes::internal::RuntimeImpl::waiter_thread(std::shared_ptr<unity::scopes::internal::ThreadSafeQueue<std::future<void> > > const&) const@Base" 0.4.3+14.10.20140428
612 (c++)"unity::scopes::internal::RuntimeImpl::proxy_to_string(std::shared_ptr<unity::scopes::Object> const&) const@Base" 0.4.0+14.04.20140312.1614 (c++)"unity::scopes::internal::RuntimeImpl::proxy_to_string(std::shared_ptr<unity::scopes::Object> const&) const@Base" 0.4.0+14.04.20140312.1
613 (c++)"unity::scopes::internal::RuntimeImpl::string_to_proxy(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@Base" 0.4.0+14.04.20140312.1615 (c++)"unity::scopes::internal::RuntimeImpl::string_to_proxy(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@Base" 0.4.0+14.04.20140312.1
614 (c++)"unity::scopes::internal::RuntimeImpl::registry_endpoint() const@Base" 0.4.0+14.04.20140312.1
615 (c++)"unity::scopes::internal::RuntimeImpl::registry_identity() const@Base" 0.4.0+14.04.20140312.1616 (c++)"unity::scopes::internal::RuntimeImpl::registry_identity() const@Base" 0.4.0+14.04.20140312.1
616 (c++)"unity::scopes::internal::RuntimeImpl::registry_configfile() const@Base" 0.4.0+14.04.20140312.1617 (c++)"unity::scopes::internal::RuntimeImpl::registry_configfile() const@Base" 0.4.0+14.04.20140312.1
617 (c++)"unity::scopes::internal::RuntimeImpl::registry_endpointdir() const@Base" 0.4.0+14.04.20140312.1618 (c++)"unity::scopes::internal::RuntimeImpl::ss_registry_identity() const@Base" 0replaceme
618 (c++)"unity::scopes::internal::RuntimeImpl::factory() const@Base" 0.4.0+14.04.20140312.1619 (c++)"unity::scopes::internal::RuntimeImpl::factory() const@Base" 0.4.0+14.04.20140312.1
619 (c++)"unity::scopes::internal::RuntimeImpl::registry() const@Base" 0.4.0+14.04.20140312.1620 (c++)"unity::scopes::internal::RuntimeImpl::registry() const@Base" 0.4.0+14.04.20140312.1
620 (c++)"unity::scopes::internal::RuntimeImpl::scope_id() const@Base" 0.4.0+14.04.20140312.1621 (c++)"unity::scopes::internal::RuntimeImpl::scope_id() const@Base" 0.4.0+14.04.20140312.1
@@ -637,21 +638,23 @@
637 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_ssclient() const@Base" 0.4.0+14.04.20140312.1638 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_ssclient() const@Base" 0.4.0+14.04.20140312.1
638 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::list() const@Base" 0.4.2+14.04.20140404.2639 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::list() const@Base" 0.4.2+14.04.20140404.2
639 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::has_scope(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@Base" 0.4.0+14.04.20140312.1640 (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::has_scope(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@Base" 0.4.0+14.04.20140312.1
641 (c++)"unity::scopes::internal::smartscopes::SSConfig::scope_identity() const@Base" 0replaceme
642 (c++)"unity::scopes::internal::smartscopes::SSConfig::reg_refresh_rate() const@Base" 0replaceme
643 (c++)"unity::scopes::internal::smartscopes::SSConfig::http_reply_timeout() const@Base" 0replaceme
644 (c++)"unity::scopes::internal::smartscopes::SSConfig::reg_refresh_fail_timeout() const@Base" 0replaceme
645 (c++)"unity::scopes::internal::RuntimeConfig::ss_configfile() const@Base" 0replaceme
640 (c++)"unity::scopes::internal::RuntimeConfig::registry_identity() const@Base" 0.4.2+14.04.20140404.2646 (c++)"unity::scopes::internal::RuntimeConfig::registry_identity() const@Base" 0.4.2+14.04.20140404.2
641 (c++)"unity::scopes::internal::RuntimeConfig::default_middleware() const@Base" 0.4.2+14.04.20140404.2647 (c++)"unity::scopes::internal::RuntimeConfig::default_middleware() const@Base" 0.4.2+14.04.20140404.2
642 (c++)"unity::scopes::internal::RuntimeConfig::registry_configfile() const@Base" 0.4.2+14.04.20140404.2648 (c++)"unity::scopes::internal::RuntimeConfig::registry_configfile() const@Base" 0.4.2+14.04.20140404.2
649 (c++)"unity::scopes::internal::RuntimeConfig::ss_registry_identity() const@Base" 0replaceme
643 (c++)"unity::scopes::internal::RuntimeConfig::default_middleware_configfile() const@Base" 0.4.2+14.04.20140404.2650 (c++)"unity::scopes::internal::RuntimeConfig::default_middleware_configfile() const@Base" 0.4.2+14.04.20140404.2
644 (c++)"unity::scopes::internal::MiddlewareBase::runtime() const@Base" 0.4.0+14.04.20140312.1651 (c++)"unity::scopes::internal::MiddlewareBase::runtime() const@Base" 0.4.0+14.04.20140312.1
645 (c++)"unity::scopes::internal::RegistryConfig::endpointdir() const@Base" 0.4.0+14.04.20140312.1
646 (c++)"unity::scopes::internal::RegistryConfig::mw_configfile() const@Base" 0.4.0+14.04.20140312.1652 (c++)"unity::scopes::internal::RegistryConfig::mw_configfile() const@Base" 0.4.0+14.04.20140312.1
647 (c++)"unity::scopes::internal::RegistryConfig::oem_installdir() const@Base" 0.4.0+14.04.20140312.1653 (c++)"unity::scopes::internal::RegistryConfig::oem_installdir() const@Base" 0.4.0+14.04.20140312.1
648 (c++)"unity::scopes::internal::RegistryConfig::click_installdir() const@Base" 0.4.3+14.10.20140428654 (c++)"unity::scopes::internal::RegistryConfig::click_installdir() const@Base" 0.4.3+14.10.20140428
649 (c++)"unity::scopes::internal::RegistryConfig::scope_installdir() const@Base" 0.4.0+14.04.20140312.1655 (c++)"unity::scopes::internal::RegistryConfig::scope_installdir() const@Base" 0.4.0+14.04.20140312.1
650 (c++)"unity::scopes::internal::RegistryConfig::scoperunner_path() const@Base" 0.4.0+14.04.20140312.1656 (c++)"unity::scopes::internal::RegistryConfig::scoperunner_path() const@Base" 0.4.0+14.04.20140312.1
651 (c++)"unity::scopes::internal::RegistryConfig::ss_registry_endpoint() const@Base" 0.4.0+14.04.20140312.1
652 (c++)"unity::scopes::internal::RegistryConfig::ss_registry_identity() const@Base" 0.4.0+14.04.20140312.1
653 (c++)"unity::scopes::internal::RegistryConfig::mw_kind() const@Base" 0.4.0+14.04.20140312.1657 (c++)"unity::scopes::internal::RegistryConfig::mw_kind() const@Base" 0.4.0+14.04.20140312.1
654 (c++)"unity::scopes::internal::RegistryConfig::endpoint() const@Base" 0.4.0+14.04.20140312.1
655 (c++)"unity::scopes::internal::RegistryConfig::identity() const@Base" 0.4.0+14.04.20140312.1658 (c++)"unity::scopes::internal::RegistryConfig::identity() const@Base" 0.4.0+14.04.20140312.1
656 (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::wait_for_state(unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState, int) const@Base" 0.4.2+14.04.20140404.2659 (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::wait_for_state(unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState, int) const@Base" 0.4.2+14.04.20140404.2
657 (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::wait_for_state(std::unique_lock<std::mutex>&, unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState, int) const@Base" 0.4.2+14.04.20140404.2660 (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::wait_for_state(std::unique_lock<std::mutex>&, unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState, int) const@Base" 0.4.2+14.04.20140404.2
658661
=== modified file 'demo/CMakeLists.txt'
--- demo/CMakeLists.txt 2014-04-23 11:04:31 +0000
+++ demo/CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -4,7 +4,6 @@
44
5configure_file(Runtime.ini.in Runtime.ini)5configure_file(Runtime.ini.in Runtime.ini)
6configure_file(Registry.ini.in Registry.ini)6configure_file(Registry.ini.in Registry.ini)
7configure_file(Zmq.ini.in Zmq.ini)
87
9add_definitions(-DDEMO_RUNTIME_PATH="${CMAKE_CURRENT_BINARY_DIR}/Runtime.ini")8add_definitions(-DDEMO_RUNTIME_PATH="${CMAKE_CURRENT_BINARY_DIR}/Runtime.ini")
109
1110
=== modified file 'demo/README'
--- demo/README 2014-04-23 11:04:31 +0000
+++ demo/README 2014-05-08 12:06:13 +0000
@@ -32,4 +32,4 @@
32$ ./scopes-client scope-B testquery32$ ./scopes-client scope-B testquery
3333
34The client currently looks for Runtime.ini in the current directory and if not present, uses the system-wide Runtime.ini34The client currently looks for Runtime.ini in the current directory and if not present, uses the system-wide Runtime.ini
35shipped with libunity-scopes (/usr/share/unity-scopes-api/Runtime.ini by default)35shipped with libunity-scopes (/usr/lib/<arch>/unity-scopes/Runtime.ini by default)
3636
=== modified file 'demo/Registry.ini.in'
--- demo/Registry.ini.in 2014-02-13 02:40:08 +0000
+++ demo/Registry.ini.in 2014-05-08 12:06:13 +0000
@@ -1,10 +1,5 @@
1[Registry]1[Registry]
2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/Registry
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini2Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini
6Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes3Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes
7OEM.InstallDir = /custom/usr/lib/@CMAKE_LIBRARY_ARCHITECTURE@/unity/scopes4OEM.InstallDir = /custom/usr/lib/@CMAKE_LIBRARY_ARCHITECTURE@/unity/scopes
8Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner5Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner
9SS.Registry.Identity = SSRegistry
10SS.Registry.Endpoint = ipc:///tmp/SSRegistry
116
=== modified file 'demo/Runtime.ini.in'
--- demo/Runtime.ini.in 2014-01-31 02:21:24 +0000
+++ demo/Runtime.ini.in 2014-05-08 12:06:13 +0000
@@ -1,5 +1,3 @@
1[Runtime]1[Runtime]
2Registry.Identity = Registry2Registry.Identity = Registry
3Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Registry.ini3Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Registry.ini
4Default.Middleware = Zmq
5Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini
64
=== removed file 'demo/Zmq.ini.in'
--- demo/Zmq.ini.in 2013-11-28 00:27:48 +0000
+++ demo/Zmq.ini.in 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1[Zmq]
2EndpointDir.Public = /tmp
3EndpointDir.Private = /tmp
40
=== modified file 'demo/click/scope-click/CMakeLists.txt'
--- demo/click/scope-click/CMakeLists.txt 2014-04-03 15:27:11 +0000
+++ demo/click/scope-click/CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -6,7 +6,7 @@
6 include(GNUInstallDirs)6 include(GNUInstallDirs)
7 include(FindPkgConfig)7 include(FindPkgConfig)
88
9 pkg_check_modules(UNITY_SCOPES REQUIRED libunity-scopes>=0.4.0)9 pkg_check_modules(UNITY_SCOPES REQUIRED lib${UNITY_SCOPES_LIB}>=0.4.0)
10 add_definitions(${UNITY_SCOPES_CFLAGS} ${UNITY_SCOPES_CFLAGS_OTHER})10 add_definitions(${UNITY_SCOPES_CFLAGS} ${UNITY_SCOPES_CFLAGS_OTHER})
1111
12 add_definitions(-std=c++11)12 add_definitions(-std=c++11)
1313
=== modified file 'demo/stand-alone/CMakeLists.txt'
--- demo/stand-alone/CMakeLists.txt 2014-02-03 09:04:04 +0000
+++ demo/stand-alone/CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -1,5 +1,4 @@
1configure_file(Runtime.ini.in Runtime.ini)1configure_file(Runtime.ini.in Runtime.ini)
2configure_file(Zmq.ini.in Zmq.ini)
32
4add_executable(stand-alone-client stand-alone-client.cpp)3add_executable(stand-alone-client stand-alone-client.cpp)
54
65
=== modified file 'demo/stand-alone/Runtime.ini.in'
--- demo/stand-alone/Runtime.ini.in 2014-02-03 09:04:04 +0000
+++ demo/stand-alone/Runtime.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,1 @@
1[Runtime]1[Runtime]
2Default.Middleware = Zmq
3Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini
42
=== removed file 'demo/stand-alone/Zmq.ini.in'
--- demo/stand-alone/Zmq.ini.in 2014-02-03 09:04:04 +0000
+++ demo/stand-alone/Zmq.ini.in 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1[Zmq]
2EndpointDir.Public = /tmp
3EndpointDir.Private = /tmp
40
=== modified file 'doc/Doxyfile-devel.in'
--- doc/Doxyfile-devel.in 2014-02-26 00:34:09 +0000
+++ doc/Doxyfile-devel.in 2014-05-08 12:06:13 +0000
@@ -888,7 +888,7 @@
888# If a relative path is entered the value of OUTPUT_DIRECTORY will be888# If a relative path is entered the value of OUTPUT_DIRECTORY will be
889# put in front of it. If left blank `html' will be used as the default path.889# put in front of it. If left blank `html' will be used as the default path.
890890
891HTML_OUTPUT = @PROJECT@891HTML_OUTPUT = @UNITY_SCOPES_LIB@
892892
893# The HTML_FILE_EXTENSION tag can be used to specify the file extension for893# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
894# each generated HTML page (for example: .htm,.php,.asp). If it is left blank894# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
895895
=== modified file 'doc/Doxyfile.in'
--- doc/Doxyfile.in 2014-05-01 17:25:23 +0000
+++ doc/Doxyfile.in 2014-05-08 12:06:13 +0000
@@ -887,7 +887,7 @@
887# If a relative path is entered the value of OUTPUT_DIRECTORY will be887# If a relative path is entered the value of OUTPUT_DIRECTORY will be
888# put in front of it. If left blank `html' will be used as the default path.888# put in front of it. If left blank `html' will be used as the default path.
889889
890HTML_OUTPUT = @PROJECT@890HTML_OUTPUT = @UNITY_SCOPES_LIB@
891891
892# The HTML_FILE_EXTENSION tag can be used to specify the file extension for892# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
893# each generated HTML page (for example: .htm,.php,.asp). If it is left blank893# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
894894
=== modified file 'doc/index.html'
--- doc/index.html 2014-02-26 10:43:45 +0000
+++ doc/index.html 2014-05-08 12:06:13 +0000
@@ -1,10 +1,10 @@
1<head> 1<head>
2<meta http-equiv="refresh" content="1;url=unity-scopes-api/index.html"> 2<meta http-equiv="refresh" content="1;url=unity-scopes/index.html">
3<script type="text/javascript">3<script type="text/javascript">
4 window.location.href = "unity-scopes-api/index.html"4 window.location.href = "unity-scopes/index.html"
5</script>5</script>
6<title>Unity Scopes API - Page Redirection</title>6<title>Unity Scopes API - Page Redirection</title>
7</head> 7</head>
8<body> 8<body>
9<p>You will be redirected automatically, otherwise please <a href="unity-scopes-api/index.html">click here</a>.</p> 9<p>You will be redirected automatically, otherwise please <a href="unity-scopes/index.html">click here</a>.</p>
10</body> 10</body>
1111
=== modified file 'include/CMakeLists.txt'
--- include/CMakeLists.txt 2014-01-31 07:55:00 +0000
+++ include/CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -1,13 +1,13 @@
1add_subdirectory(unity)1add_subdirectory(unity)
2set(UNITY_SCOPES_LIB_HDRS ${UNITY_SCOPES_LIB_HDRS} ${headers} PARENT_SCOPE)2set(UNITY_SCOPES_LIB_HDRS ${UNITY_SCOPES_LIB_HDRS} ${headers} PARENT_SCOPE)
33
4add_custom_command(OUTPUT unity-scopes.h4add_custom_command(OUTPUT ${UNITY_SCOPES_LIB}.h
5COMMAND ${CMAKE_SOURCE_DIR}/tools/create_globalheader.py5COMMAND ${CMAKE_SOURCE_DIR}/tools/create_globalheader.py
6${CMAKE_CURRENT_BINARY_DIR}/unity-scopes.h ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}6${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}.h ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
7DEPENDS ${UNITY_SCOPES_LIB_HDRS})7DEPENDS ${UNITY_SCOPES_LIB_HDRS})
88
9add_custom_target(globalheader ALL9add_custom_target(globalheader ALL
10DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes.h)10DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}.h)
1111
12install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes.h12install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}.h
13DESTINATION ${HDR_INSTALL_DIR})13DESTINATION ${HDR_INSTALL_DIR})
1414
=== modified file 'include/unity/scopes/Runtime.h'
--- include/unity/scopes/Runtime.h 2014-04-03 16:46:00 +0000
+++ include/unity/scopes/Runtime.h 2014-05-08 12:06:13 +0000
@@ -102,8 +102,17 @@
102 This method is intended to run a scope that can not be loaded via the scope runner, such as those written in languages that can not be dynamically loaded.102 This method is intended to run a scope that can not be loaded via the scope runner, such as those written in languages that can not be dynamically loaded.
103103
104 \param scope_base The scope implementation104 \param scope_base The scope implementation
105 \param runtime_ini_file The full path of runtime configuration file. Passing an empty string uses
106 a default configuration.
105 \param scope_ini_file The full path of scope configuration file107 \param scope_ini_file The full path of scope configuration file
106 */108 */
109 void run_scope(ScopeBase *const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file);
110
111 /**
112 \brief Run a scope without going through the scope runner.
113
114 Equivalent to `run_scope(scope_base, "", scope_ini_file);`
115 */
107 void run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file);116 void run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file);
108117
109 // TODO: Flesh out documentation for this, especially syntax.118 // TODO: Flesh out documentation for this, especially syntax.
110119
=== modified file 'include/unity/scopes/internal/ConfigBase.h'
--- include/unity/scopes/internal/ConfigBase.h 2014-02-26 11:32:43 +0000
+++ include/unity/scopes/internal/ConfigBase.h 2014-05-08 12:06:13 +0000
@@ -21,6 +21,9 @@
2121
22#include <unity/util/IniParser.h>22#include <unity/util/IniParser.h>
2323
24#include <map>
25#include <set>
26
24namespace unity27namespace unity
25{28{
2629
@@ -39,16 +42,23 @@
39{42{
40public:43public:
41 ConfigBase();44 ConfigBase();
42 ConfigBase(std::string const& configfile);45 ConfigBase(std::string const& configfile, std::string const& dflt_file = "");
43 virtual ~ConfigBase();46 virtual ~ConfigBase();
4447
45 unity::util::IniParser::SPtr parser() const;48 unity::util::IniParser::SPtr parser() const;
4649
47 virtual std::string get_string(std::string const& group, std::string const& key) const;50 virtual std::string get_string(std::string const& group, std::string const& key) const;
48 virtual std::string get_optional_string(std::string const& group, std::string const& key) const;51 virtual std::string get_optional_string(std::string const& group,
52 std::string const& key,
53 std::string const& dflt = "") const;
49 virtual std::string get_middleware(std::string const& group, std::string const& key) const;54 virtual std::string get_middleware(std::string const& group, std::string const& key) const;
5055
51 virtual void throw_ex(::std::string const& reason) const;56protected:
57 void throw_ex(::std::string const& reason) const;
58 bool path_exists(::std::string const& path) const;
59
60 typedef std::map<std::string, std::set<std::string>> KnownEntries;
61 void check_unknown_entries(KnownEntries const& valid) const;
5262
53private:63private:
54 unity::util::IniParser::SPtr parser_;64 unity::util::IniParser::SPtr parser_;
5565
=== modified file 'include/unity/scopes/internal/DfltConfig.h.in'
--- include/unity/scopes/internal/DfltConfig.h.in 2014-02-06 05:03:24 +0000
+++ include/unity/scopes/internal/DfltConfig.h.in 2014-05-08 12:06:13 +0000
@@ -28,9 +28,23 @@
28namespace internal28namespace internal
29{29{
3030
31static constexpr const char* DFLT_RUNTIME_INI = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Runtime.ini";31static constexpr const char* DFLT_RUNTIME_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Runtime.ini";
32static constexpr const char* DFLT_SS_RUNTIME_INI = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/SSRuntime.ini";32static constexpr const char* DFLT_REGISTRY_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Registry.ini";
33static constexpr const char* DFLT_REGISTRY_INI = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Registry.ini";33static constexpr char const* DFLT_REGISTRY_ID = "Registry";
34static constexpr const char* DFLT_SS_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Smartscopes.ini";
35static constexpr char const* DFLT_SS_REGISTRY_ID = "SSRegistry";
36static constexpr char const* DFLT_SCOPERUNNER_PATH = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/scoperunner";
37static constexpr char const* DFLT_MIDDLEWARE = "Zmq";
38static constexpr char const* DFLT_ZMQ_MIDDLEWARE_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Zmq.ini";
39static constexpr char const* DFLT_MIDDLEWARE_INI = DFLT_ZMQ_MIDDLEWARE_INI;
40static constexpr char const* DFLT_SCOPE_INSTALL_DIR = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@";
41static constexpr char const* DFLT_OEM_INSTALL_DIR = "/custom/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@";
42
43static constexpr int DFLT_SS_HTTP_TIMEOUT = 20; // seconds
44static constexpr int DFLT_SS_REG_REFRESH_RATE = 86400; // 24 hours as seconds
45static constexpr int DFLT_SS_REG_REFRESH_FAIL_TIMEOUT = 10; // seconds
46
47static constexpr char const* DFLT_SS_SCOPE_IDENTITY = "SmartScope";
3448
35} // namespace internal49} // namespace internal
3650
3751
=== modified file 'include/unity/scopes/internal/MiddlewareBase.h'
--- include/unity/scopes/internal/MiddlewareBase.h 2014-04-02 09:24:02 +0000
+++ include/unity/scopes/internal/MiddlewareBase.h 2014-05-08 12:06:13 +0000
@@ -65,7 +65,9 @@
65 virtual ObjectProxy string_to_proxy(std::string const& s) = 0;65 virtual ObjectProxy string_to_proxy(std::string const& s) = 0;
66 virtual std::string proxy_to_string(MWProxy const& proxy) = 0;66 virtual std::string proxy_to_string(MWProxy const& proxy) = 0;
6767
68 virtual MWRegistryProxy create_registry_proxy(std::string const& identity, std::string const& endpoint) = 0;68 virtual MWRegistryProxy registry_proxy() = 0;
69 virtual MWRegistryProxy ss_registry_proxy() = 0;
70
69 virtual MWScopeProxy create_scope_proxy(std::string const& identity) = 0;71 virtual MWScopeProxy create_scope_proxy(std::string const& identity) = 0;
70 virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) = 0;72 virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) = 0;
71 virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) = 0;73 virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) = 0;
7274
=== modified file 'include/unity/scopes/internal/RegistryConfig.h'
--- include/unity/scopes/internal/RegistryConfig.h 2014-04-04 13:22:38 +0000
+++ include/unity/scopes/internal/RegistryConfig.h 2014-05-08 12:06:13 +0000
@@ -33,35 +33,25 @@
33class RegistryConfig : public ConfigBase33class RegistryConfig : public ConfigBase
34{34{
35public:35public:
36 static constexpr char const* REGISTRY_CONFIG_GROUP = "Registry";
37
38 RegistryConfig(std::string const& identity, std::string const& configfile);36 RegistryConfig(std::string const& identity, std::string const& configfile);
39 ~RegistryConfig();37 ~RegistryConfig();
4038
41 std::string identity() const;39 std::string identity() const;
42 std::string mw_kind() const;40 std::string mw_kind() const;
43 std::string endpointdir() const;
44 std::string endpoint() const;
45 std::string mw_configfile() const;41 std::string mw_configfile() const;
46 std::string scope_installdir() const; // Directory for Canonical scopes42 std::string scope_installdir() const; // Directory for Canonical scopes
47 std::string oem_installdir() const; // Directory for OEM scope config files43 std::string oem_installdir() const; // Directory for OEM scope config files
48 std::string click_installdir() const; // Directory for Click scope config files44 std::string click_installdir() const; // Directory for Click scope config files
49 std::string scoperunner_path() const; // Path to scoperunner binary45 std::string scoperunner_path() const; // Path to scoperunner binary
50 std::string ss_registry_identity() const; // Identity of smart scopes registry
51 std::string ss_registry_endpoint() const; // Endpoint of smart scopes registry
5246
53private:47private:
54 std::string identity_;48 std::string identity_;
55 std::string mw_kind_;49 std::string mw_kind_;
56 std::string endpointdir_;
57 std::string endpoint_;
58 std::string mw_configfile_;50 std::string mw_configfile_;
59 std::string scope_installdir_;51 std::string scope_installdir_;
60 std::string oem_installdir_;52 std::string oem_installdir_;
61 std::string click_installdir_;53 std::string click_installdir_;
62 std::string scoperunner_path_;54 std::string scoperunner_path_;
63 std::string ss_registry_identity_;
64 std::string ss_registry_endpoint_;
65};55};
6656
67} // namespace internal57} // namespace internal
6858
=== modified file 'include/unity/scopes/internal/RegistryObject.h'
--- include/unity/scopes/internal/RegistryObject.h 2014-04-10 10:59:00 +0000
+++ include/unity/scopes/internal/RegistryObject.h 2014-05-08 12:06:13 +0000
@@ -123,10 +123,11 @@
123123
124 Executor::SPtr executor_;124 Executor::SPtr executor_;
125125
126 mutable std::mutex mutex_;
127 MetadataMap scopes_;126 MetadataMap scopes_;
128 std::map<std::string, ScopeProcess> scope_processes_;127 typedef std::map<std::string, ScopeProcess> ProcessMap;
128 ProcessMap scope_processes_;
129 MWRegistryProxy remote_registry_;129 MWRegistryProxy remote_registry_;
130 mutable std::mutex mutex_;
130};131};
131132
132} // namespace internal133} // namespace internal
133134
=== modified file 'include/unity/scopes/internal/RuntimeConfig.h'
--- include/unity/scopes/internal/RuntimeConfig.h 2014-01-23 11:28:34 +0000
+++ include/unity/scopes/internal/RuntimeConfig.h 2014-05-08 12:06:13 +0000
@@ -34,19 +34,21 @@
34class RuntimeConfig : public ConfigBase34class RuntimeConfig : public ConfigBase
35{35{
36public:36public:
37 static const char* RUNTIME_CONFIG_GROUP;
38
39 RuntimeConfig(std::string const& configfile);37 RuntimeConfig(std::string const& configfile);
40 ~RuntimeConfig();38 ~RuntimeConfig();
4139
42 std::string registry_identity() const;40 std::string registry_identity() const;
43 std::string registry_configfile() const;41 std::string registry_configfile() const;
42 std::string ss_registry_identity() const;
43 std::string ss_configfile() const;
44 std::string default_middleware() const;44 std::string default_middleware() const;
45 std::string default_middleware_configfile() const;45 std::string default_middleware_configfile() const;
4646
47private:47private:
48 std::string registry_identity_;48 std::string registry_identity_;
49 std::string registry_configfile_;49 std::string registry_configfile_;
50 std::string ss_registry_identity_;
51 std::string ss_configfile_;
50 std::string default_middleware_;52 std::string default_middleware_;
51 std::string default_middleware_configfile_;53 std::string default_middleware_configfile_;
52};54};
5355
=== modified file 'include/unity/scopes/internal/RuntimeImpl.h'
--- include/unity/scopes/internal/RuntimeImpl.h 2014-04-15 05:24:45 +0000
+++ include/unity/scopes/internal/RuntimeImpl.h 2014-05-08 12:06:13 +0000
@@ -44,17 +44,17 @@
44 void destroy();44 void destroy();
4545
46 std::string scope_id() const;46 std::string scope_id() const;
47 std::string configfile() const;
48 MiddlewareFactory const* factory() const;47 MiddlewareFactory const* factory() const;
49 RegistryProxy registry() const;48 RegistryProxy registry() const;
50 std::string registry_configfile() const;49 std::string registry_configfile() const;
51 std::string registry_identity() const;50 std::string registry_identity() const;
52 std::string registry_endpointdir() const;51 std::string ss_configfile() const;
53 std::string registry_endpoint() const;52 std::string ss_registry_identity() const;
54 Reaper::SPtr reply_reaper() const;53 Reaper::SPtr reply_reaper() const;
55 ThreadPool::SPtr async_pool() const;54 ThreadPool::SPtr async_pool() const;
56 ThreadSafeQueue<std::future<void>>::SPtr future_queue() const;55 ThreadSafeQueue<std::future<void>>::SPtr future_queue() const;
57 void run_scope(ScopeBase *const scope_base, std::string const &scope_ini_file);56 void run_scope(ScopeBase* const scope_base, std::string const& scope_ini_file);
57 void run_scope(ScopeBase* const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file);
5858
59 ObjectProxy string_to_proxy(std::string const& s) const;59 ObjectProxy string_to_proxy(std::string const& s) const;
60 std::string proxy_to_string(ObjectProxy const& proxy) const;60 std::string proxy_to_string(ObjectProxy const& proxy) const;
@@ -67,14 +67,13 @@
6767
68 bool destroyed_;68 bool destroyed_;
69 std::string scope_id_;69 std::string scope_id_;
70 std::string configfile_;
71 MiddlewareFactory::UPtr middleware_factory_;70 MiddlewareFactory::UPtr middleware_factory_;
72 MiddlewareBase::SPtr middleware_;71 MiddlewareBase::SPtr middleware_;
73 mutable RegistryProxy registry_;72 mutable RegistryProxy registry_;
74 mutable std::string registry_configfile_;73 mutable std::string registry_configfile_;
75 mutable std::string registry_identity_;74 mutable std::string registry_identity_;
76 mutable std::string registry_endpointdir_;75 mutable std::string ss_configfile_;
77 mutable std::string registry_endpoint_;76 mutable std::string ss_registry_identity_;
78 mutable Reaper::SPtr reply_reaper_;77 mutable Reaper::SPtr reply_reaper_;
79 mutable ThreadPool::SPtr async_pool_; // Pool of invocation threads for async query creation78 mutable ThreadPool::SPtr async_pool_; // Pool of invocation threads for async query creation
80 mutable ThreadSafeQueue<std::future<void>>::SPtr future_queue_;79 mutable ThreadSafeQueue<std::future<void>>::SPtr future_queue_;
8180
=== modified file 'include/unity/scopes/internal/ScopeConfig.h'
--- include/unity/scopes/internal/ScopeConfig.h 2014-04-08 08:26:44 +0000
+++ include/unity/scopes/internal/ScopeConfig.h 2014-05-08 12:06:13 +0000
@@ -35,9 +35,6 @@
35class ScopeConfig : public ConfigBase35class ScopeConfig : public ConfigBase
36{36{
37public:37public:
38 static constexpr const char* SCOPE_CONFIG_GROUP = "ScopeConfig";
39 static constexpr const char* SCOPE_DISPLAY_GROUP = "Appearance";
40
41 ScopeConfig(std::string const& configfile);38 ScopeConfig(std::string const& configfile);
42 ~ScopeConfig();39 ~ScopeConfig();
4340
@@ -51,6 +48,7 @@
51 std::string hot_key() const; // Optional, throws NotFoundException if not present48 std::string hot_key() const; // Optional, throws NotFoundException if not present
52 bool invisible() const; // Optional, returns false if not present49 bool invisible() const; // Optional, returns false if not present
53 std::string scope_runner() const; // Optional, throws NotFoundException if not present50 std::string scope_runner() const; // Optional, throws NotFoundException if not present
51
54 VariantMap appearance_attributes() const; // Optional, return empty map if no attributes are present52 VariantMap appearance_attributes() const; // Optional, return empty map if no attributes are present
5553
56private:54private:
@@ -62,7 +60,7 @@
62 std::unique_ptr<std::string> icon_;60 std::unique_ptr<std::string> icon_;
63 std::unique_ptr<std::string> search_hint_;61 std::unique_ptr<std::string> search_hint_;
64 std::unique_ptr<std::string> hot_key_;62 std::unique_ptr<std::string> hot_key_;
65 std::unique_ptr<bool> invisible_;63 bool invisible_;
66 std::unique_ptr<std::string> scope_runner_;64 std::unique_ptr<std::string> scope_runner_;
67 VariantMap appearance_attributes_;65 VariantMap appearance_attributes_;
68};66};
6967
=== added file 'include/unity/scopes/internal/smartscopes/SSConfig.h'
--- include/unity/scopes/internal/smartscopes/SSConfig.h 1970-01-01 00:00:00 +0000
+++ include/unity/scopes/internal/smartscopes/SSConfig.h 2014-05-08 12:06:13 +0000
@@ -0,0 +1,62 @@
1/*
2 * Copyright (C) 2014 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_SCOPES_INTERNAL_SSCONFIG_H
20#define UNITY_SCOPES_INTERNAL_SSCONFIG_H
21
22#include <unity/scopes/internal/ConfigBase.h>
23
24namespace unity
25{
26
27namespace scopes
28{
29
30namespace internal
31{
32
33namespace smartscopes
34{
35
36class SSConfig : public ConfigBase
37{
38public:
39 SSConfig(std::string const& configfile);
40 ~SSConfig();
41
42 int http_reply_timeout() const; // seconds
43 int reg_refresh_rate() const; // seconds
44 int reg_refresh_fail_timeout() const; // seconds
45 std::string scope_identity() const;
46
47private:
48 int http_reply_timeout_;
49 int reg_refresh_rate_;
50 int reg_refresh_fail_timeout_;
51 std::string scope_identity_;
52};
53
54} // namespace smartscopes
55
56} // namespace internal
57
58} // namespace scopes
59
60} // namespace unity
61
62#endif
063
=== modified file 'include/unity/scopes/internal/smartscopes/SSRegistryObject.h'
--- include/unity/scopes/internal/smartscopes/SSRegistryObject.h 2014-04-03 12:57:25 +0000
+++ include/unity/scopes/internal/smartscopes/SSRegistryObject.h 2014-05-08 12:06:13 +0000
@@ -22,6 +22,7 @@
22#include <unity/scopes/internal/MiddlewareBase.h>22#include <unity/scopes/internal/MiddlewareBase.h>
23#include <unity/scopes/internal/RegistryObjectBase.h>23#include <unity/scopes/internal/RegistryObjectBase.h>
24#include <unity/scopes/internal/smartscopes/SmartScopesClient.h>24#include <unity/scopes/internal/smartscopes/SmartScopesClient.h>
25#include <unity/scopes/internal/smartscopes/SSConfig.h>
2526
26#include <mutex>27#include <mutex>
2728
@@ -42,8 +43,10 @@
42public:43public:
43 UNITY_DEFINES_PTRS(SSRegistryObject);44 UNITY_DEFINES_PTRS(SSRegistryObject);
4445
45 SSRegistryObject(MiddlewareBase::SPtr middleware, std::string const& ss_scope_endpoint,46 SSRegistryObject(MiddlewareBase::SPtr middleware,
46 uint http_reply_timeout, uint refresh_rate_in_sec, std::string const& sss_url = "",47 SSConfig const& ss_config,
48 std::string const& ss_scope_endpoint,
49 std::string const& sss_url = "",
47 bool caching_enabled = true);50 bool caching_enabled = true);
48 virtual ~SSRegistryObject() noexcept;51 virtual ~SSRegistryObject() noexcept;
4952
@@ -78,6 +81,7 @@
78 std::string ss_scope_endpoint_;81 std::string ss_scope_endpoint_;
79 uint const regular_refresh_timeout_;82 uint const regular_refresh_timeout_;
80 uint next_refresh_timeout_;83 uint next_refresh_timeout_;
84 uint const failed_refresh_timeout_;
8185
82 bool caching_enabled_;86 bool caching_enabled_;
83};87};
8488
=== modified file 'include/unity/scopes/internal/zmq_middleware/ZmqConfig.h'
--- include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2014-01-23 11:28:34 +0000
+++ include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2014-05-08 12:06:13 +0000
@@ -33,8 +33,6 @@
33class ZmqConfig : public ConfigBase33class ZmqConfig : public ConfigBase
34{34{
35public:35public:
36 static const char* ZMQ_CONFIG_GROUP;
37
38 ZmqConfig(std::string const& configfile);36 ZmqConfig(std::string const& configfile);
39 ~ZmqConfig();37 ~ZmqConfig();
4038
4139
=== modified file 'include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h'
--- include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2014-04-16 07:04:34 +0000
+++ include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2014-05-08 12:06:13 +0000
@@ -53,7 +53,7 @@
53class ZmqMiddleware final : public MiddlewareBase53class ZmqMiddleware final : public MiddlewareBase
54{54{
55public:55public:
56 ZmqMiddleware(std::string const& server_name, std::string const& configfile, RuntimeImpl* runtime);56 ZmqMiddleware(std::string const& server_name, RuntimeImpl* runtime, std::string const& configfile = "");
57 virtual ~ZmqMiddleware();57 virtual ~ZmqMiddleware();
5858
59 virtual void start() override;59 virtual void start() override;
@@ -63,7 +63,9 @@
63 virtual ObjectProxy string_to_proxy(std::string const& s) override;63 virtual ObjectProxy string_to_proxy(std::string const& s) override;
64 virtual std::string proxy_to_string(MWProxy const& proxy) override;64 virtual std::string proxy_to_string(MWProxy const& proxy) override;
6565
66 virtual MWRegistryProxy create_registry_proxy(std::string const& identity, std::string const& endpoint) override;66 virtual MWRegistryProxy registry_proxy() override;
67 virtual MWRegistryProxy ss_registry_proxy() override;
68
67 virtual MWScopeProxy create_scope_proxy(std::string const& identity) override;69 virtual MWScopeProxy create_scope_proxy(std::string const& identity) override;
68 virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) override;70 virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) override;
69 virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) override;71 virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) override;
@@ -110,6 +112,8 @@
110112
111 std::string server_name_;113 std::string server_name_;
112 zmqpp::context context_;114 zmqpp::context context_;
115 MWRegistryProxy registry_proxy_;
116 MWRegistryProxy ss_registry_proxy_;
113117
114 typedef std::map<std::string, std::shared_ptr<ObjectAdapter>> AdapterMap;118 typedef std::map<std::string, std::shared_ptr<ObjectAdapter>> AdapterMap;
115 AdapterMap am_;119 AdapterMap am_;
116120
=== modified file 'scoperegistry/CMakeLists.txt'
--- scoperegistry/CMakeLists.txt 2014-03-19 10:03:19 +0000
+++ scoperegistry/CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -9,4 +9,4 @@
9add_executable(scoperegistry ${SRC})9add_executable(scoperegistry ${SRC})
10target_link_libraries(scoperegistry ${UNITY_SCOPES_LIB} ${OTHER_LIBS})10target_link_libraries(scoperegistry ${UNITY_SCOPES_LIB} ${OTHER_LIBS})
1111
12install(TARGETS scoperegistry RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/scoperegistry)12install(TARGETS scoperegistry RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${UNITY_SCOPES_LIB})
1313
=== modified file 'scoperegistry/scoperegistry.cpp'
--- scoperegistry/scoperegistry.cpp 2014-04-15 04:53:44 +0000
+++ scoperegistry/scoperegistry.cpp 2014-05-08 12:06:13 +0000
@@ -322,22 +322,11 @@
322 }322 }
323}323}
324324
325// Overwrite any remote scopes loaded previously with the current ones.
326
327void load_remote_scopes(RegistryObject::SPtr const& registry,
328 MiddlewareBase::SPtr const& mw,
329 string const& ss_reg_id,
330 string const& ss_reg_endpoint)
331{
332 auto ss_reg = mw->create_registry_proxy(ss_reg_id, ss_reg_endpoint);
333 registry->set_remote_registry(ss_reg);
334}
335
336} // namespace325} // namespace
337326
338// Usage: scoperegistry [runtime.ini] [scope.ini]...327// Usage: scoperegistry [runtime.ini] [scope.ini]...
339//328//
340// If no runtime config file is specified, the default location (/usr/share/unity-scopes-api/Runtime.ini)329// If no runtime config file is specified, the default location (/usr/lib/<arch>/unity-scopes/Runtime.ini)
341// is assumed.330// is assumed.
342// If additional scope configuration files are specified, the corresponding scopes will be added331// If additional scope configuration files are specified, the corresponding scopes will be added
343// to the registry (overriding any scopes that are found via config files reached via Runtime.ini).332// to the registry (overriding any scopes that are found via config files reached via Runtime.ini).
@@ -370,29 +359,22 @@
370 RuntimeImpl::UPtr runtime = RuntimeImpl::create(rt_config.registry_identity(), config_file);359 RuntimeImpl::UPtr runtime = RuntimeImpl::create(rt_config.registry_identity(), config_file);
371360
372 string identity = runtime->registry_identity();361 string identity = runtime->registry_identity();
362 string ss_reg_id = runtime->ss_registry_identity();
373363
374 // Collect the registry config data.364 // Collect the registry config data.
375365
376 string mw_kind;366 string mw_kind;
377 string mw_endpoint;
378 string mw_configfile;
379 string scope_installdir;367 string scope_installdir;
380 string oem_installdir;368 string oem_installdir;
381 string click_installdir;369 string click_installdir;
382 string scoperunner_path;370 string scoperunner_path;
383 string ss_reg_id;
384 string ss_reg_endpoint;
385 {371 {
386 RegistryConfig c(identity, runtime->registry_configfile());372 RegistryConfig c(identity, runtime->registry_configfile());
387 mw_kind = c.mw_kind();373 mw_kind = c.mw_kind();
388 mw_endpoint = c.endpoint();
389 mw_configfile = c.mw_configfile();
390 scope_installdir = c.scope_installdir();374 scope_installdir = c.scope_installdir();
391 oem_installdir = c.oem_installdir();375 oem_installdir = c.oem_installdir();
392 click_installdir = c.click_installdir();376 click_installdir = c.click_installdir();
393 scoperunner_path = c.scoperunner_path();377 scoperunner_path = c.scoperunner_path();
394 ss_reg_id = c.ss_registry_identity();
395 ss_reg_endpoint = c.ss_registry_endpoint();
396 } // Release memory for config parser378 } // Release memory for config parser
397379
398 MiddlewareBase::SPtr middleware = runtime->factory()->find(identity, mw_kind);380 MiddlewareBase::SPtr middleware = runtime->factory()->find(identity, mw_kind);
@@ -434,16 +416,16 @@
434 local_scopes[scope_id] = argv[i]; // operator[] overwrites pre-existing entries416 local_scopes[scope_id] = argv[i]; // operator[] overwrites pre-existing entries
435 }417 }
436418
437 add_local_scopes(registry, local_scopes, middleware, scoperunner_path, runtime->configfile(), false);419 add_local_scopes(registry, local_scopes, middleware, scoperunner_path, config_file, false);
438 add_local_scopes(registry, click_scopes, middleware, scoperunner_path, runtime->configfile(), true);420 add_local_scopes(registry, click_scopes, middleware, scoperunner_path, config_file, true);
439 local_scopes.insert(click_scopes.begin(), click_scopes.end());421 local_scopes.insert(click_scopes.begin(), click_scopes.end());
440 if (ss_reg_id.empty() || ss_reg_endpoint.empty())422 if (ss_reg_id.empty())
441 {423 {
442 error("no remote registry configured, only local scopes will be available");424 error("no remote registry configured, only local scopes will be available");
443 }425 }
444 else426 else
445 {427 {
446 load_remote_scopes(registry, middleware, ss_reg_id, ss_reg_endpoint);428 registry->set_remote_registry(middleware->ss_registry_proxy());
447 }429 }
448430
449 // Let's add the registry's state receiver to the middleware so that scopes can inform431 // Let's add the registry's state receiver to the middleware so that scopes can inform
450432
=== modified file 'scoperunner/CMakeLists.txt'
--- scoperunner/CMakeLists.txt 2013-11-29 12:20:25 +0000
+++ scoperunner/CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -3,4 +3,4 @@
3add_executable(scoperunner ${SRC})3add_executable(scoperunner ${SRC})
4target_link_libraries(scoperunner ${UNITY_SCOPES_LIB} ${OTHER_LIBS})4target_link_libraries(scoperunner ${UNITY_SCOPES_LIB} ${OTHER_LIBS})
55
6install(TARGETS scoperunner RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/scoperunner)6install(TARGETS scoperunner RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${UNITY_SCOPES_LIB})
77
=== modified file 'smartscopesproxy/CMakeLists.txt'
--- smartscopesproxy/CMakeLists.txt 2014-02-04 10:50:16 +0000
+++ smartscopesproxy/CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -3,4 +3,4 @@
3add_executable(smartscopesproxy ${SRC})3add_executable(smartscopesproxy ${SRC})
4target_link_libraries(smartscopesproxy ${UNITY_SCOPES_LIB} ${OTHER_LIBS})4target_link_libraries(smartscopesproxy ${UNITY_SCOPES_LIB} ${OTHER_LIBS})
55
6install(TARGETS smartscopesproxy RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/smartscopesproxy)6install(TARGETS smartscopesproxy RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${UNITY_SCOPES_LIB})
77
=== modified file 'smartscopesproxy/smartscopesproxy.cpp'
--- smartscopesproxy/smartscopesproxy.cpp 2014-04-09 09:51:32 +0000
+++ smartscopesproxy/smartscopesproxy.cpp 2014-05-08 12:06:13 +0000
@@ -17,6 +17,7 @@
17 */17 */
1818
19#include <unity/scopes/internal/RegistryConfig.h>19#include <unity/scopes/internal/RegistryConfig.h>
20#include <unity/scopes/internal/RuntimeConfig.h>
20#include <unity/scopes/internal/RuntimeImpl.h>21#include <unity/scopes/internal/RuntimeImpl.h>
21#include <unity/scopes/internal/smartscopes/SSScopeObject.h>22#include <unity/scopes/internal/smartscopes/SSScopeObject.h>
22#include <unity/scopes/internal/smartscopes/SSRegistryObject.h>23#include <unity/scopes/internal/smartscopes/SSRegistryObject.h>
@@ -107,14 +108,14 @@
107 {108 {
108 SignalThreadWrapper signal_handler;109 SignalThreadWrapper signal_handler;
109110
110 ///! TODO: get these from config111 RuntimeConfig rt_config(config_file);
111 std::string ss_reg_id = "SSRegistry";112 std::string ss_reg_id = rt_config.ss_registry_identity();
112 std::string ss_scope_id = "SmartScope";113
113 uint const http_reply_timeout = 20000;114 SSConfig ss_config(rt_config.ss_configfile());
114 uint const ss_reg_refresh_rate = 60 * 60 * 24; // 24 hour refresh (in seconds)115 std::string ss_scope_id = ss_config.scope_identity();
115116
116 // Instantiate SS registry and scopes runtimes117 // Instantiate SS registry and scopes runtimes
117 RuntimeImpl::UPtr reg_rt = RuntimeImpl::create(ss_reg_id, DFLT_SS_RUNTIME_INI);118 RuntimeImpl::UPtr reg_rt = RuntimeImpl::create(ss_reg_id, config_file);
118 RuntimeImpl::UPtr scope_rt = RuntimeImpl::create(ss_scope_id, config_file);119 RuntimeImpl::UPtr scope_rt = RuntimeImpl::create(ss_scope_id, config_file);
119120
120 // Get registry config121 // Get registry config
@@ -133,14 +134,13 @@
133 });134 });
134135
135 // Instantiate a SS registry object136 // Instantiate a SS registry object
136 SSRegistryObject::SPtr reg(new SSRegistryObject(reg_mw, scope_mw->get_scope_endpoint(),137 SSRegistryObject::SPtr reg(new SSRegistryObject(reg_mw, ss_config, scope_mw->get_scope_endpoint()));
137 http_reply_timeout, ss_reg_refresh_rate));
138138
139 // Instantiate a SS scope object139 // Instantiate a SS scope object
140 SSScopeObject::UPtr scope(new SSScopeObject(ss_scope_id, scope_mw, reg));140 SSScopeObject::UPtr scope(new SSScopeObject(ss_scope_id, scope_mw, reg));
141141
142 // Add objects to the middlewares142 // Add objects to the middlewares
143 reg_mw->add_registry_object(reg_rt->registry_identity(), reg);143 reg_mw->add_registry_object(reg_rt->ss_registry_identity(), reg);
144 scope_mw->add_dflt_scope_object(std::move(scope));144 scope_mw->add_dflt_scope_object(std::move(scope));
145145
146 if (sig_upstart)146 if (sig_upstart)
147147
=== modified file 'src/scopes/Runtime.cpp'
--- src/scopes/Runtime.cpp 2014-04-03 16:46:00 +0000
+++ src/scopes/Runtime.cpp 2014-05-08 12:06:13 +0000
@@ -62,11 +62,16 @@
62 return p->registry();62 return p->registry();
63}63}
6464
65void Runtime::run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file)65void Runtime::run_scope(ScopeBase* const scope_base, std::string const& scope_ini_file)
66{66{
67 p->run_scope(scope_base, scope_ini_file);67 p->run_scope(scope_base, scope_ini_file);
68}68}
6969
70void Runtime::run_scope(ScopeBase* const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file)
71{
72 p->run_scope(scope_base, runtime_ini_file, scope_ini_file);
73}
74
70ObjectProxy Runtime::string_to_proxy(string const& s) const75ObjectProxy Runtime::string_to_proxy(string const& s) const
71{76{
72 return p->string_to_proxy(s);77 return p->string_to_proxy(s);
7378
=== modified file 'src/scopes/internal/ConfigBase.cpp'
--- src/scopes/internal/ConfigBase.cpp 2014-02-26 11:32:43 +0000
+++ src/scopes/internal/ConfigBase.cpp 2014-05-08 12:06:13 +0000
@@ -18,10 +18,15 @@
1818
19#include <unity/scopes/internal/ConfigBase.h>19#include <unity/scopes/internal/ConfigBase.h>
2020
21#include <unity/scopes/internal/DfltConfig.h>
21#include <unity/scopes/ScopeExceptions.h>22#include <unity/scopes/ScopeExceptions.h>
22#include <unity/UnityExceptions.h>23#include <unity/UnityExceptions.h>
23#include <unity/util/IniParser.h>24#include <unity/util/IniParser.h>
2425
26#include <boost/filesystem/path.hpp>
27
28#include <iostream>
29#include <sys/stat.h>
2530
26using namespace std;31using namespace std;
2732
@@ -37,13 +42,38 @@
37// If configfile is the empty string, we create a default instance that returns "Zmq" for the middleware42// If configfile is the empty string, we create a default instance that returns "Zmq" for the middleware
38// and throws for the other methods.43// and throws for the other methods.
3944
40ConfigBase::ConfigBase(string const& configfile) :45ConfigBase::ConfigBase(string const& configfile, string const& dflt_file) :
41 parser_(nullptr),46 parser_(nullptr),
42 configfile_(configfile)47 configfile_(configfile)
43{48{
44 if (!configfile.empty())49 if (!configfile.empty())
45 {50 {
46 parser_ = make_shared<util::IniParser>(configfile.c_str());51 boost::filesystem::path path(configfile);
52 if (path.extension() != ".ini")
53 {
54 throw ConfigException(string("invalid config file name: \"") + configfile + "\": missing .ini extension");
55 }
56 }
57 if (configfile.empty() || configfile == dflt_file)
58 {
59 // No configfile was specified or it was the same as dflt_file.
60 // We check whether dflt_file exists. If so, we use it. Otherwise,
61 // we don't have a configfile at all and run with defaults.
62 if (path_exists(dflt_file))
63 {
64 parser_ = make_shared<util::IniParser>(dflt_file.c_str());
65 configfile_ = dflt_file;
66 }
67 }
68 else
69 {
70 // The configfile was specified and differs from dflt_file,
71 // so we use it.
72 if (configfile != dflt_file)
73 {
74 parser_ = make_shared<util::IniParser>(configfile.c_str());
75 configfile_ = configfile;
76 }
47 }77 }
48}78}
4979
@@ -70,15 +100,19 @@
70 return val;100 return val;
71}101}
72102
73string ConfigBase::get_optional_string(string const& group, string const& key) const103string ConfigBase::get_optional_string(string const& group, string const& key, string const& dflt) const
74{104{
75 try105 try
76 {106 {
107 if (!parser_)
108 {
109 return dflt;
110 }
77 return parser()->get_string(group, key);111 return parser()->get_string(group, key);
78 }112 }
79 catch (unity::LogicException const&)113 catch (unity::LogicException const&)
80 {114 {
81 return string();115 return dflt;
82 }116 }
83}117}
84118
@@ -86,9 +120,13 @@
86{120{
87 if (!parser_)121 if (!parser_)
88 {122 {
89 return "Zmq";123 return DFLT_MIDDLEWARE;
90 }124 }
91 string val = get_string(group, key);125 string val = get_optional_string(group, key);
126 if (val.empty())
127 {
128 return DFLT_MIDDLEWARE;
129 }
92 if (val != "Zmq" && val != "REST")130 if (val != "Zmq" && val != "REST")
93 {131 {
94 throw_ex("Illegal value for " + key + ": \"" + val +132 throw_ex("Illegal value for " + key + ": \"" + val +
@@ -103,6 +141,50 @@
103 throw ConfigException(s);141 throw ConfigException(s);
104}142}
105143
144bool ConfigBase::path_exists(string const& path) const
145{
146 struct stat st;
147 return stat(path.c_str(), &st) == 0;
148}
149
150// Check whether a configuration file contains unknown groups
151// or unknown keys within a known group. This is useful to catch typos.
152// For example, if a config file contains "Smartscopes.Registry.Idenity" instead
153// of "Smartscopes.Registry.Identity" (did you spot it?), we print a warning,
154// so people don't endlessly scratch their heads as to why the config
155// isn't working for them.
156//
157// KnownEntries is a map of <group, set<key>> pairs that contains
158// the known keys for each group. Anything in the config file that
159// is not found in the map generates a warning.
160
161void ConfigBase::check_unknown_entries(KnownEntries const& known_entries) const
162{
163 if (!parser_)
164 {
165 return;
166 }
167 auto const groups = parser()->get_groups();
168 for (auto const& group : groups)
169 {
170 auto const it = known_entries.find(group);
171 if (it == known_entries.end())
172 {
173 cerr << "warning: ignoring unknown group " << group << " in file " << configfile_ << endl;
174 continue;
175 }
176 auto keys = parser()->get_keys(group);
177 for (auto const& key : keys)
178 {
179 if (it->second.find(key) == it->second.end())
180 {
181 cerr << "warning: ignoring unknown key " << key << " in group " << group
182 << " in file " << configfile_ << endl;
183 }
184 }
185 }
186}
187
106} // namespace internal188} // namespace internal
107189
108} // namespace scopes190} // namespace scopes
109191
=== modified file 'src/scopes/internal/MiddlewareFactory.cpp'
--- src/scopes/internal/MiddlewareFactory.cpp 2014-02-04 21:32:07 +0000
+++ src/scopes/internal/MiddlewareFactory.cpp 2014-05-08 12:06:13 +0000
@@ -62,7 +62,7 @@
62 {62 {
63 case Kind_Zmq:63 case Kind_Zmq:
64 {64 {
65 mw = make_shared<zmq_middleware::ZmqMiddleware>(server_name, configfile, runtime_);65 mw = make_shared<zmq_middleware::ZmqMiddleware>(server_name, runtime_, configfile);
66 break;66 break;
67 }67 }
68 case Kind_REST:68 case Kind_REST:
6969
=== modified file 'src/scopes/internal/RegistryConfig.cpp'
--- src/scopes/internal/RegistryConfig.cpp 2014-05-08 07:25:37 +0000
+++ src/scopes/internal/RegistryConfig.cpp 2014-05-08 12:06:13 +0000
@@ -18,6 +18,7 @@
1818
19#include <unity/scopes/internal/RegistryConfig.h>19#include <unity/scopes/internal/RegistryConfig.h>
2020
21#include <unity/scopes/internal/DfltConfig.h>
21#include <unity/scopes/ScopeExceptions.h>22#include <unity/scopes/ScopeExceptions.h>
22#include <unity/UnityExceptions.h>23#include <unity/UnityExceptions.h>
2324
@@ -32,23 +33,30 @@
32namespace internal33namespace internal
33{34{
3435
35constexpr char const* RegistryConfig::REGISTRY_CONFIG_GROUP;36namespace
37{
38 const string registry_config_group = "Registry";
39 const string mw_kind_key = "Middleware";
40 const string configfile_key = ".ConfigFile";
41 const string scope_installdir_key = "Scope.InstallDir";
42 const string oem_installdir_key = "OEM.InstallDir";
43 const string click_installdir_key = "Click.InstallDir";
44 const string scoperunner_path_key = "Scoperunner.Path";
45}
3646
37RegistryConfig::RegistryConfig(string const& identity, string const& configfile) :47RegistryConfig::RegistryConfig(string const& identity, string const& configfile) :
38 ConfigBase(configfile)48 ConfigBase(configfile, DFLT_REGISTRY_INI)
39{49{
40 identity_ = identity;50 identity_ = identity;
41 if (identity.empty())51 if (identity.empty())
42 {52 {
43 throw InvalidArgumentException("Registry identity cannot be an empty string");53 throw InvalidArgumentException("Registry identity cannot be an empty string");
44 }54 }
45 mw_kind_ = get_middleware(REGISTRY_CONFIG_GROUP, "Middleware");55 mw_kind_ = get_middleware(registry_config_group, mw_kind_key);
46 endpointdir_ = get_string(REGISTRY_CONFIG_GROUP, mw_kind_ + ".EndpointDir");56 mw_configfile_ = get_optional_string(registry_config_group, mw_kind_ + configfile_key);
47 endpoint_ = get_string(REGISTRY_CONFIG_GROUP, mw_kind_ + ".Endpoint");57 scope_installdir_ = get_optional_string(registry_config_group, scope_installdir_key, DFLT_SCOPE_INSTALL_DIR);
48 mw_configfile_ = get_string(REGISTRY_CONFIG_GROUP, mw_kind_ + ".ConfigFile");58 oem_installdir_ = get_optional_string(registry_config_group, oem_installdir_key, DFLT_OEM_INSTALL_DIR);
49 scope_installdir_ = get_string(REGISTRY_CONFIG_GROUP, "Scope.InstallDir");59 click_installdir_ = get_optional_string(registry_config_group, click_installdir_key);
50 oem_installdir_ = get_optional_string(REGISTRY_CONFIG_GROUP, "OEM.InstallDir");
51 click_installdir_ = get_optional_string(REGISTRY_CONFIG_GROUP, "Click.InstallDir");
52 if (click_installdir_.empty())60 if (click_installdir_.empty())
53 {61 {
54 char const* home = getenv("HOME");62 char const* home = getenv("HOME");
@@ -58,13 +66,25 @@
58 }66 }
59 click_installdir_ = string(home) + "/.local/share/unity-scopes/";67 click_installdir_ = string(home) + "/.local/share/unity-scopes/";
60 }68 }
61 scoperunner_path_ = get_string(REGISTRY_CONFIG_GROUP, "Scoperunner.Path");69 scoperunner_path_ = get_optional_string(registry_config_group, scoperunner_path_key, DFLT_SCOPERUNNER_PATH);
62 if (scoperunner_path_[0] != '/')70 if (scoperunner_path_[0] != '/')
63 {71 {
64 throw ConfigException(configfile + ": Scoperunner.Path must be an absolute path");72 throw ConfigException(configfile + ": " + scoperunner_path_key + " must be an absolute path");
65 }73 }
66 ss_registry_identity_ = get_optional_string(REGISTRY_CONFIG_GROUP, "SS.Registry.Identity");74
67 ss_registry_endpoint_ = get_optional_string(REGISTRY_CONFIG_GROUP, "SS.Registry.Endpoint");75 const KnownEntries known_entries = {
76 { registry_config_group,
77 {
78 mw_kind_key,
79 mw_kind_ + configfile_key,
80 scope_installdir_key,
81 oem_installdir_key,
82 click_installdir_key,
83 scoperunner_path_key,
84 }
85 }
86 };
87 check_unknown_entries(known_entries);
68}88}
6989
70RegistryConfig::~RegistryConfig()90RegistryConfig::~RegistryConfig()
@@ -81,16 +101,6 @@
81 return mw_kind_;101 return mw_kind_;
82}102}
83103
84string RegistryConfig::endpointdir() const
85{
86 return endpointdir_;
87}
88
89string RegistryConfig::endpoint() const
90{
91 return endpoint_;
92}
93
94string RegistryConfig::mw_configfile() const104string RegistryConfig::mw_configfile() const
95{105{
96 return mw_configfile_;106 return mw_configfile_;
@@ -116,16 +126,6 @@
116 return scoperunner_path_;126 return scoperunner_path_;
117}127}
118128
119string RegistryConfig::ss_registry_identity() const
120{
121 return ss_registry_identity_;
122}
123
124string RegistryConfig::ss_registry_endpoint() const
125{
126 return ss_registry_endpoint_;
127}
128
129} // namespace internal129} // namespace internal
130130
131} // namespace scopes131} // namespace scopes
132132
=== modified file 'src/scopes/internal/RegistryObject.cpp'
--- src/scopes/internal/RegistryObject.cpp 2014-04-15 04:53:44 +0000
+++ src/scopes/internal/RegistryObject.cpp 2014-05-08 12:06:13 +0000
@@ -90,25 +90,36 @@
9090
91ScopeMetadata RegistryObject::get_metadata(std::string const& scope_id) const91ScopeMetadata RegistryObject::get_metadata(std::string const& scope_id) const
92{92{
93 lock_guard<decltype(mutex_)> lock(mutex_);
94 // If the id is empty, it was sent as empty by the remote client.
95 if (scope_id.empty())93 if (scope_id.empty())
96 {94 {
95 // If the id is empty, it was sent as empty by the remote client.
97 throw unity::InvalidArgumentException("RegistryObject::get_metadata(): Cannot search for scope with empty id");96 throw unity::InvalidArgumentException("RegistryObject::get_metadata(): Cannot search for scope with empty id");
98 }97 }
9998
100 // Look for the scope in both the local and the remote map.99 // Look for the scope in both the local and the remote map.
101 // Local scopes take precedence over remote ones of the same100 // Local scopes take precedence over remote ones of the same id.
102 // id. (Ideally, this should never happen.)101 // (Ideally, this should never happen.)
103 auto const& scope_it = scopes_.find(scope_id);
104 if (scope_it != scopes_.end())
105 {102 {
106 return scope_it->second;103 lock_guard<decltype(mutex_)> lock(mutex_);
104 auto const& scope_it = scopes_.find(scope_id);
105 if (scope_it != scopes_.end())
106 {
107 return scope_it->second;
108 }
107 }109 }
110 // Unlock, so we don't call the remote registry while holding a lock.
108111
109 if (remote_registry_)112 if (remote_registry_)
110 {113 {
111 return remote_registry_->get_metadata(scope_id);114 try
115 {
116 return remote_registry_->get_metadata(scope_id);
117 }
118 catch (std::exception const& e)
119 {
120 cerr << "cannot get metdata from remote registry: " << e.what() << endl;
121 // TODO: log error
122 }
112 }123 }
113124
114 throw NotFoundException("RegistryObject::get_metadata(): no such scope: ", scope_id);125 throw NotFoundException("RegistryObject::get_metadata(): no such scope: ", scope_id);
@@ -116,16 +127,28 @@
116127
117MetadataMap RegistryObject::list() const128MetadataMap RegistryObject::list() const
118{129{
119 lock_guard<decltype(mutex_)> lock(mutex_);130 MetadataMap all_scopes; // Local scopes
120 MetadataMap all_scopes(scopes_); // Local scopes131 {
132 lock_guard<decltype(mutex_)> lock(mutex_);
133 all_scopes = scopes_; // Local scopes
134 }
135 // Unlock, so we don't call the remote registry while holding a lock.
121136
122 // If a remote scope has the same id as a local one,137 // If a remote scope has the same id as a local one,
123 // this will not overwrite a local scope with a remote138 // this will not overwrite a local scope with a remote
124 // one if they have the same id.139 // one if they have the same id.
125 if (remote_registry_)140 if (remote_registry_)
126 {141 {
127 MetadataMap remote_scopes = remote_registry_->list();142 try
128 all_scopes.insert(remote_scopes.begin(), remote_scopes.end());143 {
144 MetadataMap remote_scopes = remote_registry_->list();
145 all_scopes.insert(remote_scopes.begin(), remote_scopes.end());
146 }
147 catch (std::exception const& e)
148 {
149 cerr << "cannot get scopes list from remote registry: " << e.what() << endl;
150 // TODO: log error
151 }
129 }152 }
130153
131 return all_scopes;154 return all_scopes;
@@ -133,22 +156,23 @@
133156
134ObjectProxy RegistryObject::locate(std::string const& identity)157ObjectProxy RegistryObject::locate(std::string const& identity)
135{158{
136 decltype(scopes_.cbegin()) scope_it;159 // If the id is empty, it was sent as empty by the remote client.
137 decltype(scope_processes_.begin()) proc_it;160 if (identity.empty())
161 {
162 throw unity::InvalidArgumentException("RegistryObject::locate(): Cannot locate scope with empty id");
163 }
138164
165 ObjectProxy proxy;
166 ProcessMap::iterator proc_it;
139 {167 {
140 lock_guard<decltype(mutex_)> lock(mutex_);168 lock_guard<decltype(mutex_)> lock(mutex_);
141 // If the id is empty, it was sent as empty by the remote client.
142 if (identity.empty())
143 {
144 throw unity::InvalidArgumentException("RegistryObject::locate(): Cannot locate scope with empty id");
145 }
146169
147 scope_it = scopes_.find(identity);170 auto scope_it = scopes_.find(identity);
148 if (scope_it == scopes_.end())171 if (scope_it == scopes_.end())
149 {172 {
150 throw NotFoundException("RegistryObject::locate(): Tried to locate unknown local scope", identity);173 throw NotFoundException("RegistryObject::locate(): Tried to locate unknown local scope", identity);
151 }174 }
175 proxy = scope_it->second.proxy();
152176
153 proc_it = scope_processes_.find(identity);177 proc_it = scope_processes_.find(identity);
154 if (proc_it == scope_processes_.end())178 if (proc_it == scope_processes_.end())
@@ -157,15 +181,15 @@
157 }181 }
158 }182 }
159183
184 // Exec after unlocking, so we can start processing another locate()
160 proc_it->second.exec(death_observer_, executor_);185 proc_it->second.exec(death_observer_, executor_);
161 return scope_it->second.proxy();186
187 return proxy;
162}188}
163189
164bool RegistryObject::add_local_scope(std::string const& scope_id, ScopeMetadata const& metadata,190bool RegistryObject::add_local_scope(std::string const& scope_id, ScopeMetadata const& metadata,
165 ScopeExecData const& exec_data)191 ScopeExecData const& exec_data)
166{192{
167 lock_guard<decltype(mutex_)> lock(mutex_);
168 bool return_value = true;
169 if (scope_id.empty())193 if (scope_id.empty())
170 {194 {
171 throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot add scope with empty id");195 throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot add scope with empty id");
@@ -175,6 +199,9 @@
175 throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot create a scope with '/' in its id");199 throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot create a scope with '/' in its id");
176 }200 }
177201
202 lock_guard<decltype(mutex_)> lock(mutex_);
203
204 bool return_value = true;
178 if (scopes_.find(scope_id) != scopes_.end())205 if (scopes_.find(scope_id) != scopes_.end())
179 {206 {
180 scopes_.erase(scope_id);207 scopes_.erase(scope_id);
@@ -188,7 +215,6 @@
188215
189bool RegistryObject::remove_local_scope(std::string const& scope_id)216bool RegistryObject::remove_local_scope(std::string const& scope_id)
190{217{
191 lock_guard<decltype(mutex_)> lock(mutex_);
192 // If the id is empty, it was sent as empty by the remote client.218 // If the id is empty, it was sent as empty by the remote client.
193 if (scope_id.empty())219 if (scope_id.empty())
194 {220 {
@@ -196,6 +222,8 @@
196 "with empty id");222 "with empty id");
197 }223 }
198224
225 lock_guard<decltype(mutex_)> lock(mutex_);
226
199 scope_processes_.erase(scope_id);227 scope_processes_.erase(scope_id);
200 return scopes_.erase(scope_id) == 1;228 return scopes_.erase(scope_id) == 1;
201}229}
@@ -208,6 +236,8 @@
208236
209bool RegistryObject::is_scope_running(std::string const& scope_id)237bool RegistryObject::is_scope_running(std::string const& scope_id)
210{238{
239 lock_guard<decltype(mutex_)> lock(mutex_);
240
211 auto it = scope_processes_.find(scope_id);241 auto it = scope_processes_.find(scope_id);
212 if (it != scope_processes_.end())242 if (it != scope_processes_.end())
213 {243 {
@@ -224,14 +254,16 @@
224254
225void RegistryObject::on_process_death(core::posix::Process const& process)255void RegistryObject::on_process_death(core::posix::Process const& process)
226{256{
227 // the death observer has signaled that a child has died.257 // The death observer has signaled that a child has died.
228 // broadcast this message to each scope process until we have found the process in question.258 // Broadcast this message to each scope process until we have found the process in question.
229 // (this is slightly more efficient than just connecting the signal to every scope process)259 // (This is slightly more efficient than just connecting the signal to every scope process.)
230 pid_t pid = process.pid();260 pid_t pid = process.pid();
231 for (auto& scope_process : scope_processes_)261 for (auto& scope_process : scope_processes_)
232 {262 {
233 if (scope_process.second.on_process_death(pid))263 if (scope_process.second.on_process_death(pid))
264 {
234 break;265 break;
266 }
235 }267 }
236}268}
237269
238270
=== modified file 'src/scopes/internal/RuntimeConfig.cpp'
--- src/scopes/internal/RuntimeConfig.cpp 2014-02-05 13:08:06 +0000
+++ src/scopes/internal/RuntimeConfig.cpp 2014-05-08 12:06:13 +0000
@@ -20,6 +20,7 @@
2020
21#include <unity/scopes/internal/DfltConfig.h>21#include <unity/scopes/internal/DfltConfig.h>
22#include <unity/UnityExceptions.h>22#include <unity/UnityExceptions.h>
23#include <iostream> // TODO: remove this
2324
24using namespace std;25using namespace std;
2526
@@ -32,14 +33,15 @@
32namespace internal33namespace internal
33{34{
3435
35const char* RuntimeConfig::RUNTIME_CONFIG_GROUP = "Runtime";
36
37namespace36namespace
38{37{
39 const string registry_identity_str = "Registry.Identity";38 const string runtime_config_group = "Runtime";
40 const string registry_configfile_str = "Registry.ConfigFile";39 const string registry_identity_key = "Registry.Identity";
41 const string default_middleware_str = "Default.Middleware";40 const string registry_configfile_key = "Registry.ConfigFile";
42 const string default_middleware_configfile_str = "ConfigFile";41 const string ss_registry_identity_key = "Smartscopes.Registry.Identity";
42 const string ss_configfile_key = "Smartscopes.ConfigFile";
43 const string default_middleware_key = "Default.Middleware";
44 const string default_middleware_configfile_key = ".ConfigFile";
43}45}
4446
45RuntimeConfig::RuntimeConfig(string const& configfile) :47RuntimeConfig::RuntimeConfig(string const& configfile) :
@@ -47,25 +49,38 @@
47{49{
48 if (configfile.empty()) // Default config50 if (configfile.empty()) // Default config
49 {51 {
50 registry_identity_ = "Registry";52 registry_identity_ = DFLT_REGISTRY_ID;
51 registry_configfile_ = DFLT_REGISTRY_INI;53 registry_configfile_ = DFLT_REGISTRY_INI;
52 default_middleware_ = "Zmq";54 ss_registry_identity_ = DFLT_SS_REGISTRY_ID;
53 default_middleware_configfile_ = "Zmq.ini";55 ss_configfile_ = DFLT_SS_INI;
56 default_middleware_ = DFLT_MIDDLEWARE;
57 default_middleware_configfile_ = DFLT_ZMQ_MIDDLEWARE_INI;
54 }58 }
55 else59 else
56 {60 {
57 registry_identity_ = get_optional_string(RUNTIME_CONFIG_GROUP, registry_identity_str);61 registry_identity_ = get_optional_string(runtime_config_group, registry_identity_key);
58 auto pos = registry_identity_.find_first_of("@:/");62 registry_configfile_ = get_optional_string(runtime_config_group, registry_configfile_key);
59 if (pos != string::npos)63 ss_configfile_ = get_optional_string(runtime_config_group, ss_configfile_key);
60 {64 ss_registry_identity_ = get_optional_string(runtime_config_group, ss_registry_identity_key);
61 throw_ex("Illegal character in value for " + registry_identity_str + ": \"" + registry_identity_ +65 default_middleware_ = get_middleware(runtime_config_group, default_middleware_key);
62 "\": identity cannot contain '" + registry_identity_[pos] + "'");66 default_middleware_configfile_ = get_optional_string(runtime_config_group,
63 }67 default_middleware_ + default_middleware_configfile_key,
64 registry_configfile_ = get_optional_string(RUNTIME_CONFIG_GROUP, registry_configfile_str);68 DFLT_MIDDLEWARE_INI);
65 default_middleware_ = get_middleware(RUNTIME_CONFIG_GROUP, default_middleware_str);
66 default_middleware_configfile_ = get_string(RUNTIME_CONFIG_GROUP,
67 default_middleware_ + "." + default_middleware_configfile_str);
68 }69 }
70
71 const KnownEntries known_entries = {
72 { runtime_config_group,
73 {
74 registry_identity_key,
75 registry_configfile_key,
76 ss_registry_identity_key,
77 ss_configfile_key,
78 default_middleware_key,
79 default_middleware_ + default_middleware_configfile_key
80 }
81 }
82 };
83 check_unknown_entries(known_entries);
69}84}
7085
71RuntimeConfig::~RuntimeConfig()86RuntimeConfig::~RuntimeConfig()
@@ -82,6 +97,16 @@
82 return registry_configfile_;97 return registry_configfile_;
83}98}
8499
100string RuntimeConfig::ss_registry_identity() const
101{
102 return ss_registry_identity_;
103}
104
105string RuntimeConfig::ss_configfile() const
106{
107 return ss_configfile_;
108}
109
85string RuntimeConfig::default_middleware() const110string RuntimeConfig::default_middleware() const
86{111{
87 return default_middleware_;112 return default_middleware_;
88113
=== modified file 'src/scopes/internal/RuntimeImpl.cpp'
--- src/scopes/internal/RuntimeImpl.cpp 2014-04-28 06:24:24 +0000
+++ src/scopes/internal/RuntimeImpl.cpp 2014-05-08 12:06:13 +0000
@@ -64,18 +64,17 @@
64 scope_id_ = "c-" + id.gen();64 scope_id_ = "c-" + id.gen();
65 }65 }
6666
67 string config_file(configfile.empty() ? DFLT_RUNTIME_INI : configfile);
68 configfile_ = config_file;
69
70 try67 try
71 {68 {
72 // Create the middleware factory and get the registry identity and config filename.69 // Create the middleware factory and get the registry identity and config filename.
73 RuntimeConfig config(config_file);70 RuntimeConfig config(configfile);
74 string default_middleware = config.default_middleware();71 string default_middleware = config.default_middleware();
75 string middleware_configfile = config.default_middleware_configfile();72 string middleware_configfile = config.default_middleware_configfile();
76 middleware_factory_.reset(new MiddlewareFactory(this));73 middleware_factory_.reset(new MiddlewareFactory(this));
77 registry_configfile_ = config.registry_configfile();74 registry_configfile_ = config.registry_configfile();
78 registry_identity_ = config.registry_identity();75 registry_identity_ = config.registry_identity();
76 ss_configfile_ = config.ss_configfile();
77 ss_registry_identity_ = config.ss_registry_identity();
7978
80 middleware_ = middleware_factory_->create(scope_id_, default_middleware, middleware_configfile);79 middleware_ = middleware_factory_->create(scope_id_, default_middleware, middleware_configfile);
81 middleware_->start();80 middleware_->start();
@@ -91,18 +90,15 @@
91 }90 }
92 else91 else
93 {92 {
94 // Create the registry proxy.93 // Create the registry proxy
95 RegistryConfig reg_config(registry_identity_, registry_configfile_);94 RegistryConfig reg_config(registry_identity_, registry_configfile_);
96 string reg_mw_configfile = reg_config.mw_configfile();95 auto registry_mw_proxy = middleware_->registry_proxy();
97 registry_endpoint_ = reg_config.endpoint();
98 registry_endpointdir_ = reg_config.endpointdir();
99 auto registry_mw_proxy = middleware_->create_registry_proxy(registry_identity_, registry_endpoint_);
100 registry_ = make_shared<RegistryImpl>(registry_mw_proxy, this);96 registry_ = make_shared<RegistryImpl>(registry_mw_proxy, this);
101 }97 }
102 }98 }
103 catch (unity::Exception const& e)99 catch (unity::Exception const& e)
104 {100 {
105 throw ConfigException("Cannot instantiate run time for " + scope_id + ", config file: " + config_file);101 throw ConfigException("Cannot instantiate run time for " + scope_id_ + ", config file: " + configfile);
106 }102 }
107}103}
108104
@@ -169,8 +165,6 @@
169 middleware_->wait_for_shutdown();165 middleware_->wait_for_shutdown();
170 middleware_ = nullptr;166 middleware_ = nullptr;
171 middleware_factory_.reset(nullptr);167 middleware_factory_.reset(nullptr);
172
173 registry_ = nullptr;
174}168}
175169
176string RuntimeImpl::scope_id() const170string RuntimeImpl::scope_id() const
@@ -179,11 +173,6 @@
179 return scope_id_;173 return scope_id_;
180}174}
181175
182string RuntimeImpl::configfile() const
183{
184 return configfile_;
185}
186
187MiddlewareFactory const* RuntimeImpl::factory() const176MiddlewareFactory const* RuntimeImpl::factory() const
188{177{
189 lock_guard<mutex> lock(mutex_);178 lock_guard<mutex> lock(mutex_);
@@ -212,26 +201,22 @@
212201
213string RuntimeImpl::registry_configfile() const202string RuntimeImpl::registry_configfile() const
214{203{
215 lock_guard<mutex> lock(mutex_);204 return registry_configfile_; // Immutable
216 return registry_configfile_;
217}205}
218206
219string RuntimeImpl::registry_identity() const207string RuntimeImpl::registry_identity() const
220{208{
221 lock_guard<mutex> lock(mutex_);209 return registry_identity_; // Immutable
222 return registry_identity_;210}
223}211
224212string RuntimeImpl::ss_configfile() const
225string RuntimeImpl::registry_endpointdir() const213{
226{214 return ss_configfile_; // Immutable
227 lock_guard<mutex> lock(mutex_);215}
228 return registry_endpointdir_;216
229}217string RuntimeImpl::ss_registry_identity() const
230218{
231string RuntimeImpl::registry_endpoint() const219 return ss_registry_identity_; // Immutable
232{
233 lock_guard<mutex> lock(mutex_);
234 return registry_endpoint_;
235}220}
236221
237Reaper::SPtr RuntimeImpl::reply_reaper() const222Reaper::SPtr RuntimeImpl::reply_reaper() const
@@ -270,15 +255,19 @@
270255
271ThreadSafeQueue<future<void>>::SPtr RuntimeImpl::future_queue() const256ThreadSafeQueue<future<void>>::SPtr RuntimeImpl::future_queue() const
272{257{
273 lock_guard<mutex> lock(mutex_);258 return future_queue_; // Immutable
274 return future_queue_;259}
275}260
276261void RuntimeImpl::run_scope(ScopeBase *const scope_base, string const& scope_ini_file)
277void RuntimeImpl::run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file)262{
263 run_scope(scope_base, "", scope_ini_file);
264}
265
266void RuntimeImpl::run_scope(ScopeBase *const scope_base, string const& runtime_ini_file, string const& scope_ini_file)
278{267{
279 // Retrieve the registry middleware and create a proxy to its state receiver268 // Retrieve the registry middleware and create a proxy to its state receiver
280 RegistryConfig reg_conf(registry_identity_, registry_configfile_);269 RegistryConfig reg_conf(registry_identity_, registry_configfile_);
281 auto reg_runtime = create(registry_identity_, configfile_);270 auto reg_runtime = create(registry_identity_, runtime_ini_file);
282 auto reg_mw = reg_runtime->factory()->find(registry_identity_, reg_conf.mw_kind());271 auto reg_mw = reg_runtime->factory()->find(registry_identity_, reg_conf.mw_kind());
283 auto reg_state_receiver = reg_mw->create_state_receiver_proxy("StateReceiver");272 auto reg_state_receiver = reg_mw->create_state_receiver_proxy("StateReceiver");
284273
@@ -286,8 +275,8 @@
286275
287 {276 {
288 // dirname modifies its argument, so we need a copy of scope lib path277 // dirname modifies its argument, so we need a copy of scope lib path
289 std::vector<char> scope_ini(scope_ini_file.c_str(), scope_ini_file.c_str() + scope_ini_file.size() + 1);278 vector<char> scope_ini(scope_ini_file.c_str(), scope_ini_file.c_str() + scope_ini_file.size() + 1);
290 const std::string scope_dir(dirname(&scope_ini[0]));279 const string scope_dir(dirname(&scope_ini[0]));
291 scope_base->p->set_scope_directory(scope_dir);280 scope_base->p->set_scope_directory(scope_dir);
292 }281 }
293282
294283
=== modified file 'src/scopes/internal/ScopeConfig.cpp'
--- src/scopes/internal/ScopeConfig.cpp 2014-04-23 13:26:03 +0000
+++ src/scopes/internal/ScopeConfig.cpp 2014-05-08 12:06:13 +0000
@@ -37,16 +37,19 @@
3737
38namespace38namespace
39{39{
40 const string overrideable_str = "Override";40 const string scope_config_group = "ScopeConfig";
41 const string scope_name_str = "DisplayName";41 const string overrideable_key = "Override";
42 const string description_str = "Description";42 const string scope_name_key = "DisplayName";
43 const string author_str = "Author";43 const string description_key = "Description";
44 const string art_str = "Art";44 const string author_key = "Author";
45 const string icon_str = "Icon";45 const string art_key = "Art";
46 const string search_hint_str = "SearchHint";46 const string icon_key = "Icon";
47 const string hot_key_str = "HotKey";47 const string search_hint_key = "SearchHint";
48 const string invisible_str = "Invisible";48 const string hot_key_key = "HotKey";
49 const string scope_runner_exec = "ScopeRunner";49 const string invisible_key = "Invisible";
50 const string scoperunner_key = "ScopeRunner";
51
52 const string scope_appearance_group = "Appearance";
50}53}
5154
52ScopeConfig::ScopeConfig(string const& configfile) :55ScopeConfig::ScopeConfig(string const& configfile) :
@@ -54,23 +57,23 @@
54{57{
55 try58 try
56 {59 {
57 overrideable_ = parser()->get_boolean(SCOPE_CONFIG_GROUP, overrideable_str);60 overrideable_ = parser()->get_boolean(scope_config_group, overrideable_key);
58 }61 }
59 catch (LogicException const&)62 catch (LogicException const&)
60 {63 {
61 overrideable_ = false;64 overrideable_ = false;
62 }65 }
6366
64 display_name_ = parser()->get_locale_string(SCOPE_CONFIG_GROUP, scope_name_str);67 display_name_ = parser()->get_locale_string(scope_config_group, scope_name_key);
65 description_ = parser()->get_locale_string(SCOPE_CONFIG_GROUP, description_str);68 description_ = parser()->get_locale_string(scope_config_group, description_key);
66 author_ = parser()->get_string(SCOPE_CONFIG_GROUP, author_str);69 author_ = parser()->get_string(scope_config_group, author_key);
6770
68 // For optional values, we store them in a unique_ptr so we can distinguish the "not set at all" case71 // For optional values, we store them in a unique_ptr so we can distinguish the "not set at all" case
69 // from the "explicitly set to empty string" case. parser()->get_string throws LogicException if72 // from the "explicitly set to empty string" case. parser()->get_string throws LogicException if
70 // the key is not present, so we ignore the exception for optional values.73 // the key is not present, so we ignore the exception for optional values.
71 try74 try
72 {75 {
73 string art = parser()->get_string(SCOPE_CONFIG_GROUP, art_str);76 string art = parser()->get_string(scope_config_group, art_key);
74 art_.reset(new string(art));77 art_.reset(new string(art));
75 }78 }
76 catch (LogicException const&)79 catch (LogicException const&)
@@ -78,7 +81,7 @@
78 }81 }
79 try82 try
80 {83 {
81 string icon = parser()->get_string(SCOPE_CONFIG_GROUP, icon_str);84 string icon = parser()->get_string(scope_config_group, icon_key);
82 icon_.reset(new string(icon));85 icon_.reset(new string(icon));
83 }86 }
84 catch (LogicException const&)87 catch (LogicException const&)
@@ -86,7 +89,7 @@
86 }89 }
87 try90 try
88 {91 {
89 string hint = parser()->get_locale_string(SCOPE_CONFIG_GROUP, search_hint_str);92 string hint = parser()->get_locale_string(scope_config_group, search_hint_key);
90 search_hint_.reset(new string(hint));93 search_hint_.reset(new string(hint));
91 }94 }
92 catch (LogicException const&)95 catch (LogicException const&)
@@ -94,7 +97,7 @@
94 }97 }
95 try98 try
96 {99 {
97 string key = parser()->get_string(SCOPE_CONFIG_GROUP, hot_key_str);100 string key = parser()->get_string(scope_config_group, hot_key_key);
98 hot_key_.reset(new string(key));101 hot_key_.reset(new string(key));
99 }102 }
100 catch (LogicException const&)103 catch (LogicException const&)
@@ -102,35 +105,58 @@
102 }105 }
103 try106 try
104 {107 {
105 string key = parser()->get_string(SCOPE_CONFIG_GROUP, invisible_str);108 invisible_ = parser()->get_boolean(scope_config_group, invisible_key);
106 std::transform(begin(key), end(key), begin(key), ::toupper);
107 invisible_.reset(new bool(key == "TRUE"));
108 }109 }
109 catch (LogicException const&)110 catch (LogicException const&)
110 {111 {
112 invisible_ = false;
111 }113 }
112114
113 // custom scope runner executable is optional115 // custom scope runner executable is optional
114 try116 try
115 {117 {
116 string key = parser()->get_string(SCOPE_CONFIG_GROUP, scope_runner_exec);118 string key = parser()->get_string(scope_config_group, scoperunner_key);
117 scope_runner_.reset(new string(key));119 scope_runner_.reset(new string(key));
118 }120 }
119 catch (LogicException const&)121 catch (LogicException const&)
120 {122 {
121 }123 }
122124
123 // read all display attributes from SCOPE_DISPLAY_GROUP config group125 // read all display attributes from scope_appearance_group
124 try126 try
125 {127 {
126 for (auto const& key: parser()->get_keys(SCOPE_DISPLAY_GROUP))128 for (auto const& key: parser()->get_keys(scope_appearance_group))
127 {129 {
128 appearance_attributes_[key] = parser()->get_string(SCOPE_DISPLAY_GROUP, key);130 appearance_attributes_[key] = parser()->get_string(scope_appearance_group, key);
129 }131 }
130 }132 }
131 catch (LogicException const&)133 catch (LogicException const&)
132 {134 {
133 }135 }
136
137 const KnownEntries known_entries = {
138 { scope_config_group,
139 {
140 overrideable_key,
141 scope_name_key,
142 description_key,
143 author_key,
144 art_key,
145 icon_key,
146 search_hint_key,
147 invisible_key,
148 hot_key_key,
149 scoperunner_key
150 }
151 },
152 // TODO: once we know what appearance attributes are supported,
153 // we need to add them here.
154 { scope_appearance_group,
155 {
156 }
157 }
158 };
159 check_unknown_entries(known_entries);
134}160}
135161
136ScopeConfig::~ScopeConfig()162ScopeConfig::~ScopeConfig()
@@ -161,7 +187,7 @@
161{187{
162 if (!art_)188 if (!art_)
163 {189 {
164 throw NotFoundException("Art not set", art_str);190 throw NotFoundException("Art not set", art_key);
165 }191 }
166 return *art_;192 return *art_;
167}193}
@@ -170,7 +196,7 @@
170{196{
171 if (!icon_)197 if (!icon_)
172 {198 {
173 throw NotFoundException("Icon not set", icon_str);199 throw NotFoundException("Icon not set", icon_key);
174 }200 }
175 return *icon_;201 return *icon_;
176}202}
@@ -179,7 +205,7 @@
179{205{
180 if (!search_hint_)206 if (!search_hint_)
181 {207 {
182 throw NotFoundException("Hint not set", search_hint_str);208 throw NotFoundException("Hint not set", search_hint_key);
183 }209 }
184 return *search_hint_;210 return *search_hint_;
185}211}
@@ -188,25 +214,21 @@
188{214{
189 if (!hot_key_)215 if (!hot_key_)
190 {216 {
191 throw NotFoundException("Key not set", hot_key_str);217 throw NotFoundException("Key not set", hot_key_key);
192 }218 }
193 return *hot_key_;219 return *hot_key_;
194}220}
195221
196bool ScopeConfig::invisible() const222bool ScopeConfig::invisible() const
197{223{
198 if (!invisible_)224 return invisible_;
199 {
200 return false;
201 }
202 return *invisible_;
203}225}
204226
205string ScopeConfig::scope_runner() const227string ScopeConfig::scope_runner() const
206{228{
207 if (!scope_runner_)229 if (!scope_runner_)
208 {230 {
209 throw NotFoundException("Runner binary not set", scope_runner_exec);231 throw NotFoundException("Runner binary not set", scoperunner_key);
210 }232 }
211 return *scope_runner_;233 return *scope_runner_;
212}234}
213235
=== modified file 'src/scopes/internal/smartscopes/CMakeLists.txt'
--- src/scopes/internal/smartscopes/CMakeLists.txt 2014-02-13 07:43:40 +0000
+++ src/scopes/internal/smartscopes/CMakeLists.txt 2014-05-08 12:06:13 +0000
@@ -1,4 +1,5 @@
1set(SRC1set(SRC
2 ${CMAKE_CURRENT_SOURCE_DIR}/SSConfig.cpp
2 ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryCtrlObject.cpp3 ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryCtrlObject.cpp
3 ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryObject.cpp4 ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryObject.cpp
4 ${CMAKE_CURRENT_SOURCE_DIR}/SSRegistryObject.cpp5 ${CMAKE_CURRENT_SOURCE_DIR}/SSRegistryObject.cpp
56
=== added file 'src/scopes/internal/smartscopes/SSConfig.cpp'
--- src/scopes/internal/smartscopes/SSConfig.cpp 1970-01-01 00:00:00 +0000
+++ src/scopes/internal/smartscopes/SSConfig.cpp 2014-05-08 12:06:13 +0000
@@ -0,0 +1,129 @@
1/*
2 * Copyright (C) 2014 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/scopes/internal/smartscopes/SSConfig.h>
20
21#include <unity/scopes/internal/DfltConfig.h>
22#include <unity/scopes/ScopeExceptions.h>
23
24#include <unistd.h>
25
26#include <unity/UnityExceptions.h> // TODO: remove this in config-fixes-stage2 merge proposal
27
28using namespace std;
29
30namespace unity
31{
32
33namespace scopes
34{
35
36namespace internal
37{
38
39namespace smartscopes
40{
41
42namespace
43{
44 const string ss_config_group = "Smartscopes";
45 const string http_reply_timeout_key = "Http.Reply.Timeout";
46 const string reg_refresh_rate_key = "Registry.Refresh.Rate";
47 const string reg_refresh_fail_timeout_key = "Registry.Refresh.Fail.Timeout";
48 const string scope_identity_key = "Scope.Identity";
49}
50
51SSConfig::SSConfig(string const& configfile) :
52 ConfigBase(configfile, DFLT_SS_INI)
53{
54 if (configfile.empty())
55 {
56 http_reply_timeout_ = DFLT_SS_HTTP_TIMEOUT;
57 reg_refresh_rate_ = DFLT_SS_REG_REFRESH_RATE;
58 reg_refresh_fail_timeout_ = DFLT_SS_REG_REFRESH_FAIL_TIMEOUT;
59 scope_identity_ = DFLT_SS_SCOPE_IDENTITY;
60 }
61 else
62 {
63 // TODO: replace code below with commented-out lines as part of config-fixes-stage2 merge proposal:
64 // http_reply_timeout_ = get_optional_int(ss_config_group, http_reply_timeout_key, DFLT_SS_HTTP_TIMEOUT);
65 // reg_refresh_rate_ = get_optional_int(ss_config_group, reg_refresh_rate_key, DFLT_SS_REG_REFRESH);
66 // reg_refresh_fail_timeout_ = get_optional_int(ss_config_group,
67 // reg_refresh_fail_timeout_key,
68 // DFLT_SS_REG_REFRESH_FAIL_TIMEOUT);
69 // scope_identity_ = get_optional_int(ss_config_group, scope_identity_key, DFLT_SS_SCOPE_IDENTITY);
70 try
71 {
72 http_reply_timeout_ = parser()->get_int(ss_config_group, http_reply_timeout_key);
73 reg_refresh_rate_ = parser()->get_int(ss_config_group, reg_refresh_rate_key);
74 reg_refresh_fail_timeout_ = parser()->get_int(ss_config_group, reg_refresh_fail_timeout_key);
75 scope_identity_ = parser()->get_int(ss_config_group, scope_identity_key);
76 }
77 catch (unity::LogicException const&)
78 {
79 http_reply_timeout_ = DFLT_SS_HTTP_TIMEOUT;
80 reg_refresh_rate_ = DFLT_SS_REG_REFRESH_RATE;
81 reg_refresh_fail_timeout_ = DFLT_SS_REG_REFRESH_FAIL_TIMEOUT;
82 scope_identity_ = DFLT_SS_SCOPE_IDENTITY;
83 }
84 }
85
86 const KnownEntries known_entries = {
87 { ss_config_group,
88 {
89 http_reply_timeout_key,
90 reg_refresh_rate_key,
91 reg_refresh_fail_timeout_key,
92 scope_identity_key,
93 }
94 }
95 };
96 check_unknown_entries(known_entries);
97}
98
99SSConfig::~SSConfig()
100{
101}
102
103int SSConfig::http_reply_timeout() const
104{
105 return http_reply_timeout_;
106}
107
108int SSConfig::reg_refresh_rate() const
109{
110 return reg_refresh_rate_;
111}
112
113int SSConfig::reg_refresh_fail_timeout() const
114{
115 return reg_refresh_fail_timeout_;
116}
117
118string SSConfig::scope_identity() const
119{
120 return scope_identity_;
121}
122
123} // namespace smartscopes
124
125} // namespace internal
126
127} // namespace scopes
128
129} // namespace unity
0130
=== modified file 'src/scopes/internal/smartscopes/SSRegistryObject.cpp'
--- src/scopes/internal/smartscopes/SSRegistryObject.cpp 2014-04-03 12:57:25 +0000
+++ src/scopes/internal/smartscopes/SSRegistryObject.cpp 2014-05-08 12:06:13 +0000
@@ -28,7 +28,6 @@
2828
29#include <iostream>29#include <iostream>
3030
31static const uint c_failed_refresh_timeout = 10; ///! TODO get from config
32static const char* c_dbussend_cmd = "dbus-send /com/canonical/unity/scopes com.canonical.unity.scopes.InvalidateResults string:smart-scopes";31static const char* c_dbussend_cmd = "dbus-send /com/canonical/unity/scopes com.canonical.unity.scopes.InvalidateResults string:smart-scopes";
3332
34namespace unity33namespace unity
@@ -44,19 +43,19 @@
44{43{
4544
46SSRegistryObject::SSRegistryObject(MiddlewareBase::SPtr middleware,45SSRegistryObject::SSRegistryObject(MiddlewareBase::SPtr middleware,
46 SSConfig const& ss_config,
47 std::string const& ss_scope_endpoint,47 std::string const& ss_scope_endpoint,
48 uint http_reply_timeout,
49 uint refresh_rate_in_sec,
50 std::string const& sss_url,48 std::string const& sss_url,
51 bool caching_enabled)49 bool caching_enabled)
52 : ssclient_(std::make_shared<SmartScopesClient>(50 : ssclient_(std::make_shared<SmartScopesClient>(
53 std::make_shared<HttpClientQt>(http_reply_timeout),51 std::make_shared<HttpClientQt>(ss_config.http_reply_timeout() * 1000), // need millisecs
54 std::make_shared<JsonCppNode>(), sss_url))52 std::make_shared<JsonCppNode>(), sss_url))
55 , refresh_stopped_(false)53 , refresh_stopped_(false)
56 , middleware_(middleware)54 , middleware_(middleware)
57 , ss_scope_endpoint_(ss_scope_endpoint)55 , ss_scope_endpoint_(ss_scope_endpoint)
58 , regular_refresh_timeout_(refresh_rate_in_sec)56 , regular_refresh_timeout_(ss_config.reg_refresh_rate())
59 , next_refresh_timeout_(refresh_rate_in_sec)57 , next_refresh_timeout_(ss_config.reg_refresh_rate())
58 , failed_refresh_timeout_(ss_config.reg_refresh_fail_timeout())
60 , caching_enabled_(caching_enabled)59 , caching_enabled_(caching_enabled)
61{60{
62 // get remote scopes then start the auto-refresh background thread61 // get remote scopes then start the auto-refresh background thread
@@ -183,14 +182,14 @@
183 }182 }
184 else183 else
185 {184 {
186 next_refresh_timeout_ = c_failed_refresh_timeout;185 next_refresh_timeout_ = failed_refresh_timeout_;
187 }186 }
188 }187 }
189 catch (std::exception const& e)188 catch (std::exception const& e)
190 {189 {
191 std::cerr << e.what() << std::endl;190 std::cerr << e.what() << std::endl;
192 // refresh again soon as get_remote_scopes failed191 // refresh again soon as get_remote_scopes failed
193 next_refresh_timeout_ = c_failed_refresh_timeout;192 next_refresh_timeout_ = failed_refresh_timeout_;
194 return;193 return;
195 }194 }
196195
197196
=== modified file 'src/scopes/internal/zmq_middleware/ZmqConfig.cpp'
--- src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2014-01-23 11:28:34 +0000
+++ src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2014-05-08 12:06:13 +0000
@@ -18,6 +18,11 @@
1818
19#include <unity/scopes/internal/zmq_middleware/ZmqConfig.h>19#include <unity/scopes/internal/zmq_middleware/ZmqConfig.h>
2020
21#include <unity/scopes/internal/DfltConfig.h>
22#include <unity/scopes/ScopeExceptions.h>
23
24#include <unistd.h>
25
21using namespace std;26using namespace std;
2227
23namespace unity28namespace unity
@@ -29,27 +34,43 @@
29namespace internal34namespace internal
30{35{
3136
32const char* ZmqConfig::ZMQ_CONFIG_GROUP = "Zmq";
33
34namespace37namespace
35{38{
36 const string public_dir_str = "EndpointDir.Public";39 const string zmq_config_group = "Zmq";
37 const string private_dir_str = "EndpointDir.Private";40 const string public_dir_key = "EndpointDir";
38}41}
3942
40ZmqConfig::ZmqConfig(string const& configfile) :43ZmqConfig::ZmqConfig(string const& configfile) :
41 ConfigBase(configfile)44 ConfigBase(configfile, DFLT_ZMQ_MIDDLEWARE_INI)
42{45{
43 if (configfile.empty())46 if (!configfile.empty())
44 {47 {
45 public_dir_ = "/tmp";48 public_dir_ = get_optional_string(zmq_config_group, public_dir_key);
46 private_dir_ = "/tmp";49 }
47 }50
48 else51 // Set the endpoint directory if it was not set explicitly.
49 {52 // We look for the XDG_RUNTIME_DIR env variable. If that is not
50 public_dir_ = get_string(ZMQ_CONFIG_GROUP, public_dir_str);53 // set, we give up.
51 private_dir_ = get_string(ZMQ_CONFIG_GROUP, private_dir_str);54 if (public_dir_.empty())
52 }55 {
56 char* xdg_runtime_dir = secure_getenv("XDG_RUNTIME_DIR");
57 if (!xdg_runtime_dir || *xdg_runtime_dir == '\0')
58 {
59 throw ConfigException("No endpoint directories specified, and XDG_RUNTIME_DIR "
60 "environment variable not set");
61 }
62 public_dir_ = string(xdg_runtime_dir) + "/zmq";
63 }
64 private_dir_ = public_dir_ + "/priv";
65
66 const KnownEntries known_entries = {
67 { zmq_config_group,
68 {
69 public_dir_key
70 }
71 }
72 };
73 check_unknown_entries(known_entries);
53}74}
5475
55ZmqConfig::~ZmqConfig()76ZmqConfig::~ZmqConfig()
5677
=== modified file 'src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp'
--- src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2014-04-28 06:24:24 +0000
+++ src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2014-05-08 12:06:13 +0000
@@ -40,6 +40,7 @@
40#include <unity/UnityExceptions.h>40#include <unity/UnityExceptions.h>
4141
42#include <iostream> // TODO: remove this once logging is added42#include <iostream> // TODO: remove this once logging is added
43#include <sys/stat.h>
4344
44using namespace std;45using namespace std;
4546
@@ -70,9 +71,22 @@
70char const* scope_category = "Scope"; // scope adapter category name71char const* scope_category = "Scope"; // scope adapter category name
71char const* registry_category = "Registry"; // registry adapter category name72char const* registry_category = "Registry"; // registry adapter category name
7273
74// Create a directory with mode rwx------t if it doesn't exist yet.
75// We set the sticky bit to prevent the directory from being deleted:
76// if it happens to be under $XDG_RUNTIME_DIR and is not accessed
77// for more than six hours, the system may delete it.
78
79void create_dir(string const& dir)
80{
81 if (mkdir(dir.c_str(), 0700 | S_ISVTX) == -1 && errno != EEXIST)
82 {
83 throw FileException("cannot create endpoint directory " + dir, errno);
84 }
85}
86
73} // namespace87} // namespace
7488
75ZmqMiddleware::ZmqMiddleware(string const& server_name, string const& configfile, RuntimeImpl* runtime)89ZmqMiddleware::ZmqMiddleware(string const& server_name, RuntimeImpl* runtime, string const& configfile)
76try :90try :
77 MiddlewareBase(runtime),91 MiddlewareBase(runtime),
78 server_name_(server_name),92 server_name_(server_name),
@@ -82,6 +96,17 @@
82 locate_timeout_(2000) // TODO: get timeout from config96 locate_timeout_(2000) // TODO: get timeout from config
83{97{
84 assert(!server_name.empty());98 assert(!server_name.empty());
99
100 // Create the endpoint dirs if they don't exist.
101 try
102 {
103 create_dir(config_.public_dir());
104 create_dir(config_.private_dir());
105 }
106 catch (...)
107 {
108 throw MiddlewareException("cannot initialize zmq middleware for scope " + server_name);
109 }
85}110}
86catch (zmqpp::exception const& e)111catch (zmqpp::exception const& e)
87{112{
@@ -347,90 +372,63 @@
347 return proxy->to_string();372 return proxy->to_string();
348}373}
349374
350MWRegistryProxy ZmqMiddleware::create_registry_proxy(string const& identity, string const& endpoint)375MWRegistryProxy ZmqMiddleware::registry_proxy()
351{376{
352 MWRegistryProxy proxy;377 lock_guard<mutex> lock(data_mutex_);
353 try378
354 {379 if (!registry_proxy_)
355 proxy.reset(new ZmqRegistry(this, endpoint, identity, registry_category, twoway_timeout_));380 {
356 }381 string r_id = runtime()->registry_identity(); // May be empty, if no registry is configured.
357 catch (zmqpp::exception const& e)382 if (!r_id.empty())
358 {383 {
359 rethrow_zmq_ex(e);384 string r_endp = "ipc://" + config_.public_dir() + "/" + r_id;
360 }385 registry_proxy_.reset(new ZmqRegistry(this, r_endp, r_id, registry_category, twoway_timeout_));
361 return proxy;386 }
387 }
388 return registry_proxy_;
389}
390
391MWRegistryProxy ZmqMiddleware::ss_registry_proxy()
392{
393 lock_guard<mutex> lock(data_mutex_);
394
395 if (!ss_registry_proxy_)
396 {
397 string ssr_id = runtime()->ss_registry_identity(); // May be empty, if no registry is configured.
398 if (!ssr_id.empty())
399 {
400 string ssr_endp = "ipc://" + config_.public_dir() + "/" + ssr_id;
401 ss_registry_proxy_.reset(new ZmqRegistry(this, ssr_endp, ssr_id, registry_category, twoway_timeout_));
402 }
403 }
404 return ss_registry_proxy_;
362}405}
363406
364MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity)407MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity)
365{408{
366 MWScopeProxy proxy;409 string endpoint = "ipc://" + config_.private_dir() + "/" + identity;
367 try410 return make_shared<ZmqScope>(this, endpoint, identity, scope_category, twoway_timeout_);
368 {
369 string endpoint = "ipc://" + config_.private_dir() + "/" + identity;
370 proxy.reset(new ZmqScope(this, endpoint, identity, scope_category, twoway_timeout_));
371 }
372 catch (zmqpp::exception const& e)
373 {
374 rethrow_zmq_ex(e);
375 }
376 return proxy;
377}411}
378412
379MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity, string const& endpoint)413MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity, string const& endpoint)
380{414{
381 MWScopeProxy proxy;415 return make_shared<ZmqScope>(this, endpoint, identity, scope_category, twoway_timeout_);
382 try
383 {
384 proxy.reset(new ZmqScope(this, endpoint, identity, scope_category, twoway_timeout_));
385 }
386 catch (zmqpp::exception const& e)
387 {
388 rethrow_zmq_ex(e);
389 }
390 return proxy;
391}416}
392417
393MWQueryProxy ZmqMiddleware::create_query_proxy(string const& identity, string const& endpoint)418MWQueryProxy ZmqMiddleware::create_query_proxy(string const& identity, string const& endpoint)
394{419{
395 MWQueryProxy proxy;420 return make_shared<ZmqQuery>(this, endpoint, identity, query_category);
396 try
397 {
398 proxy.reset(new ZmqQuery(this, endpoint, identity, query_category));
399 }
400 catch (zmqpp::exception const& e)
401 {
402 rethrow_zmq_ex(e);
403 }
404 return proxy;
405}421}
406422
407MWQueryCtrlProxy ZmqMiddleware::create_query_ctrl_proxy(string const& identity, string const& endpoint)423MWQueryCtrlProxy ZmqMiddleware::create_query_ctrl_proxy(string const& identity, string const& endpoint)
408{424{
409 MWQueryCtrlProxy proxy;425 return make_shared<ZmqQueryCtrl>(this, endpoint, identity, ctrl_category);
410 try
411 {
412 proxy.reset(new ZmqQueryCtrl(this, endpoint, identity, ctrl_category));
413 }
414 catch (zmqpp::exception const& e)
415 {
416 rethrow_zmq_ex(e);
417 }
418 return proxy;
419}426}
420427
421MWStateReceiverProxy ZmqMiddleware::create_state_receiver_proxy(std::string const& identity)428MWStateReceiverProxy ZmqMiddleware::create_state_receiver_proxy(std::string const& identity)
422{429{
423 MWStateReceiverProxy proxy;430 string endpoint = "ipc://" + config_.private_dir() + "/" + server_name_ + state_suffix;
424 try431 return make_shared<ZmqStateReceiver>(this, endpoint, identity, state_category);
425 {
426 proxy.reset(new ZmqStateReceiver(this, "ipc://" + config_.private_dir() + "/" + server_name_ + state_suffix,
427 identity, state_category));
428 }
429 catch (zmqpp::exception const& e)
430 {
431 rethrow_zmq_ex(e);
432 }
433 return proxy;
434}432}
435433
436MWQueryCtrlProxy ZmqMiddleware::add_query_ctrl_object(QueryCtrlObjectBase::SPtr const& ctrl)434MWQueryCtrlProxy ZmqMiddleware::add_query_ctrl_object(QueryCtrlObjectBase::SPtr const& ctrl)
@@ -526,7 +524,7 @@
526 try524 try
527 {525 {
528 shared_ptr<RegistryI> ri(make_shared<RegistryI>(registry));526 shared_ptr<RegistryI> ri(make_shared<RegistryI>(registry));
529 auto adapter = find_adapter(server_name_, runtime()->registry_endpointdir(), registry_category);527 auto adapter = find_adapter(server_name_, config_.public_dir(), registry_category);
530 function<void()> df;528 function<void()> df;
531 auto p = safe_add(df, adapter, identity, ri);529 auto p = safe_add(df, adapter, identity, ri);
532 registry->set_disconnect_function(df);530 registry->set_disconnect_function(df);
533531
=== modified file 'src/scopes/internal/zmq_middleware/ZmqObject.cpp'
--- src/scopes/internal/zmq_middleware/ZmqObject.cpp 2014-04-17 05:59:48 +0000
+++ src/scopes/internal/zmq_middleware/ZmqObject.cpp 2014-05-08 12:06:13 +0000
@@ -47,9 +47,6 @@
47{47{
48 // this mutex protects all members of all ZmqObjectProxies48 // this mutex protects all members of all ZmqObjectProxies
49 std::mutex shared_mutex;49 std::mutex shared_mutex;
50
51 // There is only one registry proxy, so share it across all ZmqObjectProxies
52 ZmqRegistryProxy shared_reg_proxy = nullptr;
53}50}
5451
55#define MONITOR_ENDPOINT "ipc:///tmp/scopes-monitor"52#define MONITOR_ENDPOINT "ipc:///tmp/scopes-monitor"
@@ -217,40 +214,16 @@
217 }214 }
218 catch (TimeoutException const&)215 catch (TimeoutException const&)
219 {216 {
220 // retrieve the registry proxy if we haven't already done so217 auto registry_proxy = mw_base()->registry_proxy();
221 {218
222 lock_guard<mutex> lock(shared_mutex);219 // If no registry is configured or if this object is the registry itself, rethrow the exception
223 if (!shared_reg_proxy)220 if (!registry_proxy || identity() == registry_proxy->identity())
224 {
225 auto runtime = mw_base() ? mw_base()->runtime() : nullptr;
226 if (!runtime)
227 {
228 throw;
229 }
230
231 // we must do this via lazy initialization as attempting to do this in
232 // the constructor causes a deadlock when accessing runtime methods
233 shared_reg_proxy = dynamic_pointer_cast<ZmqRegistry>(mw_base()->create_registry_proxy(
234 runtime->registry_identity(),
235 runtime->registry_endpoint()));
236
237 // this really shouldn't happen but if we do fail to retrieve the
238 // registry proxy, just rethrow the exception
239 if (!shared_reg_proxy)
240 {
241 throw;
242 }
243 }
244 }
245
246 // if this object is the registry itself, rethrow the exception
247 if (identity() == shared_reg_proxy->identity())
248 {221 {
249 throw;222 throw;
250 }223 }
251224
252 // rebind225 // rebind
253 ObjectProxy new_proxy = shared_reg_proxy->locate(identity());226 ObjectProxy new_proxy = registry_proxy->locate(identity());
254227
255 // update our proxy with the newly received data228 // update our proxy with the newly received data
256 // (we need to first store values in local variables outside of the mutex,229 // (we need to first store values in local variables outside of the mutex,
@@ -312,7 +285,7 @@
312 // If a request times out, we must trash the corresponding socket, otherwise285 // If a request times out, we must trash the corresponding socket, otherwise
313 // zmq gets confused: the reply will never be read, so the socket ends up286 // zmq gets confused: the reply will never be read, so the socket ends up
314 // in a bad state.287 // in a bad state.
315 // (removing a socket from the connection pool deletes it, hense closing the socket)288 // (Removing a socket from the connection pool deletes it, hence closing the socket.)
316 pool.remove(endpoint);289 pool.remove(endpoint);
317 throw TimeoutException("Request timed out after " + std::to_string(timeout) + " milliseconds");290 throw TimeoutException("Request timed out after " + std::to_string(timeout) + " milliseconds");
318 }291 }
319292
=== modified file 'test/gtest/scopes/Activation/Activation_test.cpp'
--- test/gtest/scopes/Activation/Activation_test.cpp 2014-04-15 05:36:38 +0000
+++ test/gtest/scopes/Activation/Activation_test.cpp 2014-05-08 12:06:13 +0000
@@ -513,7 +513,7 @@
513513
514 RaiiScopeThread(std::string const& scope_id, std::string const& configfile)514 RaiiScopeThread(std::string const& scope_id, std::string const& configfile)
515 : runtime(Runtime::create_scope_runtime(scope_id, configfile)),515 : runtime(Runtime::create_scope_runtime(scope_id, configfile)),
516 scope_thread([this]{ runtime->run_scope(&scope, "/foo"); }) {}516 scope_thread([this, configfile]{ runtime->run_scope(&scope, configfile, "/foo"); }) {}
517517
518 ~RaiiScopeThread()518 ~RaiiScopeThread()
519 {519 {
520520
=== modified file 'test/gtest/scopes/Activation/Registry.ini.in'
--- test/gtest/scopes/Activation/Registry.ini.in 2014-04-08 08:26:44 +0000
+++ test/gtest/scopes/Activation/Registry.ini.in 2014-05-08 12:06:13 +0000
@@ -1,7 +1,5 @@
1[Registry]1[Registry]
2Middleware = Zmq2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/socket_for_registry
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = Zmq.ini3Zmq.ConfigFile = Zmq.ini
6Scope.InstallDir = /unused4Scope.InstallDir = /unused
7Click.InstallDir = /unused5Click.InstallDir = /unused
86
=== modified file 'test/gtest/scopes/Activation/Zmq.ini.in'
--- test/gtest/scopes/Activation/Zmq.ini.in 2014-01-14 17:31:16 +0000
+++ test/gtest/scopes/Activation/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/Filters/Filters_test.cpp'
--- test/gtest/scopes/Filters/Filters_test.cpp 2014-04-15 05:36:38 +0000
+++ test/gtest/scopes/Filters/Filters_test.cpp 2014-05-08 12:06:13 +0000
@@ -80,7 +80,7 @@
8080
81 RaiiScopeThread(std::string const& scope_id, std::string const& configfile)81 RaiiScopeThread(std::string const& scope_id, std::string const& configfile)
82 : runtime(Runtime::create_scope_runtime(scope_id, configfile)),82 : runtime(Runtime::create_scope_runtime(scope_id, configfile)),
83 scope_thread([this]{ runtime->run_scope(&scope, "/foo"); }) {}83 scope_thread([this, configfile]{ runtime->run_scope(&scope, configfile, "/foo"); }) {}
8484
85 ~RaiiScopeThread()85 ~RaiiScopeThread()
86 {86 {
8787
=== modified file 'test/gtest/scopes/Filters/Registry.ini.in'
--- test/gtest/scopes/Filters/Registry.ini.in 2014-04-08 08:26:44 +0000
+++ test/gtest/scopes/Filters/Registry.ini.in 2014-05-08 12:06:13 +0000
@@ -1,7 +1,5 @@
1[Registry]1[Registry]
2Middleware = Zmq2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/socket_for_registry
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = Zmq.ini3Zmq.ConfigFile = Zmq.ini
6Scope.InstallDir = /unused4Scope.InstallDir = /unused
7Click.InstallDir = /unused5Click.InstallDir = /unused
86
=== modified file 'test/gtest/scopes/Filters/Zmq.ini.in'
--- test/gtest/scopes/Filters/Zmq.ini.in 2014-01-24 12:51:40 +0000
+++ test/gtest/scopes/Filters/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/Invocation/Invocation_test.cpp'
--- test/gtest/scopes/Invocation/Invocation_test.cpp 2014-05-05 09:21:30 +0000
+++ test/gtest/scopes/Invocation/Invocation_test.cpp 2014-05-08 12:06:13 +0000
@@ -120,10 +120,10 @@
120 EXPECT_EQ("", receiver->error_message());120 EXPECT_EQ("", receiver->error_message());
121}121}
122122
123void scope_thread(Runtime::SPtr const& rt)123void scope_thread(Runtime::SPtr const& rt, string const& runtime_ini_file)
124{124{
125 TestScope scope;125 TestScope scope;
126 rt->run_scope(&scope, "/foo");126 rt->run_scope(&scope, runtime_ini_file, "/foo");
127}127}
128128
129int main(int argc, char **argv)129int main(int argc, char **argv)
@@ -131,7 +131,7 @@
131 ::testing::InitGoogleTest(&argc, argv);131 ::testing::InitGoogleTest(&argc, argv);
132132
133 Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini"));133 Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini"));
134 std::thread scope_t(scope_thread, srt);134 std::thread scope_t(scope_thread, srt, "Runtime.ini");
135135
136 // Give thread some time to bind to its endpoint, to avoid getting ObjectNotExistException136 // Give thread some time to bind to its endpoint, to avoid getting ObjectNotExistException
137 // from a synchronous remote call.137 // from a synchronous remote call.
138138
=== modified file 'test/gtest/scopes/Invocation/Registry.ini.in'
--- test/gtest/scopes/Invocation/Registry.ini.in 2014-04-17 01:36:29 +0000
+++ test/gtest/scopes/Invocation/Registry.ini.in 2014-05-08 12:06:13 +0000
@@ -1,7 +1,5 @@
1[Registry]1[Registry]
2Middleware = Zmq2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/socket_for_registry
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = Zmq.ini3Zmq.ConfigFile = Zmq.ini
6Scope.InstallDir = /unused4Scope.InstallDir = /unused
7Click.InstallDir = /unused5Click.InstallDir = /unused
86
=== modified file 'test/gtest/scopes/Invocation/Zmq.ini.in'
--- test/gtest/scopes/Invocation/Zmq.ini.in 2014-04-17 01:36:29 +0000
+++ test/gtest/scopes/Invocation/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/Registry/RegistryTest.ini.in'
--- test/gtest/scopes/Registry/RegistryTest.ini.in 2014-04-08 08:26:44 +0000
+++ test/gtest/scopes/Registry/RegistryTest.ini.in 2014-05-08 12:06:13 +0000
@@ -1,7 +1,5 @@
1[Registry]1[Registry]
2Middleware = Zmq2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/RegistryTest
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini3Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini
6Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes4Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes
7OEM.InstallDir = /unused5OEM.InstallDir = /unused
86
=== modified file 'test/gtest/scopes/Registry/Registry_test.cpp'
--- test/gtest/scopes/Registry/Registry_test.cpp 2014-05-05 11:20:55 +0000
+++ test/gtest/scopes/Registry/Registry_test.cpp 2014-05-08 12:06:13 +0000
@@ -80,11 +80,13 @@
80 // wait for the registry to become available on middleware80 // wait for the registry to become available on middleware
81 // FIXME: remove this once we have async queries and can set arbitrary timeout when calling registry81 // FIXME: remove this once we have async queries and can set arbitrary timeout when calling registry
82 const int num_retries = 10;82 const int num_retries = 10;
83 bool registry_started = false;
83 for (int i = 0; i < num_retries; ++i)84 for (int i = 0; i < num_retries; ++i)
84 {85 {
85 try86 try
86 {87 {
87 r->list(); // this will throw if the registry is not yet available on middleware88 r->list(); // this will throw if the registry is not yet available on middleware
89 registry_started = true;
88 break;90 break;
89 }91 }
90 catch (std::exception const&)92 catch (std::exception const&)
@@ -92,6 +94,7 @@
92 sleep(1);94 sleep(1);
93 }95 }
94 }96 }
97 ASSERT_TRUE(registry_started);
9598
96 auto meta = r->get_metadata("testscopeA");99 auto meta = r->get_metadata("testscopeA");
97 EXPECT_EQ("testscopeA", meta.scope_id());100 EXPECT_EQ("testscopeA", meta.scope_id());
98101
=== modified file 'test/gtest/scopes/Registry/Runtime.ini.in'
--- test/gtest/scopes/Registry/Runtime.ini.in 2014-04-03 16:50:44 +0000
+++ test/gtest/scopes/Registry/Runtime.ini.in 2014-05-08 12:06:13 +0000
@@ -3,3 +3,4 @@
3Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/RegistryTest.ini3Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/RegistryTest.ini
4Default.Middleware = Zmq4Default.Middleware = Zmq
5Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini5Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini
6Smartscopes.Registry.Identity =
67
=== modified file 'test/gtest/scopes/Registry/Zmq.ini.in'
--- test/gtest/scopes/Registry/Zmq.ini.in 2014-04-01 16:58:32 +0000
+++ test/gtest/scopes/Registry/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp'
--- test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp 2014-04-14 05:11:28 +0000
+++ test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp 2014-05-08 12:06:13 +0000
@@ -102,6 +102,6 @@
102102
103 MyScope scope;103 MyScope scope;
104 auto runtime = Runtime::create_scope_runtime("testscopeB", rt_config);104 auto runtime = Runtime::create_scope_runtime("testscopeB", rt_config);
105 runtime->run_scope(&scope, scope_config);105 runtime->run_scope(&scope, rt_config, scope_config);
106 return 0;106 return 0;
107}107}
108108
=== modified file 'test/gtest/scopes/Runtime/Registry.ini.in'
--- test/gtest/scopes/Runtime/Registry.ini.in 2014-04-08 08:26:44 +0000
+++ test/gtest/scopes/Runtime/Registry.ini.in 2014-05-08 12:06:13 +0000
@@ -1,7 +1,5 @@
1[Registry]1[Registry]
2Middleware = Zmq2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/socket_for_registry
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = Zmq.ini3Zmq.ConfigFile = Zmq.ini
6Scope.InstallDir = /unused4Scope.InstallDir = /unused
7Click.InstallDir = /unused5Click.InstallDir = /unused
86
=== modified file 'test/gtest/scopes/Runtime/Runtime_test.cpp'
--- test/gtest/scopes/Runtime/Runtime_test.cpp 2014-04-17 07:17:31 +0000
+++ test/gtest/scopes/Runtime/Runtime_test.cpp 2014-05-08 12:06:13 +0000
@@ -382,22 +382,22 @@
382 this_thread::sleep_for(chrono::milliseconds(200));382 this_thread::sleep_for(chrono::milliseconds(200));
383}383}
384384
385void scope_thread(Runtime::SPtr const& rt)385void scope_thread(Runtime::SPtr const& rt, string const& runtime_ini_file)
386{386{
387 TestScope scope;387 TestScope scope;
388 rt->run_scope(&scope, "/foo");388 rt->run_scope(&scope, runtime_ini_file, "/foo");
389}389}
390390
391void pusher_thread(Runtime::SPtr const& rt)391void pusher_thread(Runtime::SPtr const& rt, string const& runtime_ini_file)
392{392{
393 PusherScope scope;393 PusherScope scope;
394 rt->run_scope(&scope, "/foo");394 rt->run_scope(&scope, runtime_ini_file, "/foo");
395}395}
396396
397void slow_create_thread(Runtime::SPtr const& rt)397void slow_create_thread(Runtime::SPtr const& rt, string const& runtime_ini_file)
398{398{
399 SlowCreateScope scope;399 SlowCreateScope scope;
400 rt->run_scope(&scope, "/foo");400 rt->run_scope(&scope, runtime_ini_file, "/foo");
401}401}
402402
403int main(int argc, char **argv)403int main(int argc, char **argv)
@@ -405,13 +405,13 @@
405 ::testing::InitGoogleTest(&argc, argv);405 ::testing::InitGoogleTest(&argc, argv);
406406
407 Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini"));407 Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini"));
408 std::thread scope_t(scope_thread, srt);408 std::thread scope_t(scope_thread, srt, "Runtime.ini");
409409
410 Runtime::SPtr prt = move(Runtime::create_scope_runtime("PusherScope", "Runtime.ini"));410 Runtime::SPtr prt = move(Runtime::create_scope_runtime("PusherScope", "Runtime.ini"));
411 std::thread pusher_t(pusher_thread, prt);411 std::thread pusher_t(pusher_thread, prt, "Runtime.ini");
412412
413 Runtime::SPtr scrt = move(Runtime::create_scope_runtime("SlowCreateScope", "Runtime.ini"));413 Runtime::SPtr scrt = move(Runtime::create_scope_runtime("SlowCreateScope", "Runtime.ini"));
414 std::thread slow_create_t(slow_create_thread, scrt);414 std::thread slow_create_t(slow_create_thread, scrt, "Runtime.ini");
415415
416 // Give threads some time to bind to their endpoints, to avoid getting ObjectNotExistException416 // Give threads some time to bind to their endpoints, to avoid getting ObjectNotExistException
417 // from a synchronous remote call.417 // from a synchronous remote call.
418418
=== modified file 'test/gtest/scopes/Runtime/Zmq.ini.in'
--- test/gtest/scopes/Runtime/Zmq.ini.in 2013-11-29 12:20:25 +0000
+++ test/gtest/scopes/Runtime/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp'
--- test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-05-08 07:25:37 +0000
+++ test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-05-08 12:06:13 +0000
@@ -22,6 +22,8 @@
2222
23#include <gtest/gtest.h>23#include <gtest/gtest.h>
2424
25#include <scope-api-testconfig.h>
26
25using namespace std;27using namespace std;
26using namespace unity;28using namespace unity;
27using namespace unity::scopes;29using namespace unity::scopes;
@@ -41,22 +43,25 @@
41 }43 }
42};44};
4345
46const string TEST_DIR = string(TEST_BUILD_ROOT) + "/gtest/scopes/internal/ConfigBase";
47const string TEST_INI = TEST_DIR + "/Test.ini";
48
44TEST(ConfigBase, basic)49TEST(ConfigBase, basic)
45{50{
46 MyConfig c("Test.ini");51 MyConfig c(TEST_INI);
47 EXPECT_TRUE(c.parser().get());52 EXPECT_TRUE(c.parser().get());
48}53}
4954
50TEST(ConfigBase, optional_string)55TEST(ConfigBase, optional_string)
51{56{
52 MyConfig c("Test.ini");57 MyConfig c(TEST_INI);
53 EXPECT_EQ("", c.get_optional_string("SomeGroup", "NoSuchKey"));58 EXPECT_EQ("", c.get_optional_string("SomeGroup", "NoSuchKey"));
54 EXPECT_EQ("", c.get_optional_string("SomeGroup", "Empty"));59 EXPECT_EQ("", c.get_optional_string("SomeGroup", "Empty"));
55}60}
5661
57TEST(ConfigBase, non_optional_string)62TEST(ConfigBase, non_optional_string)
58{63{
59 MyConfig c("Test.ini");64 MyConfig c(TEST_INI);
60 try65 try
61 {66 {
62 c.get_string("SomeGroup", "Empty");67 c.get_string("SomeGroup", "Empty");
@@ -64,13 +69,13 @@
64 }69 }
65 catch (ConfigException const& e)70 catch (ConfigException const& e)
66 {71 {
67 EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal empty value for Empty", e.what());72 EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": Illegal empty value for Empty", e.what());
68 }73 }
69}74}
7075
71TEST(ConfigBase, middleware)76TEST(ConfigBase, middleware)
72{77{
73 MyConfig c("Test.ini");78 MyConfig c(TEST_INI);
74 EXPECT_EQ("Zmq", c.get_middleware("SomeGroup", "Zmq.Middleware"));79 EXPECT_EQ("Zmq", c.get_middleware("SomeGroup", "Zmq.Middleware"));
75 EXPECT_EQ("REST", c.get_middleware("SomeGroup", "REST.Middleware"));80 EXPECT_EQ("REST", c.get_middleware("SomeGroup", "REST.Middleware"));
76 try81 try
@@ -80,9 +85,9 @@
80 }85 }
81 catch (ConfigException const& e)86 catch (ConfigException const& e)
82 {87 {
83 EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for Zmq.BadMiddleware: \"foo\": "88 EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": Illegal value for Zmq.BadMiddleware: \"foo\": "
84 "legal values are \"Zmq\" and \"REST\"",89 "legal values are \"Zmq\" and \"REST\"",
85 e.what());90 e.what());
86 }91 }
87 try92 try
88 {93 {
@@ -91,15 +96,15 @@
91 }96 }
92 catch (ConfigException const& e)97 catch (ConfigException const& e)
93 {98 {
94 EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for REST.BadMiddleware: \"bar\": "99 EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": Illegal value for REST.BadMiddleware: \"bar\": "
95 "legal values are \"Zmq\" and \"REST\"",100 "legal values are \"Zmq\" and \"REST\"",
96 e.what());101 e.what());
97 }102 }
98}103}
99104
100TEST(ConfigBase, throw_ex)105TEST(ConfigBase, throw_ex)
101{106{
102 MyConfig c("Test.ini");107 MyConfig c(TEST_INI);
103 EXPECT_TRUE(c.parser().get());108 EXPECT_TRUE(c.parser().get());
104109
105 try110 try
@@ -108,7 +113,7 @@
108 }113 }
109 catch (ConfigException const& e)114 catch (ConfigException const& e)
110 {115 {
111 EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": error", e.what());116 EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": error", e.what());
112 }117 }
113}118}
114119
@@ -116,11 +121,22 @@
116{121{
117 try122 try
118 {123 {
119 MyConfig c("no_such_file");124 MyConfig c("wrong_extension.x");
125 }
126 catch (ConfigException const& e)
127 {
128 EXPECT_STREQ("unity::scopes::ConfigException: invalid config file name: \"wrong_extension.x\": "
129 "missing .ini extension",
130 e.what());
131 }
132
133 try
134 {
135 MyConfig c("no_such_file.ini");
120 }136 }
121 catch (FileException const& e)137 catch (FileException const& e)
122 {138 {
123 EXPECT_STREQ("unity::FileException: Could not load ini file no_such_file: No such file or directory (errno = 4)",139 EXPECT_STREQ("unity::FileException: Could not load ini file no_such_file.ini: No such file or directory (errno = 4)",
124 e.what());140 e.what());
125 }141 }
126}142}
127143
=== modified file 'test/gtest/scopes/internal/RegistryConfig/Registry.ini.in'
--- test/gtest/scopes/internal/RegistryConfig/Registry.ini.in 2014-05-08 07:25:37 +0000
+++ test/gtest/scopes/internal/RegistryConfig/Registry.ini.in 2014-05-08 12:06:13 +0000
@@ -1,7 +1,5 @@
1[Registry]1[Registry]
2Middleware = Zmq2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/socket_for_registry
4Zmq.EndpointDir = /tmp/socket_for_registry
5Zmq.ConfigFile = Zmq.ini3Zmq.ConfigFile = Zmq.ini
6Scope.InstallDir = /SomeDir4Scope.InstallDir = /SomeDir
7Scoperunner.Path = /SomeAbsolutePath5Scoperunner.Path = /SomeAbsolutePath
86
=== modified file 'test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp'
--- test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-05-08 07:25:37 +0000
+++ test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-05-08 12:06:13 +0000
@@ -33,7 +33,6 @@
33 RegistryConfig c("Registry", TEST_REGISTRY_PATH);33 RegistryConfig c("Registry", TEST_REGISTRY_PATH);
34 EXPECT_EQ("Registry", c.identity());34 EXPECT_EQ("Registry", c.identity());
35 EXPECT_EQ("Zmq", c.mw_kind());35 EXPECT_EQ("Zmq", c.mw_kind());
36 EXPECT_EQ("ipc:///tmp/socket_for_registry", c.endpoint());
37 EXPECT_EQ("Zmq.ini", c.mw_configfile());36 EXPECT_EQ("Zmq.ini", c.mw_configfile());
38}37}
3938
4039
=== modified file 'test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in'
--- test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in 2013-11-19 02:51:46 +0000
+++ test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in 2014-05-08 12:06:13 +0000
@@ -1,7 +1,6 @@
1[Registry]1[Registry]
2Middleware = Zmq2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/socket_for_registry3Zmq.Endpoint = ipc:///tmp/socket_for_registry
4Zmq.EndpointDir = /tmp/socket_for_registry
5Zmq.ConfigFile = Zmq.ini4Zmq.ConfigFile = Zmq.ini
6Scope.InstallDir = /SomeDir5Scope.InstallDir = /SomeDir
7Scoperunner.Path = SomeRelativePath6Scoperunner.Path = SomeRelativePath
87
=== modified file 'test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in'
--- test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in 2014-04-08 08:26:44 +0000
+++ test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in 2014-05-08 12:06:13 +0000
@@ -1,7 +1,5 @@
1[Registry]1[Registry]
2Middleware = Zmq2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/socket_for_registry
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = Zmq.ini3Zmq.ConfigFile = Zmq.ini
6Scope.InstallDir = /unused4Scope.InstallDir = /unused
7Click.InstallDir = /unused5Click.InstallDir = /unused
86
=== modified file 'test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in'
--- test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in 2014-02-24 14:56:26 +0000
+++ test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp'
--- test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-02-05 13:08:06 +0000
+++ test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-05-08 12:06:13 +0000
@@ -35,35 +35,6 @@
35 EXPECT_EQ("Zmq", c.default_middleware());35 EXPECT_EQ("Zmq", c.default_middleware());
36}36}
3737
38TEST(RuntimeConfig, BadRegistryID)
39{
40 try
41 {
42 RuntimeConfig c("BadRegID.ini");
43 FAIL();
44 }
45 catch (ConfigException const& e)
46 {
47 EXPECT_STREQ("unity::scopes::ConfigException: \"BadRegID.ini\": Illegal character in value for "
48 "Registry.Identity: \"Regi/stry\": identity cannot contain '/'",
49 e.what());
50 }
51}
52
53TEST(RuntimeConfig, MiddlewareEmpty)
54{
55 try
56 {
57 RuntimeConfig c("MWEmpty.ini");
58 FAIL();
59 }
60 catch (ConfigException const& e)
61 {
62 EXPECT_STREQ("unity::scopes::ConfigException: \"MWEmpty.ini\": Illegal empty value for Default.Middleware",
63 e.what());
64 }
65}
66
67TEST(RuntimeConfig, BadMiddleware)38TEST(RuntimeConfig, BadMiddleware)
68{39{
69 try40 try
7041
=== modified file 'test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in'
--- test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in 2014-04-08 08:26:44 +0000
+++ test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in 2014-05-08 12:06:13 +0000
@@ -1,9 +1,7 @@
1[Registry]1[Registry]
2Middleware = Zmq2Middleware = Zmq
3Zmq.Endpoint = ipc:///tmp/socket_for_registry
4Zmq.EndpointDir = /tmp
5Zmq.ConfigFile = Zmq.ini3Zmq.ConfigFile = Zmq.ini
6Scoperunner.Path = /SomePath4Scoperunner.Path = /SomePath
7Scope.ConfigDir = /tmp5Scope.InstallDir = /tmp
8Scope.InstallDir = /tmp6Scope.InstallDir = /tmp
9Click.InstallDir = /unused7Click.InstallDir = /unused
108
=== modified file 'test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in'
--- test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in 2013-11-29 12:20:25 +0000
+++ test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp'
--- test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-04-15 04:53:44 +0000
+++ test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-05-08 12:06:13 +0000
@@ -37,7 +37,7 @@
37TEST(ScopeMetadataImpl, basic)37TEST(ScopeMetadataImpl, basic)
38{38{
39 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");39 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
40 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get());40 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini");
4141
42 unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw));42 unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw));
43 mi->set_scope_id("scope_id");43 mi->set_scope_id("scope_id");
@@ -231,7 +231,7 @@
231TEST(ScopeMetadataImpl, serialize)231TEST(ScopeMetadataImpl, serialize)
232{232{
233 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");233 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
234 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get());234 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini");
235235
236 unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw));236 unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw));
237 mi->set_scope_id("scope_id");237 mi->set_scope_id("scope_id");
@@ -280,7 +280,7 @@
280TEST(ScopeMetadataImpl, serialize_exceptions)280TEST(ScopeMetadataImpl, serialize_exceptions)
281{281{
282 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");282 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
283 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get());283 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini");
284284
285 ScopeMetadataImpl mi(&mw);285 ScopeMetadataImpl mi(&mw);
286 try286 try
@@ -347,7 +347,7 @@
347TEST(ScopeMetadataImpl, deserialize_exceptions)347TEST(ScopeMetadataImpl, deserialize_exceptions)
348{348{
349 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");349 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
350 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get());350 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini");
351351
352 VariantMap m;352 VariantMap m;
353 try353 try
354354
=== modified file 'test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in'
--- test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in 2013-11-28 00:27:48 +0000
+++ test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in'
--- test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in 2014-02-04 12:31:29 +0000
+++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in 2014-05-08 12:06:13 +0000
@@ -1,10 +1,5 @@
1[Runtime]
2Registry.Identity = SSRegistryTest
3
4[Registry]1[Registry]
5Middleware = Zmq2Middleware = Zmq
6Zmq.Endpoint = ipc:///tmp/SSRegistryTest
7Zmq.EndpointDir = /tmp
8Zmq.ConfigFile = Zmq.ini3Zmq.ConfigFile = Zmq.ini
9Scope.InstallDir = /tmp4Scope.InstallDir = /tmp
10Scoperunner.Path = /tmp5Scoperunner.Path = /tmp
116
=== modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in'
--- test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in 2014-01-17 09:59:38 +0000
+++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp'
--- test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2014-04-16 07:04:34 +0000
+++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2014-05-08 12:06:13 +0000
@@ -61,12 +61,14 @@
61 std::string mw_kind = reg_conf.mw_kind();61 std::string mw_kind = reg_conf.mw_kind();
62 std::string mw_configfile = reg_conf.mw_configfile();62 std::string mw_configfile = reg_conf.mw_configfile();
6363
64 SSConfig ss_config(reg_rt_->ss_configfile());
65
64 // Get middleware handles from runtimes66 // Get middleware handles from runtimes
65 reg_mw_ = reg_rt_->factory()->find(reg_id_, mw_kind);67 reg_mw_ = reg_rt_->factory()->find(reg_id_, mw_kind);
66 scope_mw_ = scope_rt_->factory()->create(scope_id_, mw_kind, mw_configfile);68 scope_mw_ = scope_rt_->factory()->create(scope_id_, mw_kind, mw_configfile);
6769
68 // Instantiate a SS registry and scope objects70 // Instantiate a SS registry and scope objects
69 reg_ = SSRegistryObject::SPtr(new SSRegistryObject(reg_mw_, scope_mw_->get_scope_endpoint(), 20000, 60,71 reg_ = SSRegistryObject::SPtr(new SSRegistryObject(reg_mw_, ss_config, scope_mw_->get_scope_endpoint(),
70 "http://127.0.0.1:" + std::to_string(server_.port_), false));72 "http://127.0.0.1:" + std::to_string(server_.port_), false));
71 scope_ = SSScopeObject::UPtr(new SSScopeObject(scope_id_, scope_mw_, reg_));73 scope_ = SSScopeObject::UPtr(new SSScopeObject(scope_id_, scope_mw_, reg_));
7274
@@ -119,7 +121,7 @@
119 EXPECT_THROW(reg_->get_metadata("dummy.scope.3"), NotFoundException);121 EXPECT_THROW(reg_->get_metadata("dummy.scope.3"), NotFoundException);
120122
121 // locate should throw (via mw)123 // locate should throw (via mw)
122 MWRegistryProxy mw_reg = reg_mw_->create_registry_proxy(reg_id_, reg_mw_->get_scope_endpoint());124 MWRegistryProxy mw_reg = reg_mw_->registry_proxy();
123 EXPECT_THROW(mw_reg->locate("Dummy Demo Scope"), RegistryException);125 EXPECT_THROW(mw_reg->locate("Dummy Demo Scope"), RegistryException);
124126
125 // list scopes (via mw)127 // list scopes (via mw)
126128
=== modified file 'test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp'
--- test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-04-28 06:24:24 +0000
+++ test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-05-08 12:06:13 +0000
@@ -18,6 +18,7 @@
1818
19#include <unity/scopes/internal/zmq_middleware/ObjectAdapter.h>19#include <unity/scopes/internal/zmq_middleware/ObjectAdapter.h>
2020
21#include <scope-api-testconfig.h>
21#include <scopes/internal/zmq_middleware/capnproto/Message.capnp.h>22#include <scopes/internal/zmq_middleware/capnproto/Message.capnp.h>
22#include <unity/scopes/internal/RuntimeImpl.h>23#include <unity/scopes/internal/RuntimeImpl.h>
23#include <unity/scopes/internal/zmq_middleware/ServantBase.h>24#include <unity/scopes/internal/zmq_middleware/ServantBase.h>
@@ -31,7 +32,6 @@
31#include <boost/regex.hpp> // Use Boost implementation until http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631 is fixed.32#include <boost/regex.hpp> // Use Boost implementation until http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631 is fixed.
32#include <capnp/serialize.h>33#include <capnp/serialize.h>
33#include <gtest/gtest.h>34#include <gtest/gtest.h>
34#include <scope-api-testconfig.h>
3535
36using namespace std;36using namespace std;
37using namespace unity;37using namespace unity;
@@ -54,8 +54,8 @@
5454
55TEST(ObjectAdapter, basic)55TEST(ObjectAdapter, basic)
56{56{
57 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",57 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
58 (RuntimeImpl*)0x1);58 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
5959
60 // Instantiate and destroy oneway and twoway adapters with single and multiple threads.60 // Instantiate and destroy oneway and twoway adapters with single and multiple threads.
61 {61 {
@@ -133,8 +133,8 @@
133133
134TEST(ObjectAdapter, state_change)134TEST(ObjectAdapter, state_change)
135{135{
136 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",136 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
137 (RuntimeImpl*)0x1);137 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
138138
139 {139 {
140 wait();140 wait();
@@ -228,8 +228,8 @@
228228
229TEST(ObjectAdapter, wait_for_shutdown)229TEST(ObjectAdapter, wait_for_shutdown)
230{230{
231 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",231 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
232 (RuntimeImpl*)0x1);232 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
233233
234 // Start the adapter and call shutdown() from a different thread after a delay, and wait for the234 // Start the adapter and call shutdown() from a different thread after a delay, and wait for the
235 // shutdown to complete. We check that the shutdown happens after at least the delay that was specified,235 // shutdown to complete. We check that the shutdown happens after at least the delay that was specified,
@@ -276,7 +276,7 @@
276TEST(ObjectAdapter, add_remove_find)276TEST(ObjectAdapter, add_remove_find)
277{277{
278 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");278 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
279 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get());279 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
280280
281 wait();281 wait();
282 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 5);282 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 5);
@@ -337,8 +337,8 @@
337337
338TEST(ObjectAdapter, dispatch_oneway_to_twoway)338TEST(ObjectAdapter, dispatch_oneway_to_twoway)
339{339{
340 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",340 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
341 (RuntimeImpl*)0x1);341 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
342342
343 wait();343 wait();
344 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);344 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
@@ -373,8 +373,8 @@
373373
374TEST(ObjectAdapter, dispatch_twoway_to_oneway)374TEST(ObjectAdapter, dispatch_twoway_to_oneway)
375{375{
376 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",376 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
377 (RuntimeImpl*)0x1);377 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
378378
379 wait();379 wait();
380 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Oneway, 1);380 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Oneway, 1);
@@ -400,8 +400,8 @@
400400
401TEST(ObjectAdapter, dispatch_not_exist)401TEST(ObjectAdapter, dispatch_not_exist)
402{402{
403 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",403 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
404 (RuntimeImpl*)0x1);404 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
405405
406 wait();406 wait();
407 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);407 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
@@ -442,8 +442,8 @@
442442
443TEST(ObjectAdapter, bad_header)443TEST(ObjectAdapter, bad_header)
444{444{
445 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",445 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
446 (RuntimeImpl*)0x1);446 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
447447
448 {448 {
449 wait();449 wait();
@@ -503,8 +503,8 @@
503503
504TEST(ObjectAdapter, corrupt_header)504TEST(ObjectAdapter, corrupt_header)
505{505{
506 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",506 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
507 (RuntimeImpl*)0x1);507 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
508508
509 {509 {
510 wait();510 wait();
@@ -563,7 +563,7 @@
563TEST(ObjectAdapter, invoke_ok)563TEST(ObjectAdapter, invoke_ok)
564{564{
565 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");565 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
566 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get());566 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
567567
568 wait();568 wait();
569 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);569 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
@@ -615,7 +615,7 @@
615TEST(ObjectAdapter, invoke_object_not_exist)615TEST(ObjectAdapter, invoke_object_not_exist)
616{616{
617 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");617 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
618 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get());618 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
619619
620 wait();620 wait();
621 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);621 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
@@ -660,7 +660,7 @@
660TEST(ObjectAdapter, invoke_operation_not_exist)660TEST(ObjectAdapter, invoke_operation_not_exist)
661{661{
662 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");662 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
663 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get());663 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
664664
665 wait();665 wait();
666 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);666 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
@@ -780,7 +780,7 @@
780TEST(ObjectAdapter, twoway_threading)780TEST(ObjectAdapter, twoway_threading)
781{781{
782 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");782 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
783 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get());783 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
784784
785 // Single servant to which we send requests concurrently.785 // Single servant to which we send requests concurrently.
786 shared_ptr<CountingServant> o(new CountingServant(100));786 shared_ptr<CountingServant> o(new CountingServant(100));
@@ -814,7 +814,7 @@
814TEST(ObjectAdapter, oneway_threading)814TEST(ObjectAdapter, oneway_threading)
815{815{
816 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");816 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
817 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get());817 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
818818
819 // Single servant to which we send requests concurrently.819 // Single servant to which we send requests concurrently.
820 shared_ptr<CountingServant> o(new CountingServant(100));820 shared_ptr<CountingServant> o(new CountingServant(100));
@@ -885,7 +885,7 @@
885TEST(ObjectAdapter, servant_map_destructor)885TEST(ObjectAdapter, servant_map_destructor)
886{886{
887 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");887 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
888 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get());888 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
889889
890 {890 {
891 wait();891 wait();
@@ -1056,8 +1056,9 @@
10561056
1057 wait(200); // Give zmq some time to finish the bind.1057 wait(200); // Give zmq some time to finish the bind.
10581058
1059 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",1059 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
1060 (RuntimeImpl*)0x1);1060 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
1061
1061 wait();1062 wait();
1062 try1063 try
1063 {1064 {
@@ -1093,8 +1094,8 @@
10931094
1094 wait(200); // Give zmq some time to finish the bind.1095 wait(200); // Give zmq some time to finish the bind.
10951096
1096 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",1097 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
1097 (RuntimeImpl*)0x1);1098 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
1098 wait();1099 wait();
1099 try1100 try
1100 {1101 {
@@ -1122,8 +1123,8 @@
11221123
1123TEST(ObjectAdapter, dflt_servant)1124TEST(ObjectAdapter, dflt_servant)
1124{1125{
1125 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",1126 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
1126 (RuntimeImpl*)0x1);1127 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
11271128
1128 wait();1129 wait();
1129 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);1130 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
@@ -1177,8 +1178,8 @@
11771178
1178TEST(ObjectAdapter, dflt_servant_exceptions)1179TEST(ObjectAdapter, dflt_servant_exceptions)
1179{1180{
1180 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini",1181 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
1181 (RuntimeImpl*)0x1);1182 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini");
11821183
1183 wait();1184 wait();
1184 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);1185 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
11851186
=== modified file 'test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in'
--- test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in 2013-11-28 00:27:48 +0000
+++ test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp'
--- test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-05-05 07:14:52 +0000
+++ test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-05-08 12:06:13 +0000
@@ -96,7 +96,6 @@
96 string identity = runtime->registry_identity();96 string identity = runtime->registry_identity();
97 RegistryConfig c(identity, runtime->registry_configfile());97 RegistryConfig c(identity, runtime->registry_configfile());
98 string mw_kind = c.mw_kind();98 string mw_kind = c.mw_kind();
99 string mw_endpoint = c.endpoint();
100 string mw_configfile = c.mw_configfile();99 string mw_configfile = c.mw_configfile();
101100
102 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);101 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);
@@ -120,7 +119,6 @@
120 string identity = runtime->registry_identity();119 string identity = runtime->registry_identity();
121 RegistryConfig c(identity, runtime->registry_configfile());120 RegistryConfig c(identity, runtime->registry_configfile());
122 string mw_kind = c.mw_kind();121 string mw_kind = c.mw_kind();
123 string mw_endpoint = c.endpoint();
124 string mw_configfile = c.mw_configfile();122 string mw_configfile = c.mw_configfile();
125123
126 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);124 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);
@@ -170,7 +168,6 @@
170 string identity = runtime->registry_identity();168 string identity = runtime->registry_identity();
171 RegistryConfig c(identity, runtime->registry_configfile());169 RegistryConfig c(identity, runtime->registry_configfile());
172 string mw_kind = c.mw_kind();170 string mw_kind = c.mw_kind();
173 string mw_endpoint = c.endpoint();
174 string mw_configfile = c.mw_configfile();171 string mw_configfile = c.mw_configfile();
175172
176 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);173 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);
@@ -223,7 +220,6 @@
223 string identity = runtime->registry_identity();220 string identity = runtime->registry_identity();
224 RegistryConfig c(identity, runtime->registry_configfile());221 RegistryConfig c(identity, runtime->registry_configfile());
225 string mw_kind = c.mw_kind();222 string mw_kind = c.mw_kind();
226 string mw_endpoint = c.endpoint();
227 string mw_configfile = c.mw_configfile();223 string mw_configfile = c.mw_configfile();
228224
229 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);225 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);
@@ -316,7 +312,6 @@
316 string identity = runtime->registry_identity();312 string identity = runtime->registry_identity();
317 RegistryConfig c(identity, runtime->registry_configfile());313 RegistryConfig c(identity, runtime->registry_configfile());
318 string mw_kind = c.mw_kind();314 string mw_kind = c.mw_kind();
319 string mw_endpoint = c.endpoint();
320 string mw_configfile = c.mw_configfile();315 string mw_configfile = c.mw_configfile();
321 RegistryObject::ScopeExecData dummy_exec_data;316 RegistryObject::ScopeExecData dummy_exec_data;
322317
@@ -500,7 +495,7 @@
500// test locating the same scope multiple times495// test locating the same scope multiple times
501TEST_F(RegistryTest, locate_one)496TEST_F(RegistryTest, locate_one)
502{497{
503 // locate all scopes (hense starting all scope processes)498 // locate all scopes (hence starting all scope processes)
504 for (auto const& scope_id : scope_ids)499 for (auto const& scope_id : scope_ids)
505 {500 {
506 EXPECT_EQ(proxies[scope_id], reg->locate(scope_id));501 EXPECT_EQ(proxies[scope_id], reg->locate(scope_id));
@@ -603,7 +598,7 @@
603// test removing a scope598// test removing a scope
604TEST_F(RegistryTest, locate_remove)599TEST_F(RegistryTest, locate_remove)
605{600{
606 // locate all scopes (hense starting all scope processes)601 // locate all scopes (hence starting all scope processes)
607 for (auto const& scope_id : scope_ids)602 for (auto const& scope_id : scope_ids)
608 {603 {
609 EXPECT_EQ(proxies[scope_id], reg->locate(scope_id));604 EXPECT_EQ(proxies[scope_id], reg->locate(scope_id));
@@ -612,7 +607,7 @@
612 // check that 6 new processes were started607 // check that 6 new processes were started
613 EXPECT_EQ(6, process_count());608 EXPECT_EQ(6, process_count());
614609
615 // remove a scope (hense killing the process)610 // remove a scope (hence killing the process)
616 EXPECT_TRUE(reg->remove_local_scope(scope_ids[0]));611 EXPECT_TRUE(reg->remove_local_scope(scope_ids[0]));
617612
618 // check that we now have 5 scopes running613 // check that we now have 5 scopes running
619614
=== modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in'
--- test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in 2014-03-17 06:45:44 +0000
+++ test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in 2014-05-08 12:06:13 +0000
@@ -1,10 +1,5 @@
1[Runtime]
2Registry.Identity = TestRegistry
3
4[Registry]1[Registry]
5Middleware = Zmq2Middleware = Zmq
6Zmq.Endpoint = ipc:///tmp/TestRegistry
7Zmq.EndpointDir = /tmp
8Zmq.ConfigFile = Zmq.ini3Zmq.ConfigFile = Zmq.ini
9Scope.InstallDir = /tmp4Scope.InstallDir = /tmp
10Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner5Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner
116
=== modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in'
--- test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in 2013-11-28 00:27:48 +0000
+++ test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp'
--- test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp 2014-01-22 03:29:48 +0000
+++ test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp 2014-05-08 12:06:13 +0000
@@ -93,8 +93,8 @@
9393
94TEST(ServantBase, success)94TEST(ServantBase, success)
95{95{
96 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini",96 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
97 (RuntimeImpl*)0x1);97 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini");
98 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);98 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
99 Current current;99 Current current;
100 current.op_name = "op";100 current.op_name = "op";
@@ -110,8 +110,8 @@
110110
111TEST(ServantBase, ping)111TEST(ServantBase, ping)
112{112{
113 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini",113 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
114 (RuntimeImpl*)0x1);114 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini");
115 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);115 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
116 Current current;116 Current current;
117 current.op_name = "ping";117 current.op_name = "ping";
@@ -127,8 +127,8 @@
127127
128TEST(ServantBase, exceptions)128TEST(ServantBase, exceptions)
129{129{
130 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini",130 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
131 (RuntimeImpl*)0x1);131 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini");
132 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);132 ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1);
133 Current current;133 Current current;
134 current.op_name = "op";134 current.op_name = "op";
135135
=== modified file 'test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in'
--- test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in 2013-11-28 00:27:48 +0000
+++ test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in'
--- test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in 2013-11-28 00:27:48 +0000
+++ test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in 2014-05-08 12:06:13 +0000
@@ -1,3 +1,2 @@
1[Zmq]1[Zmq]
2EndpointDir.Public = /tmp2EndpointDir = /tmp
3EndpointDir.Private = /tmp
43
=== modified file 'test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp'
--- test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp 2014-04-09 07:29:37 +0000
+++ test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp 2014-05-08 12:06:13 +0000
@@ -18,13 +18,13 @@
1818
19#include <unity/scopes/internal/zmq_middleware/ZmqMiddleware.h>19#include <unity/scopes/internal/zmq_middleware/ZmqMiddleware.h>
2020
21#include <scope-api-testconfig.h>
21#include <unity/scopes/internal/RuntimeImpl.h>22#include <unity/scopes/internal/RuntimeImpl.h>
22#include <unity/scopes/internal/MWObjectProxy.h>23#include <unity/scopes/internal/MWObjectProxy.h>
23#include <unity/scopes/internal/zmq_middleware/ZmqObjectProxy.h>24#include <unity/scopes/internal/zmq_middleware/ZmqObjectProxy.h>
24#include <unity/scopes/ScopeExceptions.h>25#include <unity/scopes/ScopeExceptions.h>
2526
26#include <gtest/gtest.h>27#include <gtest/gtest.h>
27#include <scope-api-testconfig.h>
2828
29using namespace std;29using namespace std;
30using namespace unity::scopes;30using namespace unity::scopes;
@@ -35,9 +35,8 @@
3535
36TEST(ZmqMiddleware, basic)36TEST(ZmqMiddleware, basic)
37{37{
38 ZmqMiddleware mw("testscope",38 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
39 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini",39 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini");
40 (RuntimeImpl*)0x1);
41 mw.start();40 mw.start();
42 sleep(1);41 sleep(1);
43 mw.stop();42 mw.stop();
@@ -46,7 +45,7 @@
46TEST(ZmqMiddleware, string_to_proxy)45TEST(ZmqMiddleware, string_to_proxy)
47{46{
48 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");47 auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini");
49 ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini", rt.get());48 ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini");
5049
51 ObjectProxy p;50 ObjectProxy p;
52 ScopeProxy sp;51 ScopeProxy sp;
@@ -84,9 +83,8 @@
8483
85TEST(ZmqMiddleware, string_to_proxy_ex)84TEST(ZmqMiddleware, string_to_proxy_ex)
86{85{
87 ZmqMiddleware mw("testscope",86 ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1,
88 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini",87 TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini");
89 (RuntimeImpl*)0x1);
9088
91 try89 try
92 {90 {
9391
=== modified file 'test/whitespace/check_whitespace.py'
--- test/whitespace/check_whitespace.py 2014-04-04 07:34:33 +0000
+++ test/whitespace/check_whitespace.py 2014-05-08 12:06:13 +0000
@@ -60,7 +60,7 @@
60 for lino, line in enumerate(ifile, start=1):60 for lino, line in enumerate(ifile, start=1):
61 if whitespace_pat.match(line) or tab_indent_pat.match(line):61 if whitespace_pat.match(line) or tab_indent_pat.match(line):
62 errors.append(lino)62 errors.append(lino)
63 if line == "\n":63 if line == "\n" and lino != 1: # Don't complain about empty file with only a single line
64 newlines_at_end += 164 newlines_at_end += 1
65 else:65 else:
66 newlines_at_end = 066 newlines_at_end = 0
6767
=== modified file 'unity-scopes.map'
--- unity-scopes.map 2014-04-10 14:39:05 +0000
+++ unity-scopes.map 2014-05-08 12:06:13 +0000
@@ -20,6 +20,7 @@
20 unity::scopes::internal::ScopeMetadataImpl::*;20 unity::scopes::internal::ScopeMetadataImpl::*;
21 unity::scopes::internal::ScopeObject::*;21 unity::scopes::internal::ScopeObject::*;
22 unity::scopes::internal::StateReceiverObject::*;22 unity::scopes::internal::StateReceiverObject::*;
23 unity::scopes::internal::smartscopes::SSConfig::*;
23 unity::scopes::internal::smartscopes::SSRegistryObject::*;24 unity::scopes::internal::smartscopes::SSRegistryObject::*;
24 unity::scopes::internal::smartscopes::SSScopeObject::*;25 unity::scopes::internal::smartscopes::SSScopeObject::*;
25 };26 };

Subscribers

People subscribed via source and target branches

to all changes: