Merge lp:~michihenning/unity-scopes-api/config-fixes into lp:unity-scopes-api/devel
- config-fixes
- Merge into devel
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 | ||||||||
Related bugs: |
|
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.
PS Jenkins bot (ps-jenkins) wrote : | # |
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.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:304
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:306
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
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/
77 + The default value is "$XDG_RUNTIME_
78 + set, "/run/user/
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_
116 + The default value is "@CMAKE_
Arch-specific binaries can't go into /usr/share/ (and SCOPES_
121 + by OEMs. The default value is "@CMAKE_
Shouldn't this be without the CMAKE_INSTALL_
126 + The defaul value is "$HOME/
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_SCOPERUNNE
478..484
Please keep in sync with the default config files.
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/
I agree. It's /usr/lib/
> 77 + The default value is "$XDG_RUNTIME_
> XDG_RUNTIME_DIR is not
> 78 + set, "/run/user/
>
> 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_
Fixed.
> 111 + The default value is
> "@CMAKE_
> 116 + The default value is
> "@CMAKE_
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_
> == /usr/share/
> to @CMAKE_
> @CMAKE_
>
> 121 + by OEMs. The default value is
> "@CMAKE_
>
> Shouldn't this be without the CMAKE_INSTALL_
>
> 126 + The defaul value is "$HOME/
>
> 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_SCOPERUNNE
> "@CMAKE_
> 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.
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.
Michi Henning (michihenning) wrote : | # |
No, all it means is that we now have /usr/share/
The scopes are installed in /usr/lib/
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:310
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:311
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michal Hruby (mhr3) wrote : | # |
> No, all it means is that we now have /usr/share/
> /usr/share/
> which is consistent with the /usr/share naming.
>
> The scopes are installed in /usr/lib/
> subdirectory for them.
In that case I have to NACK that, all the scopes are already installing in /usr/lib/
Otherwise the rest is looking good to me.
Michi Henning (michihenning) wrote : | # |
> In that case I have to NACK that, all the scopes are already installing in
> /usr/lib/
> one of them (again!) and change their install location. (same for scopes in
> /custom).
Yes, fair enough, I've changed that.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:312
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:313
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Marcus Tomlinson (marcustomlinson) wrote : | # |
Together with the few changes made to RegistryObject, I'm happy to approve.
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.
Michal Hruby (mhr3) : | # |
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::
- if (path.extension() != ".ini")
+ if (configfile.
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/
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.)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:315
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Marcus Tomlinson (marcustomlinson) wrote : | # |
Ok, I will re-review the latest changes. (Setting to "Needs Fixing" to remove the "Approve")
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:316
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Marcus Tomlinson (marcustomlinson) wrote : | # |
1447 +// For example, if a config file contains "Smartscopes.
1448 +// of "SS.Registry.
This should read: '"Smartscopes.
1298 - RuntimeImpl::UPtr reg_rt = RuntimeImpl:
1299 + RuntimeImpl::UPtr reg_rt = RuntimeImpl:
This change breaks the smart scopes proxy. As reg_rt-
To fix this, smartscopesprox
from: "reg_mw-
to: "reg_mw-
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:317
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michi Henning (michihenning) wrote : | # |
> This should read: '"Smartscopes.
> "Smartscopes.
>
> [...]
>
> To fix this, smartscopesprox
> from: "reg_mw-
> to: "reg_mw-
Thanks heaps for that! I just pushed those changes.
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/
>
> 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 :)
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… ;-)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:318
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Marcus Tomlinson (marcustomlinson) wrote : | # |
> Thanks heaps for that! I just pushed those changes.
Ah cool, thanks! Looks good to me too :)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Marcus Tomlinson (marcustomlinson) wrote : | # |
> FAILED: Autolanding.
ahhhh...
- 319. By Michi Henning
-
Merged devel and resolved conflict.
Michi Henning (michihenning) wrote : | # |
> ahhhh...
There always is something…
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:319
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michi Henning (michihenning) wrote : | # |
Another beer…
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2014-05-02 13:26:56 +0000 |
3 | +++ CMakeLists.txt 2014-05-08 12:06:13 +0000 |
4 | @@ -171,18 +171,18 @@ |
5 | add_definitions(-DENABLE_IPC_MONITOR) |
6 | endif() |
7 | |
8 | -set(SCOPES_DEFAULT_CONFIGDIR ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT}) |
9 | +# Scopes library name. Also used as a prefix in various places, and as a subdirectory |
10 | +# name for installed files. Changing this will also require corresponding changes |
11 | +# to the debian files. |
12 | +set(UNITY_SCOPES_LIB unity-scopes) |
13 | |
14 | # API version |
15 | set(UNITY_SCOPES_MAJOR 0) |
16 | set(UNITY_SCOPES_MINOR 4) |
17 | set(UNITY_SCOPES_MICRO 4) |
18 | |
19 | -# Scopes library |
20 | -set(UNITY_SCOPES_LIB unity-scopes) |
21 | - |
22 | # Version for testing, with all symbols visible |
23 | -set(UNITY_SCOPES_TEST_LIB unity-scopes-test) |
24 | +set(UNITY_SCOPES_TEST_LIB ${UNITY_SCOPES_LIB}-test) |
25 | |
26 | pkg_check_modules(JSONCPP jsoncpp REQUIRED) |
27 | |
28 | @@ -243,9 +243,10 @@ |
29 | |
30 | # Library install prefix |
31 | set(LIB_INSTALL_PREFIX lib/${CMAKE_LIBRARY_ARCHITECTURE}) |
32 | - |
33 | set(LIBDIR ${CMAKE_INSTALL_LIBDIR}) |
34 | -set(HDR_INSTALL_DIR include/unity-scopes-${UNITY_SCOPES_MAJOR}) |
35 | + |
36 | +set(LIBSUBDIR ${LIBDIR}/${UNITY_SCOPES_LIB}}) |
37 | +set(HDR_INSTALL_DIR include/${UNITY_SCOPES_LIB}-${UNITY_SCOPES_MAJOR}) |
38 | |
39 | # Tests |
40 | include(CTest) |
41 | @@ -344,7 +345,7 @@ |
42 | # out all symbols that (recursively) are in the unity::scopes::internal namespace, |
43 | # except for a few exceptions that are needed by the scoperegistry, scoperunner, |
44 | # smartscopesproxy, and any other binaries that reach into the internal namespace. |
45 | -set(symbol_map "${CMAKE_SOURCE_DIR}/unity-scopes.map") |
46 | +set(symbol_map "${CMAKE_SOURCE_DIR}/${UNITY_SCOPES_LIB}.map") |
47 | set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES |
48 | LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}") |
49 | set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES LINK_DEPENDS ${symbol_map}) |
50 | @@ -368,8 +369,6 @@ |
51 | |
52 | option(DEVEL_DOCS "Enable detailed Doxygen documentation") |
53 | |
54 | -set(CMAKE_INSTALL_DOCDIR doc) |
55 | - |
56 | find_package(Doxygen) |
57 | find_program(DOT_EXECUTABLE dot /usr/bin) |
58 | if (NOT DOXYGEN_FOUND OR NOT DOT_EXECUTABLE) |
59 | @@ -382,14 +381,14 @@ |
60 | configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_BINARY_DIR}/doc/Doxyfile @ONLY IMMEDIATE) |
61 | endif() |
62 | configure_file(${PROJECT_SOURCE_DIR}/doc/index.html ${PROJECT_BINARY_DIR}/doc/index.html COPYONLY) |
63 | - add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${PROJECT}/index.html |
64 | + add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB}/index.html |
65 | COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/Doxyfile |
66 | DEPENDS ${PROJECT_BINARY_DIR}/doc/Doxyfile |
67 | ${PROJECT_SOURCE_DIR}/doc/tutorial.dox |
68 | ${UNITY_SCOPES_LIB_SRC} |
69 | ${UNITY_SCOPES_LIB_HDRS}) |
70 | add_custom_target(doc ALL |
71 | - DEPENDS ${PROJECT_BINARY_DIR}/doc/${PROJECT}/index.html) |
72 | - install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/${PROJECT} |
73 | - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_INSTALL_DOCDIR}) |
74 | + DEPENDS ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB}/index.html) |
75 | + install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB} |
76 | + DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/doc) |
77 | endif() |
78 | |
79 | === added file 'CONFIGFILES' |
80 | --- CONFIGFILES 1970-01-01 00:00:00 +0000 |
81 | +++ CONFIGFILES 2014-05-08 12:06:13 +0000 |
82 | @@ -0,0 +1,208 @@ |
83 | +This document outlines how the scopes run time is configured. |
84 | +In general, if a recognized key is not set in a configuration |
85 | +file, a default value applies as detailed below. |
86 | + |
87 | +The following configuration files are used by the scopes run time: |
88 | + |
89 | + |
90 | +Runtime.ini |
91 | +----------- |
92 | + |
93 | +If no specific file is provided to the scopes run time, the default path is |
94 | +"/usr/lib/<arch>/unity-scopes/Runtime.ini". |
95 | + |
96 | +If that file does not exist, the default values apply. |
97 | + |
98 | +The only recognized group in this file is [Runtime]. |
99 | + |
100 | +The following keys are recognized: |
101 | + |
102 | +- Registry.Identity (string) |
103 | + |
104 | + The identity of the local registry. If not set, the default value is "Registry". |
105 | + To run a scope without a registry, for example, using the scoperunner for testing, the identity |
106 | + can be the empty string. |
107 | + |
108 | +- Registry.ConfigFile (string) |
109 | + |
110 | + The path to the registry configuration file. The default value is |
111 | + "/usr/lib/<arch>/unity-scopes/Registry.ini". |
112 | + |
113 | +- Smartscopes.Registry.Identity (string) |
114 | + |
115 | + The identity of the remote registry. If not set, the default value is "SSRegistry". |
116 | + Setting this value explicitly to the empty string disables use of the remote registry. |
117 | + |
118 | +- Smartscopes.ConfigFile (string) |
119 | + |
120 | + The path to the smartscopes configuration file. The default value is |
121 | + "/usr/lib/<arch>/unity-scopes/Smartscopes.ini". |
122 | + |
123 | +- Default.Middleware (string) |
124 | + |
125 | + The middleware to be used by default. The default value is "Zmq". |
126 | + |
127 | +- <middleware>.ConfigFile |
128 | + |
129 | + The path to the configuration file for the middleware, with the value of |
130 | + Default.Middleware substituted for <middleware>, For example, |
131 | + |
132 | + Zmq.ConfigFile = <path> |
133 | + |
134 | + The default value is "/usr/lib/<arch>/unity-scopes/Zmq.ini". |
135 | + |
136 | + |
137 | +Zmq.ini |
138 | +------- |
139 | + |
140 | +If no specific file is provided to the scopes run time, the default path is |
141 | +"/usr/lib/<arch>/unity-scopes/Zmq.ini". |
142 | + |
143 | +If that file does not exist, the default values for keys apply. |
144 | + |
145 | +The only recognized group in this file is [Zmq]. |
146 | + |
147 | +The following keys are recognized: |
148 | + |
149 | +- EndpointDir (string) |
150 | + |
151 | + The directory in which the public endpoint of a scope (or the registry) is created. |
152 | + This endpoint must be accessible to any process. |
153 | + |
154 | + The default value is "$XDG_RUNTIME_DIR/zmq". If XDG_RUNTIME_DIR is not |
155 | + set, initialization fails. |
156 | + |
157 | + Private endpoints are created in "<EndpointDir.Public>/priv". |
158 | + |
159 | + |
160 | +Registry.ini |
161 | +------------ |
162 | + |
163 | +If no specific file is provided to the scopes run time, the default path is |
164 | +"/usr/lib/<arch>/unity-scopes/Registry.ini". |
165 | + |
166 | +If that file does not exist, the default values for keys apply. |
167 | + |
168 | +The only recognized group in this file is [Registry]. |
169 | + |
170 | +The following keys are recognized: |
171 | + |
172 | +- Middleware |
173 | + |
174 | + The middleware used by the registry, such as "Zmq". The default value is "Zmq". |
175 | + |
176 | +- <Middleware>.ConfigFile |
177 | + |
178 | + <Middleware> must match the value of the Middleware key, for example: |
179 | + |
180 | + Zmq.Middleware = path/to/SomeFile.ini |
181 | + |
182 | +- Scoperunner.Path |
183 | + |
184 | + The path to the scoperunner executable. The path must be an absolute path. |
185 | + The default value is "/usr/lib/<arch>/scoperunner". |
186 | + |
187 | +- Scope.InstallDir |
188 | + |
189 | + The directory in which to look for subdirectories containing scope .so and .ini files. |
190 | + The default value is "/usr/lib/<arch>/unity-scopes". |
191 | + |
192 | +- OEM.InstallDir |
193 | + |
194 | + The directory in which to look for subdirectories containing scope .so and .ini files added |
195 | + by OEMs. The default value is "/custom/usr/lib/<arch>/unity-scopes". |
196 | + |
197 | +- Click.InstallDir |
198 | + |
199 | + The directory in which to look for subdirectories containing scopes installed from click packages. |
200 | + The default value is "$HOME/.local/share/unity-scopes". |
201 | + |
202 | + |
203 | +Smartscopes.ini |
204 | +-------------- |
205 | + |
206 | +If no specific file is provided to the scopes run time, the default path is |
207 | +"/usr/lib/<arch>/unity-scopes/Smartscopes.ini". |
208 | + |
209 | +If that file does not exist, the default values for keys apply. |
210 | + |
211 | +The only recognized group in this file is [Smartscopes]. |
212 | + |
213 | +The following keys are recognized: |
214 | + |
215 | +- Http.Reply.Timeout |
216 | + |
217 | + The amount of time (in seconds) to wait for a reply from the smartscopes server. |
218 | + |
219 | +- Registry.Refresh.Rate |
220 | + |
221 | + The amount of time (in seconds) between a metadata refresh from the smartscopes server. |
222 | + |
223 | +- Registry.Refresh.Fail.Timeout |
224 | + |
225 | + The amount of time (in seconds) in between retry attempts if a metadata refresh from |
226 | + the smartscopes server fails. |
227 | + |
228 | +- Scope.Identity |
229 | + |
230 | + The identity for proxy scope provided by smartscopesproxy. |
231 | + The default value is "SmartScope". |
232 | + |
233 | + |
234 | +<scope_id>.ini |
235 | +-------------- |
236 | + |
237 | +The recognized groups in this file are: |
238 | + |
239 | +- ScopeConfig |
240 | +- Appearance |
241 | + |
242 | +The following keys are recognized in the ScopeConfig group: |
243 | + |
244 | +- Override |
245 | + |
246 | + Determines whether an OEM scope is allowed to override a Canonical scope. This key is used only by Canonical |
247 | + scopes. If true, the Canonical scope can be replaced by an OEM scope with the same ID. The default value |
248 | + is false. |
249 | + |
250 | + For OEM scopes and click scopes, the setting of this key is ignored. |
251 | + |
252 | +- DisplayName |
253 | + |
254 | + The display name of a scope (mandatory, localizable). |
255 | + |
256 | +- Description |
257 | + |
258 | + The description of a scope (mandatory, localizable). |
259 | + |
260 | +- Author |
261 | + |
262 | + The author of the scope (mandatory). |
263 | + |
264 | +- Art |
265 | + |
266 | + Artwork to be shown for the scope. The default value is the empty string. |
267 | + |
268 | +- Icon |
269 | + |
270 | + The icon to be shown for the scope. The default value is the empty string. |
271 | + |
272 | +- SearchHint |
273 | + |
274 | + A search hint for on-screen display (localizable). The default value is the empty string. |
275 | + |
276 | +- HotKey |
277 | + |
278 | + The hot key for the scope. The default value is the empty string. |
279 | + |
280 | +- Invisible |
281 | + |
282 | + Whether the scope is hidden in the UI. The default value is false. |
283 | + |
284 | +- ScopeRunner |
285 | + |
286 | + The path to a custom scoperunner binary. If not set, the default scoperunner is used. |
287 | + |
288 | +The following keys are recognized in the Appearance group: |
289 | + |
290 | +- TODO: document this |
291 | |
292 | === modified file 'RELEASE_NOTES.md' |
293 | --- RELEASE_NOTES.md 2014-05-06 11:32:05 +0000 |
294 | +++ RELEASE_NOTES.md 2014-05-08 12:06:13 +0000 |
295 | @@ -3,8 +3,19 @@ |
296 | |
297 | Changes in version 0.4.4 |
298 | ======================== |
299 | - * The register_annotation() method of SearchReply is now deprecated - push(Annotation const&) should be used instead. |
300 | - The display order of annotations with respect to results and categories got updated in the documentation of that method. |
301 | + - The register_annotation() method of SearchReply is now deprecated - push(Annotation const&) should |
302 | + be used instead. The display order of annotations with respect to results and categories |
303 | + got updated in the documentation of that method. |
304 | + |
305 | + - Simplified configuration with sensible defaults for all values. |
306 | + |
307 | + - scoperunner, scoperegistry, and smartscopesproxy are now install in /usr/lib/<arch> |
308 | + (instead of in a subdirectory of <arch>). |
309 | + |
310 | + - Runtime::run_scope() now has an overload to accept a path to Runtime.ini. If no file name is passed, |
311 | + the system-wide Runtime.ini is used. |
312 | + |
313 | + - UNIX domain sockets for Zmq are now placed under /user/run/<uid>/zmq by default. |
314 | |
315 | Changes in version 0.4.2 |
316 | ======================== |
317 | |
318 | === modified file 'data/CMakeLists.txt' |
319 | --- data/CMakeLists.txt 2014-03-06 10:55:17 +0000 |
320 | +++ data/CMakeLists.txt 2014-05-08 12:06:13 +0000 |
321 | @@ -2,14 +2,6 @@ |
322 | configure_file(lib${UNITY_SCOPES_LIB}.pc.in lib${UNITY_SCOPES_LIB}.pc @ONLY) |
323 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${UNITY_SCOPES_LIB}.pc DESTINATION ${LIB_INSTALL_PREFIX}/pkgconfig) |
324 | |
325 | -# scope framework config files |
326 | -configure_file(Runtime.ini.in Runtime.ini @ONLY) |
327 | -configure_file(Registry.ini.in Registry.ini @ONLY) |
328 | -configure_file(Zmq.ini.in Zmq.ini @ONLY) |
329 | -configure_file(SSRuntime.ini.in SSRuntime.ini @ONLY) |
330 | -configure_file(SSRegistry.ini.in SSRegistry.ini @ONLY) |
331 | -install(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}) |
332 | - |
333 | # upstart job for smart scopes proxy |
334 | configure_file(smart-scopes-proxy.conf.in smart-scopes-proxy.conf @ONLY) |
335 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/smart-scopes-proxy.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions) |
336 | @@ -21,6 +13,6 @@ |
337 | # Empty directory for scopes to put their conf files into |
338 | # If we start install our own conf files here, this can be |
339 | # removed (installing files implicitly creates the subdirs) |
340 | -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes) |
341 | -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes |
342 | +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}) |
343 | +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB} |
344 | DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
345 | |
346 | === removed file 'data/Registry.ini.in' |
347 | --- data/Registry.ini.in 2014-03-06 10:55:17 +0000 |
348 | +++ data/Registry.ini.in 1970-01-01 00:00:00 +0000 |
349 | @@ -1,10 +0,0 @@ |
350 | -[Registry] |
351 | -Middleware = Zmq |
352 | -Zmq.Endpoint = ipc:///tmp/Registry |
353 | -Zmq.EndpointDir = /tmp |
354 | -Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini |
355 | -Scope.InstallDir = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/unity-scopes |
356 | -OEM.InstallDir = /custom/lib/@CMAKE_LIBRARY_ARCHITECTURE@/unity-scopes |
357 | -Scoperunner.Path = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperunner/scoperunner |
358 | -SS.Registry.Identity = SSRegistry |
359 | -SS.Registry.Endpoint = ipc:///tmp/SSRegistry |
360 | |
361 | === removed file 'data/Runtime.ini.in' |
362 | --- data/Runtime.ini.in 2013-12-13 11:25:44 +0000 |
363 | +++ data/Runtime.ini.in 1970-01-01 00:00:00 +0000 |
364 | @@ -1,5 +0,0 @@ |
365 | -[Runtime] |
366 | -Registry.Identity = Registry |
367 | -Registry.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Registry.ini |
368 | -Default.Middleware = Zmq |
369 | -Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini |
370 | |
371 | === removed file 'data/SSRegistry.ini.in' |
372 | --- data/SSRegistry.ini.in 2014-03-06 10:55:17 +0000 |
373 | +++ data/SSRegistry.ini.in 1970-01-01 00:00:00 +0000 |
374 | @@ -1,7 +0,0 @@ |
375 | -[Registry] |
376 | -Middleware = Zmq |
377 | -Zmq.Endpoint = ipc:///tmp/SSRegistry |
378 | -Zmq.EndpointDir = /tmp |
379 | -Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini |
380 | -Scope.InstallDir = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/unity-scopes |
381 | -Scoperunner.Path = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperunner/scoperunner |
382 | |
383 | === removed file 'data/SSRuntime.ini.in' |
384 | --- data/SSRuntime.ini.in 2014-02-04 13:57:56 +0000 |
385 | +++ data/SSRuntime.ini.in 1970-01-01 00:00:00 +0000 |
386 | @@ -1,5 +0,0 @@ |
387 | -[Runtime] |
388 | -Registry.Identity = SSRegistry |
389 | -Registry.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/SSRegistry.ini |
390 | -Default.Middleware = Zmq |
391 | -Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini |
392 | |
393 | === removed file 'data/Zmq.ini.in' |
394 | --- data/Zmq.ini.in 2013-11-29 12:20:25 +0000 |
395 | +++ data/Zmq.ini.in 1970-01-01 00:00:00 +0000 |
396 | @@ -1,3 +0,0 @@ |
397 | -[Zmq] |
398 | -EndpointDir.Public = /tmp |
399 | -EndpointDir.Private = /tmp |
400 | |
401 | === modified file 'data/libunity-scopes.pc.in' |
402 | --- data/libunity-scopes.pc.in 2014-03-06 10:58:11 +0000 |
403 | +++ data/libunity-scopes.pc.in 2014-05-08 12:06:13 +0000 |
404 | @@ -19,7 +19,9 @@ |
405 | prefix=@CMAKE_INSTALL_PREFIX@ |
406 | includedir=${prefix}/@HDR_INSTALL_DIR@ |
407 | libdir=${prefix}/@LIBDIR@ |
408 | -scopesdir=${libdir}/unity-scopes |
409 | +scopesdir=${libdir}/@UNITY_SCOPES_LIB@ |
410 | +scoperegistry_bin=${libdir}/@UNITY_SCOPES_LIB@/scoperegistry |
411 | +scoperunner_bin=${libdir}/@UNITY_SCOPES_LIB@/scoperunner |
412 | |
413 | Name: lib@UNITY_SCOPES_LIB@ |
414 | Description: Unity Scopes API library |
415 | |
416 | === modified file 'data/scope-registry.conf.in' |
417 | --- data/scope-registry.conf.in 2014-02-12 10:21:41 +0000 |
418 | +++ data/scope-registry.conf.in 2014-05-08 12:06:13 +0000 |
419 | @@ -7,4 +7,4 @@ |
420 | respawn |
421 | respawn limit 10 60 |
422 | |
423 | -exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperegistry/scoperegistry |
424 | +exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@UNITY_SCOPES_LIB@/scoperegistry |
425 | |
426 | === modified file 'data/smart-scopes-proxy.conf.in' |
427 | --- data/smart-scopes-proxy.conf.in 2014-03-06 14:05:06 +0000 |
428 | +++ data/smart-scopes-proxy.conf.in 2014-05-08 12:06:13 +0000 |
429 | @@ -9,4 +9,4 @@ |
430 | |
431 | expect stop |
432 | |
433 | -exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/smartscopesproxy/smartscopesproxy upstart |
434 | +exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@UNITY_SCOPES_LIB@/smartscopesproxy upstart |
435 | |
436 | === modified file 'debian/changelog' |
437 | --- debian/changelog 2014-05-02 13:26:56 +0000 |
438 | +++ debian/changelog 2014-05-08 12:06:13 +0000 |
439 | @@ -1,10 +1,31 @@ |
440 | unity-scopes-api (0.4.4-0ubuntu1) UNRELEASED; urgency=low |
441 | |
442 | - * Implemented to_uri() and from_uri() conversions for CannedQuery. |
443 | - * Ship scopes-client in libunity-scopes-cli package. |
444 | + [ Michi Henning ] |
445 | + * Simplified configuration files. |
446 | + * Removed SS.Registry.Endpoint from Runtime.ini. |
447 | + * Replaced SS.Registry.Identity with Smartscopes.Registry.Identity |
448 | + * Added documentation for configuration parameters (see CONFIGFILES in |
449 | + the root of the source tree) |
450 | + * Runtime::run_scope() now has an overload to accept a path to Runtime.ini. |
451 | + If no file name is passed, the system-wide Runtime.ini is used. |
452 | + * UNIX domain sockets for Zmq are now placed under $XDG_RUNTIME_DIR/zmq. |
453 | + * Install location for things under /usr/share is now unity-scopes instead |
454 | + of unity-scopes-api. |
455 | + |
456 | + [ Pawel Stolowski ] |
457 | * Renamed SearchReply::register_annotation() to push(). |
458 | |
459 | - -- Pawel Stolowski <pawel.stolowski@ubuntu.com> Tue, 29 Apr 2014 13:39:03 +0200 |
460 | + -- Michi Henning <michi.henning@canonical.com> Thu, 01 May 2014 13:55:48 +1000 |
461 | + |
462 | +unity-scopes-api (0.4.3+14.10.20140502.1-0ubuntu1) utopic; urgency=low |
463 | + |
464 | + [ Tarmac ] |
465 | + * Sync with devel branch. |
466 | + |
467 | + [ Ubuntu daily release ] |
468 | + * New rebuild forced |
469 | + |
470 | + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 02 May 2014 14:44:05 +0000 |
471 | |
472 | unity-scopes-api (0.4.3+14.10.20140428-0ubuntu1) utopic; urgency=low |
473 | |
474 | |
475 | === modified file 'debian/libunity-scopes-doc.install' |
476 | --- debian/libunity-scopes-doc.install 2014-02-04 09:50:11 +0000 |
477 | +++ debian/libunity-scopes-doc.install 2014-05-08 12:06:13 +0000 |
478 | @@ -1,1 +1,1 @@ |
479 | -usr/share/doc/unity-scopes-api/* |
480 | +usr/share/doc/unity-scopes/* |
481 | |
482 | === modified file 'debian/libunity-scopes1.install' |
483 | --- debian/libunity-scopes1.install 2014-04-03 15:04:11 +0000 |
484 | +++ debian/libunity-scopes1.install 2014-05-08 12:06:13 +0000 |
485 | @@ -1,7 +1,6 @@ |
486 | usr/lib/*/libunity-scopes.so.* |
487 | usr/lib/*/unity-scopes |
488 | -usr/lib/*/scoperegistry/* |
489 | -usr/lib/*/scoperunner/* |
490 | -usr/lib/*/smartscopesproxy/* |
491 | -usr/share/unity-scopes-api/*.ini |
492 | +usr/lib/*/unity-scopes/scoperegistry |
493 | +usr/lib/*/unity-scopes/scoperunner |
494 | +usr/lib/*/unity-scopes/smartscopesproxy |
495 | usr/share/upstart/sessions/*.conf |
496 | |
497 | === modified file 'debian/libunity-scopes1.symbols' |
498 | --- debian/libunity-scopes1.symbols 2014-05-06 11:25:36 +0000 |
499 | +++ debian/libunity-scopes1.symbols 2014-05-08 12:06:13 +0000 |
500 | @@ -283,7 +283,8 @@ |
501 | (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 |
502 | (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 |
503 | (c++)"unity::scopes::Runtime::destroy()@Base" 0.4.0+14.04.20140312.1 |
504 | - (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.2 |
505 | + (c++)"unity::scopes::Runtime::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme |
506 | + (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 |
507 | (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 |
508 | (c++)"unity::scopes::Runtime::~Runtime()@Base" 0.4.0+14.04.20140312.1 |
509 | (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 |
510 | @@ -366,7 +367,8 @@ |
511 | (c++)"unity::scopes::Registry::~Registry()@Base" 0.4.0+14.04.20140312.1 |
512 | (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 |
513 | (c++)"unity::scopes::internal::RuntimeImpl::destroy()@Base" 0.4.0+14.04.20140312.1 |
514 | - (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.2 |
515 | + (c++)"unity::scopes::internal::RuntimeImpl::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme |
516 | + (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 |
517 | (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 |
518 | (c++)"unity::scopes::internal::RuntimeImpl::~RuntimeImpl()@Base" 0.4.0+14.04.20140312.1 |
519 | (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 |
520 | @@ -395,14 +397,14 @@ |
521 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_remote_scopes()@Base" 0.4.0+14.04.20140312.1 |
522 | (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 |
523 | (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 |
524 | - (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.1 |
525 | + (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 |
526 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::~SSRegistryObject()@Base" 0.4.0+14.04.20140312.1 |
527 | - (c++)"unity::scopes::internal::RuntimeConfig::RUNTIME_CONFIG_GROUP@Base" 0.4.2+14.04.20140404.2 |
528 | + (c++)"unity::scopes::internal::smartscopes::SSConfig::SSConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme |
529 | + (c++)"unity::scopes::internal::smartscopes::SSConfig::~SSConfig()@Base" 0replaceme |
530 | (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 |
531 | (c++)"unity::scopes::internal::RuntimeConfig::~RuntimeConfig()@Base" 0.4.2+14.04.20140404.2 |
532 | (c++)"unity::scopes::internal::MiddlewareBase::MiddlewareBase(unity::scopes::internal::RuntimeImpl*)@Base" 0.4.0+14.04.20140312.1 |
533 | (c++)"unity::scopes::internal::MiddlewareBase::~MiddlewareBase()@Base" 0.4.0+14.04.20140312.1 |
534 | - (c++)"unity::scopes::internal::RegistryConfig::REGISTRY_CONFIG_GROUP@Base" 0.4.0+14.04.20140312.1 |
535 | (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 |
536 | (c++)"unity::scopes::internal::RegistryConfig::~RegistryConfig()@Base" 0.4.0+14.04.20140312.1 |
537 | (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::update_state(unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState)@Base" 0.4.2+14.04.20140404.2 |
538 | @@ -605,16 +607,15 @@ |
539 | (c++)"unity::scopes::Category::title() const@Base" 0.4.0+14.04.20140312.1 |
540 | (c++)"unity::scopes::Category::serialize() const@Base" 0.4.0+14.04.20140312.1 |
541 | (c++)"unity::scopes::internal::RuntimeImpl::async_pool() const@Base" 0.4.3+14.10.20140428 |
542 | - (c++)"unity::scopes::internal::RuntimeImpl::configfile() const@Base" 0.4.2+14.04.20140404.2 |
543 | (c++)"unity::scopes::internal::RuntimeImpl::future_queue() const@Base" 0.4.3+14.10.20140428 |
544 | (c++)"unity::scopes::internal::RuntimeImpl::reply_reaper() const@Base" 0.4.0+14.04.20140312.1 |
545 | + (c++)"unity::scopes::internal::RuntimeImpl::ss_configfile() const@Base" 0replaceme |
546 | (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 |
547 | (c++)"unity::scopes::internal::RuntimeImpl::proxy_to_string(std::shared_ptr<unity::scopes::Object> const&) const@Base" 0.4.0+14.04.20140312.1 |
548 | (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 |
549 | - (c++)"unity::scopes::internal::RuntimeImpl::registry_endpoint() const@Base" 0.4.0+14.04.20140312.1 |
550 | (c++)"unity::scopes::internal::RuntimeImpl::registry_identity() const@Base" 0.4.0+14.04.20140312.1 |
551 | (c++)"unity::scopes::internal::RuntimeImpl::registry_configfile() const@Base" 0.4.0+14.04.20140312.1 |
552 | - (c++)"unity::scopes::internal::RuntimeImpl::registry_endpointdir() const@Base" 0.4.0+14.04.20140312.1 |
553 | + (c++)"unity::scopes::internal::RuntimeImpl::ss_registry_identity() const@Base" 0replaceme |
554 | (c++)"unity::scopes::internal::RuntimeImpl::factory() const@Base" 0.4.0+14.04.20140312.1 |
555 | (c++)"unity::scopes::internal::RuntimeImpl::registry() const@Base" 0.4.0+14.04.20140312.1 |
556 | (c++)"unity::scopes::internal::RuntimeImpl::scope_id() const@Base" 0.4.0+14.04.20140312.1 |
557 | @@ -637,21 +638,23 @@ |
558 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_ssclient() const@Base" 0.4.0+14.04.20140312.1 |
559 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::list() const@Base" 0.4.2+14.04.20140404.2 |
560 | (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 |
561 | + (c++)"unity::scopes::internal::smartscopes::SSConfig::scope_identity() const@Base" 0replaceme |
562 | + (c++)"unity::scopes::internal::smartscopes::SSConfig::reg_refresh_rate() const@Base" 0replaceme |
563 | + (c++)"unity::scopes::internal::smartscopes::SSConfig::http_reply_timeout() const@Base" 0replaceme |
564 | + (c++)"unity::scopes::internal::smartscopes::SSConfig::reg_refresh_fail_timeout() const@Base" 0replaceme |
565 | + (c++)"unity::scopes::internal::RuntimeConfig::ss_configfile() const@Base" 0replaceme |
566 | (c++)"unity::scopes::internal::RuntimeConfig::registry_identity() const@Base" 0.4.2+14.04.20140404.2 |
567 | (c++)"unity::scopes::internal::RuntimeConfig::default_middleware() const@Base" 0.4.2+14.04.20140404.2 |
568 | (c++)"unity::scopes::internal::RuntimeConfig::registry_configfile() const@Base" 0.4.2+14.04.20140404.2 |
569 | + (c++)"unity::scopes::internal::RuntimeConfig::ss_registry_identity() const@Base" 0replaceme |
570 | (c++)"unity::scopes::internal::RuntimeConfig::default_middleware_configfile() const@Base" 0.4.2+14.04.20140404.2 |
571 | (c++)"unity::scopes::internal::MiddlewareBase::runtime() const@Base" 0.4.0+14.04.20140312.1 |
572 | - (c++)"unity::scopes::internal::RegistryConfig::endpointdir() const@Base" 0.4.0+14.04.20140312.1 |
573 | (c++)"unity::scopes::internal::RegistryConfig::mw_configfile() const@Base" 0.4.0+14.04.20140312.1 |
574 | (c++)"unity::scopes::internal::RegistryConfig::oem_installdir() const@Base" 0.4.0+14.04.20140312.1 |
575 | (c++)"unity::scopes::internal::RegistryConfig::click_installdir() const@Base" 0.4.3+14.10.20140428 |
576 | (c++)"unity::scopes::internal::RegistryConfig::scope_installdir() const@Base" 0.4.0+14.04.20140312.1 |
577 | (c++)"unity::scopes::internal::RegistryConfig::scoperunner_path() const@Base" 0.4.0+14.04.20140312.1 |
578 | - (c++)"unity::scopes::internal::RegistryConfig::ss_registry_endpoint() const@Base" 0.4.0+14.04.20140312.1 |
579 | - (c++)"unity::scopes::internal::RegistryConfig::ss_registry_identity() const@Base" 0.4.0+14.04.20140312.1 |
580 | (c++)"unity::scopes::internal::RegistryConfig::mw_kind() const@Base" 0.4.0+14.04.20140312.1 |
581 | - (c++)"unity::scopes::internal::RegistryConfig::endpoint() const@Base" 0.4.0+14.04.20140312.1 |
582 | (c++)"unity::scopes::internal::RegistryConfig::identity() const@Base" 0.4.0+14.04.20140312.1 |
583 | (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 |
584 | (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 |
585 | |
586 | === modified file 'demo/CMakeLists.txt' |
587 | --- demo/CMakeLists.txt 2014-04-23 11:04:31 +0000 |
588 | +++ demo/CMakeLists.txt 2014-05-08 12:06:13 +0000 |
589 | @@ -4,7 +4,6 @@ |
590 | |
591 | configure_file(Runtime.ini.in Runtime.ini) |
592 | configure_file(Registry.ini.in Registry.ini) |
593 | -configure_file(Zmq.ini.in Zmq.ini) |
594 | |
595 | add_definitions(-DDEMO_RUNTIME_PATH="${CMAKE_CURRENT_BINARY_DIR}/Runtime.ini") |
596 | |
597 | |
598 | === modified file 'demo/README' |
599 | --- demo/README 2014-04-23 11:04:31 +0000 |
600 | +++ demo/README 2014-05-08 12:06:13 +0000 |
601 | @@ -32,4 +32,4 @@ |
602 | $ ./scopes-client scope-B testquery |
603 | |
604 | The client currently looks for Runtime.ini in the current directory and if not present, uses the system-wide Runtime.ini |
605 | -shipped with libunity-scopes (/usr/share/unity-scopes-api/Runtime.ini by default) |
606 | +shipped with libunity-scopes (/usr/lib/<arch>/unity-scopes/Runtime.ini by default) |
607 | |
608 | === modified file 'demo/Registry.ini.in' |
609 | --- demo/Registry.ini.in 2014-02-13 02:40:08 +0000 |
610 | +++ demo/Registry.ini.in 2014-05-08 12:06:13 +0000 |
611 | @@ -1,10 +1,5 @@ |
612 | [Registry] |
613 | -Middleware = Zmq |
614 | -Zmq.Endpoint = ipc:///tmp/Registry |
615 | -Zmq.EndpointDir = /tmp |
616 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini |
617 | Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes |
618 | OEM.InstallDir = /custom/usr/lib/@CMAKE_LIBRARY_ARCHITECTURE@/unity/scopes |
619 | Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner |
620 | -SS.Registry.Identity = SSRegistry |
621 | -SS.Registry.Endpoint = ipc:///tmp/SSRegistry |
622 | |
623 | === modified file 'demo/Runtime.ini.in' |
624 | --- demo/Runtime.ini.in 2014-01-31 02:21:24 +0000 |
625 | +++ demo/Runtime.ini.in 2014-05-08 12:06:13 +0000 |
626 | @@ -1,5 +1,3 @@ |
627 | [Runtime] |
628 | Registry.Identity = Registry |
629 | Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Registry.ini |
630 | -Default.Middleware = Zmq |
631 | -Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini |
632 | |
633 | === removed file 'demo/Zmq.ini.in' |
634 | --- demo/Zmq.ini.in 2013-11-28 00:27:48 +0000 |
635 | +++ demo/Zmq.ini.in 1970-01-01 00:00:00 +0000 |
636 | @@ -1,3 +0,0 @@ |
637 | -[Zmq] |
638 | -EndpointDir.Public = /tmp |
639 | -EndpointDir.Private = /tmp |
640 | |
641 | === modified file 'demo/click/scope-click/CMakeLists.txt' |
642 | --- demo/click/scope-click/CMakeLists.txt 2014-04-03 15:27:11 +0000 |
643 | +++ demo/click/scope-click/CMakeLists.txt 2014-05-08 12:06:13 +0000 |
644 | @@ -6,7 +6,7 @@ |
645 | include(GNUInstallDirs) |
646 | include(FindPkgConfig) |
647 | |
648 | - pkg_check_modules(UNITY_SCOPES REQUIRED libunity-scopes>=0.4.0) |
649 | + pkg_check_modules(UNITY_SCOPES REQUIRED lib${UNITY_SCOPES_LIB}>=0.4.0) |
650 | add_definitions(${UNITY_SCOPES_CFLAGS} ${UNITY_SCOPES_CFLAGS_OTHER}) |
651 | |
652 | add_definitions(-std=c++11) |
653 | |
654 | === modified file 'demo/stand-alone/CMakeLists.txt' |
655 | --- demo/stand-alone/CMakeLists.txt 2014-02-03 09:04:04 +0000 |
656 | +++ demo/stand-alone/CMakeLists.txt 2014-05-08 12:06:13 +0000 |
657 | @@ -1,5 +1,4 @@ |
658 | configure_file(Runtime.ini.in Runtime.ini) |
659 | -configure_file(Zmq.ini.in Zmq.ini) |
660 | |
661 | add_executable(stand-alone-client stand-alone-client.cpp) |
662 | |
663 | |
664 | === modified file 'demo/stand-alone/Runtime.ini.in' |
665 | --- demo/stand-alone/Runtime.ini.in 2014-02-03 09:04:04 +0000 |
666 | +++ demo/stand-alone/Runtime.ini.in 2014-05-08 12:06:13 +0000 |
667 | @@ -1,3 +1,1 @@ |
668 | [Runtime] |
669 | -Default.Middleware = Zmq |
670 | -Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini |
671 | |
672 | === removed file 'demo/stand-alone/Zmq.ini.in' |
673 | --- demo/stand-alone/Zmq.ini.in 2014-02-03 09:04:04 +0000 |
674 | +++ demo/stand-alone/Zmq.ini.in 1970-01-01 00:00:00 +0000 |
675 | @@ -1,3 +0,0 @@ |
676 | -[Zmq] |
677 | -EndpointDir.Public = /tmp |
678 | -EndpointDir.Private = /tmp |
679 | |
680 | === modified file 'doc/Doxyfile-devel.in' |
681 | --- doc/Doxyfile-devel.in 2014-02-26 00:34:09 +0000 |
682 | +++ doc/Doxyfile-devel.in 2014-05-08 12:06:13 +0000 |
683 | @@ -888,7 +888,7 @@ |
684 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be |
685 | # put in front of it. If left blank `html' will be used as the default path. |
686 | |
687 | -HTML_OUTPUT = @PROJECT@ |
688 | +HTML_OUTPUT = @UNITY_SCOPES_LIB@ |
689 | |
690 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for |
691 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank |
692 | |
693 | === modified file 'doc/Doxyfile.in' |
694 | --- doc/Doxyfile.in 2014-05-01 17:25:23 +0000 |
695 | +++ doc/Doxyfile.in 2014-05-08 12:06:13 +0000 |
696 | @@ -887,7 +887,7 @@ |
697 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be |
698 | # put in front of it. If left blank `html' will be used as the default path. |
699 | |
700 | -HTML_OUTPUT = @PROJECT@ |
701 | +HTML_OUTPUT = @UNITY_SCOPES_LIB@ |
702 | |
703 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for |
704 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank |
705 | |
706 | === modified file 'doc/index.html' |
707 | --- doc/index.html 2014-02-26 10:43:45 +0000 |
708 | +++ doc/index.html 2014-05-08 12:06:13 +0000 |
709 | @@ -1,10 +1,10 @@ |
710 | <head> |
711 | -<meta http-equiv="refresh" content="1;url=unity-scopes-api/index.html"> |
712 | +<meta http-equiv="refresh" content="1;url=unity-scopes/index.html"> |
713 | <script type="text/javascript"> |
714 | - window.location.href = "unity-scopes-api/index.html" |
715 | + window.location.href = "unity-scopes/index.html" |
716 | </script> |
717 | <title>Unity Scopes API - Page Redirection</title> |
718 | </head> |
719 | <body> |
720 | -<p>You will be redirected automatically, otherwise please <a href="unity-scopes-api/index.html">click here</a>.</p> |
721 | +<p>You will be redirected automatically, otherwise please <a href="unity-scopes/index.html">click here</a>.</p> |
722 | </body> |
723 | |
724 | === modified file 'include/CMakeLists.txt' |
725 | --- include/CMakeLists.txt 2014-01-31 07:55:00 +0000 |
726 | +++ include/CMakeLists.txt 2014-05-08 12:06:13 +0000 |
727 | @@ -1,13 +1,13 @@ |
728 | add_subdirectory(unity) |
729 | set(UNITY_SCOPES_LIB_HDRS ${UNITY_SCOPES_LIB_HDRS} ${headers} PARENT_SCOPE) |
730 | |
731 | -add_custom_command(OUTPUT unity-scopes.h |
732 | +add_custom_command(OUTPUT ${UNITY_SCOPES_LIB}.h |
733 | COMMAND ${CMAKE_SOURCE_DIR}/tools/create_globalheader.py |
734 | -${CMAKE_CURRENT_BINARY_DIR}/unity-scopes.h ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} |
735 | +${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}.h ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} |
736 | DEPENDS ${UNITY_SCOPES_LIB_HDRS}) |
737 | |
738 | add_custom_target(globalheader ALL |
739 | -DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes.h) |
740 | +DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}.h) |
741 | |
742 | -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes.h |
743 | +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}.h |
744 | DESTINATION ${HDR_INSTALL_DIR}) |
745 | |
746 | === modified file 'include/unity/scopes/Runtime.h' |
747 | --- include/unity/scopes/Runtime.h 2014-04-03 16:46:00 +0000 |
748 | +++ include/unity/scopes/Runtime.h 2014-05-08 12:06:13 +0000 |
749 | @@ -102,8 +102,17 @@ |
750 | 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. |
751 | |
752 | \param scope_base The scope implementation |
753 | + \param runtime_ini_file The full path of runtime configuration file. Passing an empty string uses |
754 | + a default configuration. |
755 | \param scope_ini_file The full path of scope configuration file |
756 | */ |
757 | + void run_scope(ScopeBase *const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file); |
758 | + |
759 | + /** |
760 | + \brief Run a scope without going through the scope runner. |
761 | + |
762 | + Equivalent to `run_scope(scope_base, "", scope_ini_file);` |
763 | + */ |
764 | void run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file); |
765 | |
766 | // TODO: Flesh out documentation for this, especially syntax. |
767 | |
768 | === modified file 'include/unity/scopes/internal/ConfigBase.h' |
769 | --- include/unity/scopes/internal/ConfigBase.h 2014-02-26 11:32:43 +0000 |
770 | +++ include/unity/scopes/internal/ConfigBase.h 2014-05-08 12:06:13 +0000 |
771 | @@ -21,6 +21,9 @@ |
772 | |
773 | #include <unity/util/IniParser.h> |
774 | |
775 | +#include <map> |
776 | +#include <set> |
777 | + |
778 | namespace unity |
779 | { |
780 | |
781 | @@ -39,16 +42,23 @@ |
782 | { |
783 | public: |
784 | ConfigBase(); |
785 | - ConfigBase(std::string const& configfile); |
786 | + ConfigBase(std::string const& configfile, std::string const& dflt_file = ""); |
787 | virtual ~ConfigBase(); |
788 | |
789 | unity::util::IniParser::SPtr parser() const; |
790 | |
791 | virtual std::string get_string(std::string const& group, std::string const& key) const; |
792 | - virtual std::string get_optional_string(std::string const& group, std::string const& key) const; |
793 | + virtual std::string get_optional_string(std::string const& group, |
794 | + std::string const& key, |
795 | + std::string const& dflt = "") const; |
796 | virtual std::string get_middleware(std::string const& group, std::string const& key) const; |
797 | |
798 | - virtual void throw_ex(::std::string const& reason) const; |
799 | +protected: |
800 | + void throw_ex(::std::string const& reason) const; |
801 | + bool path_exists(::std::string const& path) const; |
802 | + |
803 | + typedef std::map<std::string, std::set<std::string>> KnownEntries; |
804 | + void check_unknown_entries(KnownEntries const& valid) const; |
805 | |
806 | private: |
807 | unity::util::IniParser::SPtr parser_; |
808 | |
809 | === modified file 'include/unity/scopes/internal/DfltConfig.h.in' |
810 | --- include/unity/scopes/internal/DfltConfig.h.in 2014-02-06 05:03:24 +0000 |
811 | +++ include/unity/scopes/internal/DfltConfig.h.in 2014-05-08 12:06:13 +0000 |
812 | @@ -28,9 +28,23 @@ |
813 | namespace internal |
814 | { |
815 | |
816 | -static constexpr const char* DFLT_RUNTIME_INI = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Runtime.ini"; |
817 | -static constexpr const char* DFLT_SS_RUNTIME_INI = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/SSRuntime.ini"; |
818 | -static constexpr const char* DFLT_REGISTRY_INI = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Registry.ini"; |
819 | +static constexpr const char* DFLT_RUNTIME_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Runtime.ini"; |
820 | +static constexpr const char* DFLT_REGISTRY_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Registry.ini"; |
821 | +static constexpr char const* DFLT_REGISTRY_ID = "Registry"; |
822 | +static constexpr const char* DFLT_SS_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Smartscopes.ini"; |
823 | +static constexpr char const* DFLT_SS_REGISTRY_ID = "SSRegistry"; |
824 | +static constexpr char const* DFLT_SCOPERUNNER_PATH = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/scoperunner"; |
825 | +static constexpr char const* DFLT_MIDDLEWARE = "Zmq"; |
826 | +static constexpr char const* DFLT_ZMQ_MIDDLEWARE_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Zmq.ini"; |
827 | +static constexpr char const* DFLT_MIDDLEWARE_INI = DFLT_ZMQ_MIDDLEWARE_INI; |
828 | +static constexpr char const* DFLT_SCOPE_INSTALL_DIR = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@"; |
829 | +static constexpr char const* DFLT_OEM_INSTALL_DIR = "/custom/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@"; |
830 | + |
831 | +static constexpr int DFLT_SS_HTTP_TIMEOUT = 20; // seconds |
832 | +static constexpr int DFLT_SS_REG_REFRESH_RATE = 86400; // 24 hours as seconds |
833 | +static constexpr int DFLT_SS_REG_REFRESH_FAIL_TIMEOUT = 10; // seconds |
834 | + |
835 | +static constexpr char const* DFLT_SS_SCOPE_IDENTITY = "SmartScope"; |
836 | |
837 | } // namespace internal |
838 | |
839 | |
840 | === modified file 'include/unity/scopes/internal/MiddlewareBase.h' |
841 | --- include/unity/scopes/internal/MiddlewareBase.h 2014-04-02 09:24:02 +0000 |
842 | +++ include/unity/scopes/internal/MiddlewareBase.h 2014-05-08 12:06:13 +0000 |
843 | @@ -65,7 +65,9 @@ |
844 | virtual ObjectProxy string_to_proxy(std::string const& s) = 0; |
845 | virtual std::string proxy_to_string(MWProxy const& proxy) = 0; |
846 | |
847 | - virtual MWRegistryProxy create_registry_proxy(std::string const& identity, std::string const& endpoint) = 0; |
848 | + virtual MWRegistryProxy registry_proxy() = 0; |
849 | + virtual MWRegistryProxy ss_registry_proxy() = 0; |
850 | + |
851 | virtual MWScopeProxy create_scope_proxy(std::string const& identity) = 0; |
852 | virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) = 0; |
853 | virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) = 0; |
854 | |
855 | === modified file 'include/unity/scopes/internal/RegistryConfig.h' |
856 | --- include/unity/scopes/internal/RegistryConfig.h 2014-04-04 13:22:38 +0000 |
857 | +++ include/unity/scopes/internal/RegistryConfig.h 2014-05-08 12:06:13 +0000 |
858 | @@ -33,35 +33,25 @@ |
859 | class RegistryConfig : public ConfigBase |
860 | { |
861 | public: |
862 | - static constexpr char const* REGISTRY_CONFIG_GROUP = "Registry"; |
863 | - |
864 | RegistryConfig(std::string const& identity, std::string const& configfile); |
865 | ~RegistryConfig(); |
866 | |
867 | std::string identity() const; |
868 | std::string mw_kind() const; |
869 | - std::string endpointdir() const; |
870 | - std::string endpoint() const; |
871 | std::string mw_configfile() const; |
872 | std::string scope_installdir() const; // Directory for Canonical scopes |
873 | std::string oem_installdir() const; // Directory for OEM scope config files |
874 | std::string click_installdir() const; // Directory for Click scope config files |
875 | std::string scoperunner_path() const; // Path to scoperunner binary |
876 | - std::string ss_registry_identity() const; // Identity of smart scopes registry |
877 | - std::string ss_registry_endpoint() const; // Endpoint of smart scopes registry |
878 | |
879 | private: |
880 | std::string identity_; |
881 | std::string mw_kind_; |
882 | - std::string endpointdir_; |
883 | - std::string endpoint_; |
884 | std::string mw_configfile_; |
885 | std::string scope_installdir_; |
886 | std::string oem_installdir_; |
887 | std::string click_installdir_; |
888 | std::string scoperunner_path_; |
889 | - std::string ss_registry_identity_; |
890 | - std::string ss_registry_endpoint_; |
891 | }; |
892 | |
893 | } // namespace internal |
894 | |
895 | === modified file 'include/unity/scopes/internal/RegistryObject.h' |
896 | --- include/unity/scopes/internal/RegistryObject.h 2014-04-10 10:59:00 +0000 |
897 | +++ include/unity/scopes/internal/RegistryObject.h 2014-05-08 12:06:13 +0000 |
898 | @@ -123,10 +123,11 @@ |
899 | |
900 | Executor::SPtr executor_; |
901 | |
902 | - mutable std::mutex mutex_; |
903 | MetadataMap scopes_; |
904 | - std::map<std::string, ScopeProcess> scope_processes_; |
905 | + typedef std::map<std::string, ScopeProcess> ProcessMap; |
906 | + ProcessMap scope_processes_; |
907 | MWRegistryProxy remote_registry_; |
908 | + mutable std::mutex mutex_; |
909 | }; |
910 | |
911 | } // namespace internal |
912 | |
913 | === modified file 'include/unity/scopes/internal/RuntimeConfig.h' |
914 | --- include/unity/scopes/internal/RuntimeConfig.h 2014-01-23 11:28:34 +0000 |
915 | +++ include/unity/scopes/internal/RuntimeConfig.h 2014-05-08 12:06:13 +0000 |
916 | @@ -34,19 +34,21 @@ |
917 | class RuntimeConfig : public ConfigBase |
918 | { |
919 | public: |
920 | - static const char* RUNTIME_CONFIG_GROUP; |
921 | - |
922 | RuntimeConfig(std::string const& configfile); |
923 | ~RuntimeConfig(); |
924 | |
925 | std::string registry_identity() const; |
926 | std::string registry_configfile() const; |
927 | + std::string ss_registry_identity() const; |
928 | + std::string ss_configfile() const; |
929 | std::string default_middleware() const; |
930 | std::string default_middleware_configfile() const; |
931 | |
932 | private: |
933 | std::string registry_identity_; |
934 | std::string registry_configfile_; |
935 | + std::string ss_registry_identity_; |
936 | + std::string ss_configfile_; |
937 | std::string default_middleware_; |
938 | std::string default_middleware_configfile_; |
939 | }; |
940 | |
941 | === modified file 'include/unity/scopes/internal/RuntimeImpl.h' |
942 | --- include/unity/scopes/internal/RuntimeImpl.h 2014-04-15 05:24:45 +0000 |
943 | +++ include/unity/scopes/internal/RuntimeImpl.h 2014-05-08 12:06:13 +0000 |
944 | @@ -44,17 +44,17 @@ |
945 | void destroy(); |
946 | |
947 | std::string scope_id() const; |
948 | - std::string configfile() const; |
949 | MiddlewareFactory const* factory() const; |
950 | RegistryProxy registry() const; |
951 | std::string registry_configfile() const; |
952 | std::string registry_identity() const; |
953 | - std::string registry_endpointdir() const; |
954 | - std::string registry_endpoint() const; |
955 | + std::string ss_configfile() const; |
956 | + std::string ss_registry_identity() const; |
957 | Reaper::SPtr reply_reaper() const; |
958 | ThreadPool::SPtr async_pool() const; |
959 | ThreadSafeQueue<std::future<void>>::SPtr future_queue() const; |
960 | - void run_scope(ScopeBase *const scope_base, std::string const &scope_ini_file); |
961 | + void run_scope(ScopeBase* const scope_base, std::string const& scope_ini_file); |
962 | + void run_scope(ScopeBase* const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file); |
963 | |
964 | ObjectProxy string_to_proxy(std::string const& s) const; |
965 | std::string proxy_to_string(ObjectProxy const& proxy) const; |
966 | @@ -67,14 +67,13 @@ |
967 | |
968 | bool destroyed_; |
969 | std::string scope_id_; |
970 | - std::string configfile_; |
971 | MiddlewareFactory::UPtr middleware_factory_; |
972 | MiddlewareBase::SPtr middleware_; |
973 | mutable RegistryProxy registry_; |
974 | mutable std::string registry_configfile_; |
975 | mutable std::string registry_identity_; |
976 | - mutable std::string registry_endpointdir_; |
977 | - mutable std::string registry_endpoint_; |
978 | + mutable std::string ss_configfile_; |
979 | + mutable std::string ss_registry_identity_; |
980 | mutable Reaper::SPtr reply_reaper_; |
981 | mutable ThreadPool::SPtr async_pool_; // Pool of invocation threads for async query creation |
982 | mutable ThreadSafeQueue<std::future<void>>::SPtr future_queue_; |
983 | |
984 | === modified file 'include/unity/scopes/internal/ScopeConfig.h' |
985 | --- include/unity/scopes/internal/ScopeConfig.h 2014-04-08 08:26:44 +0000 |
986 | +++ include/unity/scopes/internal/ScopeConfig.h 2014-05-08 12:06:13 +0000 |
987 | @@ -35,9 +35,6 @@ |
988 | class ScopeConfig : public ConfigBase |
989 | { |
990 | public: |
991 | - static constexpr const char* SCOPE_CONFIG_GROUP = "ScopeConfig"; |
992 | - static constexpr const char* SCOPE_DISPLAY_GROUP = "Appearance"; |
993 | - |
994 | ScopeConfig(std::string const& configfile); |
995 | ~ScopeConfig(); |
996 | |
997 | @@ -51,6 +48,7 @@ |
998 | std::string hot_key() const; // Optional, throws NotFoundException if not present |
999 | bool invisible() const; // Optional, returns false if not present |
1000 | std::string scope_runner() const; // Optional, throws NotFoundException if not present |
1001 | + |
1002 | VariantMap appearance_attributes() const; // Optional, return empty map if no attributes are present |
1003 | |
1004 | private: |
1005 | @@ -62,7 +60,7 @@ |
1006 | std::unique_ptr<std::string> icon_; |
1007 | std::unique_ptr<std::string> search_hint_; |
1008 | std::unique_ptr<std::string> hot_key_; |
1009 | - std::unique_ptr<bool> invisible_; |
1010 | + bool invisible_; |
1011 | std::unique_ptr<std::string> scope_runner_; |
1012 | VariantMap appearance_attributes_; |
1013 | }; |
1014 | |
1015 | === added file 'include/unity/scopes/internal/smartscopes/SSConfig.h' |
1016 | --- include/unity/scopes/internal/smartscopes/SSConfig.h 1970-01-01 00:00:00 +0000 |
1017 | +++ include/unity/scopes/internal/smartscopes/SSConfig.h 2014-05-08 12:06:13 +0000 |
1018 | @@ -0,0 +1,62 @@ |
1019 | +/* |
1020 | + * Copyright (C) 2014 Canonical Ltd |
1021 | + * |
1022 | + * This program is free software: you can redistribute it and/or modify |
1023 | + * it under the terms of the GNU Lesser General Public License version 3 as |
1024 | + * published by the Free Software Foundation. |
1025 | + * |
1026 | + * This program is distributed in the hope that it will be useful, |
1027 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1028 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1029 | + * GNU Lesser General Public License for more details. |
1030 | + * |
1031 | + * You should have received a copy of the GNU Lesser General Public License |
1032 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1033 | + * |
1034 | + * Authored by: Michi Henning <michi.henning@canonical.com> |
1035 | + */ |
1036 | + |
1037 | +#ifndef UNITY_SCOPES_INTERNAL_SSCONFIG_H |
1038 | +#define UNITY_SCOPES_INTERNAL_SSCONFIG_H |
1039 | + |
1040 | +#include <unity/scopes/internal/ConfigBase.h> |
1041 | + |
1042 | +namespace unity |
1043 | +{ |
1044 | + |
1045 | +namespace scopes |
1046 | +{ |
1047 | + |
1048 | +namespace internal |
1049 | +{ |
1050 | + |
1051 | +namespace smartscopes |
1052 | +{ |
1053 | + |
1054 | +class SSConfig : public ConfigBase |
1055 | +{ |
1056 | +public: |
1057 | + SSConfig(std::string const& configfile); |
1058 | + ~SSConfig(); |
1059 | + |
1060 | + int http_reply_timeout() const; // seconds |
1061 | + int reg_refresh_rate() const; // seconds |
1062 | + int reg_refresh_fail_timeout() const; // seconds |
1063 | + std::string scope_identity() const; |
1064 | + |
1065 | +private: |
1066 | + int http_reply_timeout_; |
1067 | + int reg_refresh_rate_; |
1068 | + int reg_refresh_fail_timeout_; |
1069 | + std::string scope_identity_; |
1070 | +}; |
1071 | + |
1072 | +} // namespace smartscopes |
1073 | + |
1074 | +} // namespace internal |
1075 | + |
1076 | +} // namespace scopes |
1077 | + |
1078 | +} // namespace unity |
1079 | + |
1080 | +#endif |
1081 | |
1082 | === modified file 'include/unity/scopes/internal/smartscopes/SSRegistryObject.h' |
1083 | --- include/unity/scopes/internal/smartscopes/SSRegistryObject.h 2014-04-03 12:57:25 +0000 |
1084 | +++ include/unity/scopes/internal/smartscopes/SSRegistryObject.h 2014-05-08 12:06:13 +0000 |
1085 | @@ -22,6 +22,7 @@ |
1086 | #include <unity/scopes/internal/MiddlewareBase.h> |
1087 | #include <unity/scopes/internal/RegistryObjectBase.h> |
1088 | #include <unity/scopes/internal/smartscopes/SmartScopesClient.h> |
1089 | +#include <unity/scopes/internal/smartscopes/SSConfig.h> |
1090 | |
1091 | #include <mutex> |
1092 | |
1093 | @@ -42,8 +43,10 @@ |
1094 | public: |
1095 | UNITY_DEFINES_PTRS(SSRegistryObject); |
1096 | |
1097 | - SSRegistryObject(MiddlewareBase::SPtr middleware, std::string const& ss_scope_endpoint, |
1098 | - uint http_reply_timeout, uint refresh_rate_in_sec, std::string const& sss_url = "", |
1099 | + SSRegistryObject(MiddlewareBase::SPtr middleware, |
1100 | + SSConfig const& ss_config, |
1101 | + std::string const& ss_scope_endpoint, |
1102 | + std::string const& sss_url = "", |
1103 | bool caching_enabled = true); |
1104 | virtual ~SSRegistryObject() noexcept; |
1105 | |
1106 | @@ -78,6 +81,7 @@ |
1107 | std::string ss_scope_endpoint_; |
1108 | uint const regular_refresh_timeout_; |
1109 | uint next_refresh_timeout_; |
1110 | + uint const failed_refresh_timeout_; |
1111 | |
1112 | bool caching_enabled_; |
1113 | }; |
1114 | |
1115 | === modified file 'include/unity/scopes/internal/zmq_middleware/ZmqConfig.h' |
1116 | --- include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2014-01-23 11:28:34 +0000 |
1117 | +++ include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2014-05-08 12:06:13 +0000 |
1118 | @@ -33,8 +33,6 @@ |
1119 | class ZmqConfig : public ConfigBase |
1120 | { |
1121 | public: |
1122 | - static const char* ZMQ_CONFIG_GROUP; |
1123 | - |
1124 | ZmqConfig(std::string const& configfile); |
1125 | ~ZmqConfig(); |
1126 | |
1127 | |
1128 | === modified file 'include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h' |
1129 | --- include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2014-04-16 07:04:34 +0000 |
1130 | +++ include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2014-05-08 12:06:13 +0000 |
1131 | @@ -53,7 +53,7 @@ |
1132 | class ZmqMiddleware final : public MiddlewareBase |
1133 | { |
1134 | public: |
1135 | - ZmqMiddleware(std::string const& server_name, std::string const& configfile, RuntimeImpl* runtime); |
1136 | + ZmqMiddleware(std::string const& server_name, RuntimeImpl* runtime, std::string const& configfile = ""); |
1137 | virtual ~ZmqMiddleware(); |
1138 | |
1139 | virtual void start() override; |
1140 | @@ -63,7 +63,9 @@ |
1141 | virtual ObjectProxy string_to_proxy(std::string const& s) override; |
1142 | virtual std::string proxy_to_string(MWProxy const& proxy) override; |
1143 | |
1144 | - virtual MWRegistryProxy create_registry_proxy(std::string const& identity, std::string const& endpoint) override; |
1145 | + virtual MWRegistryProxy registry_proxy() override; |
1146 | + virtual MWRegistryProxy ss_registry_proxy() override; |
1147 | + |
1148 | virtual MWScopeProxy create_scope_proxy(std::string const& identity) override; |
1149 | virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) override; |
1150 | virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) override; |
1151 | @@ -110,6 +112,8 @@ |
1152 | |
1153 | std::string server_name_; |
1154 | zmqpp::context context_; |
1155 | + MWRegistryProxy registry_proxy_; |
1156 | + MWRegistryProxy ss_registry_proxy_; |
1157 | |
1158 | typedef std::map<std::string, std::shared_ptr<ObjectAdapter>> AdapterMap; |
1159 | AdapterMap am_; |
1160 | |
1161 | === modified file 'scoperegistry/CMakeLists.txt' |
1162 | --- scoperegistry/CMakeLists.txt 2014-03-19 10:03:19 +0000 |
1163 | +++ scoperegistry/CMakeLists.txt 2014-05-08 12:06:13 +0000 |
1164 | @@ -9,4 +9,4 @@ |
1165 | add_executable(scoperegistry ${SRC}) |
1166 | target_link_libraries(scoperegistry ${UNITY_SCOPES_LIB} ${OTHER_LIBS}) |
1167 | |
1168 | -install(TARGETS scoperegistry RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/scoperegistry) |
1169 | +install(TARGETS scoperegistry RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${UNITY_SCOPES_LIB}) |
1170 | |
1171 | === modified file 'scoperegistry/scoperegistry.cpp' |
1172 | --- scoperegistry/scoperegistry.cpp 2014-04-15 04:53:44 +0000 |
1173 | +++ scoperegistry/scoperegistry.cpp 2014-05-08 12:06:13 +0000 |
1174 | @@ -322,22 +322,11 @@ |
1175 | } |
1176 | } |
1177 | |
1178 | -// Overwrite any remote scopes loaded previously with the current ones. |
1179 | - |
1180 | -void load_remote_scopes(RegistryObject::SPtr const& registry, |
1181 | - MiddlewareBase::SPtr const& mw, |
1182 | - string const& ss_reg_id, |
1183 | - string const& ss_reg_endpoint) |
1184 | -{ |
1185 | - auto ss_reg = mw->create_registry_proxy(ss_reg_id, ss_reg_endpoint); |
1186 | - registry->set_remote_registry(ss_reg); |
1187 | -} |
1188 | - |
1189 | } // namespace |
1190 | |
1191 | // Usage: scoperegistry [runtime.ini] [scope.ini]... |
1192 | // |
1193 | -// If no runtime config file is specified, the default location (/usr/share/unity-scopes-api/Runtime.ini) |
1194 | +// If no runtime config file is specified, the default location (/usr/lib/<arch>/unity-scopes/Runtime.ini) |
1195 | // is assumed. |
1196 | // If additional scope configuration files are specified, the corresponding scopes will be added |
1197 | // to the registry (overriding any scopes that are found via config files reached via Runtime.ini). |
1198 | @@ -370,29 +359,22 @@ |
1199 | RuntimeImpl::UPtr runtime = RuntimeImpl::create(rt_config.registry_identity(), config_file); |
1200 | |
1201 | string identity = runtime->registry_identity(); |
1202 | + string ss_reg_id = runtime->ss_registry_identity(); |
1203 | |
1204 | // Collect the registry config data. |
1205 | |
1206 | string mw_kind; |
1207 | - string mw_endpoint; |
1208 | - string mw_configfile; |
1209 | string scope_installdir; |
1210 | string oem_installdir; |
1211 | string click_installdir; |
1212 | string scoperunner_path; |
1213 | - string ss_reg_id; |
1214 | - string ss_reg_endpoint; |
1215 | { |
1216 | RegistryConfig c(identity, runtime->registry_configfile()); |
1217 | mw_kind = c.mw_kind(); |
1218 | - mw_endpoint = c.endpoint(); |
1219 | - mw_configfile = c.mw_configfile(); |
1220 | scope_installdir = c.scope_installdir(); |
1221 | oem_installdir = c.oem_installdir(); |
1222 | click_installdir = c.click_installdir(); |
1223 | scoperunner_path = c.scoperunner_path(); |
1224 | - ss_reg_id = c.ss_registry_identity(); |
1225 | - ss_reg_endpoint = c.ss_registry_endpoint(); |
1226 | } // Release memory for config parser |
1227 | |
1228 | MiddlewareBase::SPtr middleware = runtime->factory()->find(identity, mw_kind); |
1229 | @@ -434,16 +416,16 @@ |
1230 | local_scopes[scope_id] = argv[i]; // operator[] overwrites pre-existing entries |
1231 | } |
1232 | |
1233 | - add_local_scopes(registry, local_scopes, middleware, scoperunner_path, runtime->configfile(), false); |
1234 | - add_local_scopes(registry, click_scopes, middleware, scoperunner_path, runtime->configfile(), true); |
1235 | + add_local_scopes(registry, local_scopes, middleware, scoperunner_path, config_file, false); |
1236 | + add_local_scopes(registry, click_scopes, middleware, scoperunner_path, config_file, true); |
1237 | local_scopes.insert(click_scopes.begin(), click_scopes.end()); |
1238 | - if (ss_reg_id.empty() || ss_reg_endpoint.empty()) |
1239 | + if (ss_reg_id.empty()) |
1240 | { |
1241 | error("no remote registry configured, only local scopes will be available"); |
1242 | } |
1243 | else |
1244 | { |
1245 | - load_remote_scopes(registry, middleware, ss_reg_id, ss_reg_endpoint); |
1246 | + registry->set_remote_registry(middleware->ss_registry_proxy()); |
1247 | } |
1248 | |
1249 | // Let's add the registry's state receiver to the middleware so that scopes can inform |
1250 | |
1251 | === modified file 'scoperunner/CMakeLists.txt' |
1252 | --- scoperunner/CMakeLists.txt 2013-11-29 12:20:25 +0000 |
1253 | +++ scoperunner/CMakeLists.txt 2014-05-08 12:06:13 +0000 |
1254 | @@ -3,4 +3,4 @@ |
1255 | add_executable(scoperunner ${SRC}) |
1256 | target_link_libraries(scoperunner ${UNITY_SCOPES_LIB} ${OTHER_LIBS}) |
1257 | |
1258 | -install(TARGETS scoperunner RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/scoperunner) |
1259 | +install(TARGETS scoperunner RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${UNITY_SCOPES_LIB}) |
1260 | |
1261 | === modified file 'smartscopesproxy/CMakeLists.txt' |
1262 | --- smartscopesproxy/CMakeLists.txt 2014-02-04 10:50:16 +0000 |
1263 | +++ smartscopesproxy/CMakeLists.txt 2014-05-08 12:06:13 +0000 |
1264 | @@ -3,4 +3,4 @@ |
1265 | add_executable(smartscopesproxy ${SRC}) |
1266 | target_link_libraries(smartscopesproxy ${UNITY_SCOPES_LIB} ${OTHER_LIBS}) |
1267 | |
1268 | -install(TARGETS smartscopesproxy RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/smartscopesproxy) |
1269 | +install(TARGETS smartscopesproxy RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${UNITY_SCOPES_LIB}) |
1270 | |
1271 | === modified file 'smartscopesproxy/smartscopesproxy.cpp' |
1272 | --- smartscopesproxy/smartscopesproxy.cpp 2014-04-09 09:51:32 +0000 |
1273 | +++ smartscopesproxy/smartscopesproxy.cpp 2014-05-08 12:06:13 +0000 |
1274 | @@ -17,6 +17,7 @@ |
1275 | */ |
1276 | |
1277 | #include <unity/scopes/internal/RegistryConfig.h> |
1278 | +#include <unity/scopes/internal/RuntimeConfig.h> |
1279 | #include <unity/scopes/internal/RuntimeImpl.h> |
1280 | #include <unity/scopes/internal/smartscopes/SSScopeObject.h> |
1281 | #include <unity/scopes/internal/smartscopes/SSRegistryObject.h> |
1282 | @@ -107,14 +108,14 @@ |
1283 | { |
1284 | SignalThreadWrapper signal_handler; |
1285 | |
1286 | - ///! TODO: get these from config |
1287 | - std::string ss_reg_id = "SSRegistry"; |
1288 | - std::string ss_scope_id = "SmartScope"; |
1289 | - uint const http_reply_timeout = 20000; |
1290 | - uint const ss_reg_refresh_rate = 60 * 60 * 24; // 24 hour refresh (in seconds) |
1291 | + RuntimeConfig rt_config(config_file); |
1292 | + std::string ss_reg_id = rt_config.ss_registry_identity(); |
1293 | + |
1294 | + SSConfig ss_config(rt_config.ss_configfile()); |
1295 | + std::string ss_scope_id = ss_config.scope_identity(); |
1296 | |
1297 | // Instantiate SS registry and scopes runtimes |
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); |
1300 | RuntimeImpl::UPtr scope_rt = RuntimeImpl::create(ss_scope_id, config_file); |
1301 | |
1302 | // Get registry config |
1303 | @@ -133,14 +134,13 @@ |
1304 | }); |
1305 | |
1306 | // Instantiate a SS registry object |
1307 | - SSRegistryObject::SPtr reg(new SSRegistryObject(reg_mw, scope_mw->get_scope_endpoint(), |
1308 | - http_reply_timeout, ss_reg_refresh_rate)); |
1309 | + SSRegistryObject::SPtr reg(new SSRegistryObject(reg_mw, ss_config, scope_mw->get_scope_endpoint())); |
1310 | |
1311 | // Instantiate a SS scope object |
1312 | SSScopeObject::UPtr scope(new SSScopeObject(ss_scope_id, scope_mw, reg)); |
1313 | |
1314 | // Add objects to the middlewares |
1315 | - reg_mw->add_registry_object(reg_rt->registry_identity(), reg); |
1316 | + reg_mw->add_registry_object(reg_rt->ss_registry_identity(), reg); |
1317 | scope_mw->add_dflt_scope_object(std::move(scope)); |
1318 | |
1319 | if (sig_upstart) |
1320 | |
1321 | === modified file 'src/scopes/Runtime.cpp' |
1322 | --- src/scopes/Runtime.cpp 2014-04-03 16:46:00 +0000 |
1323 | +++ src/scopes/Runtime.cpp 2014-05-08 12:06:13 +0000 |
1324 | @@ -62,11 +62,16 @@ |
1325 | return p->registry(); |
1326 | } |
1327 | |
1328 | -void Runtime::run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file) |
1329 | +void Runtime::run_scope(ScopeBase* const scope_base, std::string const& scope_ini_file) |
1330 | { |
1331 | p->run_scope(scope_base, scope_ini_file); |
1332 | } |
1333 | |
1334 | +void Runtime::run_scope(ScopeBase* const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file) |
1335 | +{ |
1336 | + p->run_scope(scope_base, runtime_ini_file, scope_ini_file); |
1337 | +} |
1338 | + |
1339 | ObjectProxy Runtime::string_to_proxy(string const& s) const |
1340 | { |
1341 | return p->string_to_proxy(s); |
1342 | |
1343 | === modified file 'src/scopes/internal/ConfigBase.cpp' |
1344 | --- src/scopes/internal/ConfigBase.cpp 2014-02-26 11:32:43 +0000 |
1345 | +++ src/scopes/internal/ConfigBase.cpp 2014-05-08 12:06:13 +0000 |
1346 | @@ -18,10 +18,15 @@ |
1347 | |
1348 | #include <unity/scopes/internal/ConfigBase.h> |
1349 | |
1350 | +#include <unity/scopes/internal/DfltConfig.h> |
1351 | #include <unity/scopes/ScopeExceptions.h> |
1352 | #include <unity/UnityExceptions.h> |
1353 | #include <unity/util/IniParser.h> |
1354 | |
1355 | +#include <boost/filesystem/path.hpp> |
1356 | + |
1357 | +#include <iostream> |
1358 | +#include <sys/stat.h> |
1359 | |
1360 | using namespace std; |
1361 | |
1362 | @@ -37,13 +42,38 @@ |
1363 | // If configfile is the empty string, we create a default instance that returns "Zmq" for the middleware |
1364 | // and throws for the other methods. |
1365 | |
1366 | -ConfigBase::ConfigBase(string const& configfile) : |
1367 | +ConfigBase::ConfigBase(string const& configfile, string const& dflt_file) : |
1368 | parser_(nullptr), |
1369 | configfile_(configfile) |
1370 | { |
1371 | if (!configfile.empty()) |
1372 | { |
1373 | - parser_ = make_shared<util::IniParser>(configfile.c_str()); |
1374 | + boost::filesystem::path path(configfile); |
1375 | + if (path.extension() != ".ini") |
1376 | + { |
1377 | + throw ConfigException(string("invalid config file name: \"") + configfile + "\": missing .ini extension"); |
1378 | + } |
1379 | + } |
1380 | + if (configfile.empty() || configfile == dflt_file) |
1381 | + { |
1382 | + // No configfile was specified or it was the same as dflt_file. |
1383 | + // We check whether dflt_file exists. If so, we use it. Otherwise, |
1384 | + // we don't have a configfile at all and run with defaults. |
1385 | + if (path_exists(dflt_file)) |
1386 | + { |
1387 | + parser_ = make_shared<util::IniParser>(dflt_file.c_str()); |
1388 | + configfile_ = dflt_file; |
1389 | + } |
1390 | + } |
1391 | + else |
1392 | + { |
1393 | + // The configfile was specified and differs from dflt_file, |
1394 | + // so we use it. |
1395 | + if (configfile != dflt_file) |
1396 | + { |
1397 | + parser_ = make_shared<util::IniParser>(configfile.c_str()); |
1398 | + configfile_ = configfile; |
1399 | + } |
1400 | } |
1401 | } |
1402 | |
1403 | @@ -70,15 +100,19 @@ |
1404 | return val; |
1405 | } |
1406 | |
1407 | -string ConfigBase::get_optional_string(string const& group, string const& key) const |
1408 | +string ConfigBase::get_optional_string(string const& group, string const& key, string const& dflt) const |
1409 | { |
1410 | try |
1411 | { |
1412 | + if (!parser_) |
1413 | + { |
1414 | + return dflt; |
1415 | + } |
1416 | return parser()->get_string(group, key); |
1417 | } |
1418 | catch (unity::LogicException const&) |
1419 | { |
1420 | - return string(); |
1421 | + return dflt; |
1422 | } |
1423 | } |
1424 | |
1425 | @@ -86,9 +120,13 @@ |
1426 | { |
1427 | if (!parser_) |
1428 | { |
1429 | - return "Zmq"; |
1430 | - } |
1431 | - string val = get_string(group, key); |
1432 | + return DFLT_MIDDLEWARE; |
1433 | + } |
1434 | + string val = get_optional_string(group, key); |
1435 | + if (val.empty()) |
1436 | + { |
1437 | + return DFLT_MIDDLEWARE; |
1438 | + } |
1439 | if (val != "Zmq" && val != "REST") |
1440 | { |
1441 | throw_ex("Illegal value for " + key + ": \"" + val + |
1442 | @@ -103,6 +141,50 @@ |
1443 | throw ConfigException(s); |
1444 | } |
1445 | |
1446 | +bool ConfigBase::path_exists(string const& path) const |
1447 | +{ |
1448 | + struct stat st; |
1449 | + return stat(path.c_str(), &st) == 0; |
1450 | +} |
1451 | + |
1452 | +// Check whether a configuration file contains unknown groups |
1453 | +// or unknown keys within a known group. This is useful to catch typos. |
1454 | +// For example, if a config file contains "Smartscopes.Registry.Idenity" instead |
1455 | +// of "Smartscopes.Registry.Identity" (did you spot it?), we print a warning, |
1456 | +// so people don't endlessly scratch their heads as to why the config |
1457 | +// isn't working for them. |
1458 | +// |
1459 | +// KnownEntries is a map of <group, set<key>> pairs that contains |
1460 | +// the known keys for each group. Anything in the config file that |
1461 | +// is not found in the map generates a warning. |
1462 | + |
1463 | +void ConfigBase::check_unknown_entries(KnownEntries const& known_entries) const |
1464 | +{ |
1465 | + if (!parser_) |
1466 | + { |
1467 | + return; |
1468 | + } |
1469 | + auto const groups = parser()->get_groups(); |
1470 | + for (auto const& group : groups) |
1471 | + { |
1472 | + auto const it = known_entries.find(group); |
1473 | + if (it == known_entries.end()) |
1474 | + { |
1475 | + cerr << "warning: ignoring unknown group " << group << " in file " << configfile_ << endl; |
1476 | + continue; |
1477 | + } |
1478 | + auto keys = parser()->get_keys(group); |
1479 | + for (auto const& key : keys) |
1480 | + { |
1481 | + if (it->second.find(key) == it->second.end()) |
1482 | + { |
1483 | + cerr << "warning: ignoring unknown key " << key << " in group " << group |
1484 | + << " in file " << configfile_ << endl; |
1485 | + } |
1486 | + } |
1487 | + } |
1488 | +} |
1489 | + |
1490 | } // namespace internal |
1491 | |
1492 | } // namespace scopes |
1493 | |
1494 | === modified file 'src/scopes/internal/MiddlewareFactory.cpp' |
1495 | --- src/scopes/internal/MiddlewareFactory.cpp 2014-02-04 21:32:07 +0000 |
1496 | +++ src/scopes/internal/MiddlewareFactory.cpp 2014-05-08 12:06:13 +0000 |
1497 | @@ -62,7 +62,7 @@ |
1498 | { |
1499 | case Kind_Zmq: |
1500 | { |
1501 | - mw = make_shared<zmq_middleware::ZmqMiddleware>(server_name, configfile, runtime_); |
1502 | + mw = make_shared<zmq_middleware::ZmqMiddleware>(server_name, runtime_, configfile); |
1503 | break; |
1504 | } |
1505 | case Kind_REST: |
1506 | |
1507 | === modified file 'src/scopes/internal/RegistryConfig.cpp' |
1508 | --- src/scopes/internal/RegistryConfig.cpp 2014-05-08 07:25:37 +0000 |
1509 | +++ src/scopes/internal/RegistryConfig.cpp 2014-05-08 12:06:13 +0000 |
1510 | @@ -18,6 +18,7 @@ |
1511 | |
1512 | #include <unity/scopes/internal/RegistryConfig.h> |
1513 | |
1514 | +#include <unity/scopes/internal/DfltConfig.h> |
1515 | #include <unity/scopes/ScopeExceptions.h> |
1516 | #include <unity/UnityExceptions.h> |
1517 | |
1518 | @@ -32,23 +33,30 @@ |
1519 | namespace internal |
1520 | { |
1521 | |
1522 | -constexpr char const* RegistryConfig::REGISTRY_CONFIG_GROUP; |
1523 | +namespace |
1524 | +{ |
1525 | + const string registry_config_group = "Registry"; |
1526 | + const string mw_kind_key = "Middleware"; |
1527 | + const string configfile_key = ".ConfigFile"; |
1528 | + const string scope_installdir_key = "Scope.InstallDir"; |
1529 | + const string oem_installdir_key = "OEM.InstallDir"; |
1530 | + const string click_installdir_key = "Click.InstallDir"; |
1531 | + const string scoperunner_path_key = "Scoperunner.Path"; |
1532 | +} |
1533 | |
1534 | RegistryConfig::RegistryConfig(string const& identity, string const& configfile) : |
1535 | - ConfigBase(configfile) |
1536 | + ConfigBase(configfile, DFLT_REGISTRY_INI) |
1537 | { |
1538 | identity_ = identity; |
1539 | if (identity.empty()) |
1540 | { |
1541 | throw InvalidArgumentException("Registry identity cannot be an empty string"); |
1542 | } |
1543 | - mw_kind_ = get_middleware(REGISTRY_CONFIG_GROUP, "Middleware"); |
1544 | - endpointdir_ = get_string(REGISTRY_CONFIG_GROUP, mw_kind_ + ".EndpointDir"); |
1545 | - endpoint_ = get_string(REGISTRY_CONFIG_GROUP, mw_kind_ + ".Endpoint"); |
1546 | - mw_configfile_ = get_string(REGISTRY_CONFIG_GROUP, mw_kind_ + ".ConfigFile"); |
1547 | - scope_installdir_ = get_string(REGISTRY_CONFIG_GROUP, "Scope.InstallDir"); |
1548 | - oem_installdir_ = get_optional_string(REGISTRY_CONFIG_GROUP, "OEM.InstallDir"); |
1549 | - click_installdir_ = get_optional_string(REGISTRY_CONFIG_GROUP, "Click.InstallDir"); |
1550 | + mw_kind_ = get_middleware(registry_config_group, mw_kind_key); |
1551 | + mw_configfile_ = get_optional_string(registry_config_group, mw_kind_ + configfile_key); |
1552 | + scope_installdir_ = get_optional_string(registry_config_group, scope_installdir_key, DFLT_SCOPE_INSTALL_DIR); |
1553 | + oem_installdir_ = get_optional_string(registry_config_group, oem_installdir_key, DFLT_OEM_INSTALL_DIR); |
1554 | + click_installdir_ = get_optional_string(registry_config_group, click_installdir_key); |
1555 | if (click_installdir_.empty()) |
1556 | { |
1557 | char const* home = getenv("HOME"); |
1558 | @@ -58,13 +66,25 @@ |
1559 | } |
1560 | click_installdir_ = string(home) + "/.local/share/unity-scopes/"; |
1561 | } |
1562 | - scoperunner_path_ = get_string(REGISTRY_CONFIG_GROUP, "Scoperunner.Path"); |
1563 | + scoperunner_path_ = get_optional_string(registry_config_group, scoperunner_path_key, DFLT_SCOPERUNNER_PATH); |
1564 | if (scoperunner_path_[0] != '/') |
1565 | { |
1566 | - throw ConfigException(configfile + ": Scoperunner.Path must be an absolute path"); |
1567 | + throw ConfigException(configfile + ": " + scoperunner_path_key + " must be an absolute path"); |
1568 | } |
1569 | - ss_registry_identity_ = get_optional_string(REGISTRY_CONFIG_GROUP, "SS.Registry.Identity"); |
1570 | - ss_registry_endpoint_ = get_optional_string(REGISTRY_CONFIG_GROUP, "SS.Registry.Endpoint"); |
1571 | + |
1572 | + const KnownEntries known_entries = { |
1573 | + { registry_config_group, |
1574 | + { |
1575 | + mw_kind_key, |
1576 | + mw_kind_ + configfile_key, |
1577 | + scope_installdir_key, |
1578 | + oem_installdir_key, |
1579 | + click_installdir_key, |
1580 | + scoperunner_path_key, |
1581 | + } |
1582 | + } |
1583 | + }; |
1584 | + check_unknown_entries(known_entries); |
1585 | } |
1586 | |
1587 | RegistryConfig::~RegistryConfig() |
1588 | @@ -81,16 +101,6 @@ |
1589 | return mw_kind_; |
1590 | } |
1591 | |
1592 | -string RegistryConfig::endpointdir() const |
1593 | -{ |
1594 | - return endpointdir_; |
1595 | -} |
1596 | - |
1597 | -string RegistryConfig::endpoint() const |
1598 | -{ |
1599 | - return endpoint_; |
1600 | -} |
1601 | - |
1602 | string RegistryConfig::mw_configfile() const |
1603 | { |
1604 | return mw_configfile_; |
1605 | @@ -116,16 +126,6 @@ |
1606 | return scoperunner_path_; |
1607 | } |
1608 | |
1609 | -string RegistryConfig::ss_registry_identity() const |
1610 | -{ |
1611 | - return ss_registry_identity_; |
1612 | -} |
1613 | - |
1614 | -string RegistryConfig::ss_registry_endpoint() const |
1615 | -{ |
1616 | - return ss_registry_endpoint_; |
1617 | -} |
1618 | - |
1619 | } // namespace internal |
1620 | |
1621 | } // namespace scopes |
1622 | |
1623 | === modified file 'src/scopes/internal/RegistryObject.cpp' |
1624 | --- src/scopes/internal/RegistryObject.cpp 2014-04-15 04:53:44 +0000 |
1625 | +++ src/scopes/internal/RegistryObject.cpp 2014-05-08 12:06:13 +0000 |
1626 | @@ -90,25 +90,36 @@ |
1627 | |
1628 | ScopeMetadata RegistryObject::get_metadata(std::string const& scope_id) const |
1629 | { |
1630 | - lock_guard<decltype(mutex_)> lock(mutex_); |
1631 | - // If the id is empty, it was sent as empty by the remote client. |
1632 | if (scope_id.empty()) |
1633 | { |
1634 | + // If the id is empty, it was sent as empty by the remote client. |
1635 | throw unity::InvalidArgumentException("RegistryObject::get_metadata(): Cannot search for scope with empty id"); |
1636 | } |
1637 | |
1638 | // Look for the scope in both the local and the remote map. |
1639 | - // Local scopes take precedence over remote ones of the same |
1640 | - // id. (Ideally, this should never happen.) |
1641 | - auto const& scope_it = scopes_.find(scope_id); |
1642 | - if (scope_it != scopes_.end()) |
1643 | + // Local scopes take precedence over remote ones of the same id. |
1644 | + // (Ideally, this should never happen.) |
1645 | { |
1646 | - return scope_it->second; |
1647 | + lock_guard<decltype(mutex_)> lock(mutex_); |
1648 | + auto const& scope_it = scopes_.find(scope_id); |
1649 | + if (scope_it != scopes_.end()) |
1650 | + { |
1651 | + return scope_it->second; |
1652 | + } |
1653 | } |
1654 | + // Unlock, so we don't call the remote registry while holding a lock. |
1655 | |
1656 | if (remote_registry_) |
1657 | { |
1658 | - return remote_registry_->get_metadata(scope_id); |
1659 | + try |
1660 | + { |
1661 | + return remote_registry_->get_metadata(scope_id); |
1662 | + } |
1663 | + catch (std::exception const& e) |
1664 | + { |
1665 | + cerr << "cannot get metdata from remote registry: " << e.what() << endl; |
1666 | + // TODO: log error |
1667 | + } |
1668 | } |
1669 | |
1670 | throw NotFoundException("RegistryObject::get_metadata(): no such scope: ", scope_id); |
1671 | @@ -116,16 +127,28 @@ |
1672 | |
1673 | MetadataMap RegistryObject::list() const |
1674 | { |
1675 | - lock_guard<decltype(mutex_)> lock(mutex_); |
1676 | - MetadataMap all_scopes(scopes_); // Local scopes |
1677 | + MetadataMap all_scopes; // Local scopes |
1678 | + { |
1679 | + lock_guard<decltype(mutex_)> lock(mutex_); |
1680 | + all_scopes = scopes_; // Local scopes |
1681 | + } |
1682 | + // Unlock, so we don't call the remote registry while holding a lock. |
1683 | |
1684 | // If a remote scope has the same id as a local one, |
1685 | // this will not overwrite a local scope with a remote |
1686 | // one if they have the same id. |
1687 | if (remote_registry_) |
1688 | { |
1689 | - MetadataMap remote_scopes = remote_registry_->list(); |
1690 | - all_scopes.insert(remote_scopes.begin(), remote_scopes.end()); |
1691 | + try |
1692 | + { |
1693 | + MetadataMap remote_scopes = remote_registry_->list(); |
1694 | + all_scopes.insert(remote_scopes.begin(), remote_scopes.end()); |
1695 | + } |
1696 | + catch (std::exception const& e) |
1697 | + { |
1698 | + cerr << "cannot get scopes list from remote registry: " << e.what() << endl; |
1699 | + // TODO: log error |
1700 | + } |
1701 | } |
1702 | |
1703 | return all_scopes; |
1704 | @@ -133,22 +156,23 @@ |
1705 | |
1706 | ObjectProxy RegistryObject::locate(std::string const& identity) |
1707 | { |
1708 | - decltype(scopes_.cbegin()) scope_it; |
1709 | - decltype(scope_processes_.begin()) proc_it; |
1710 | + // If the id is empty, it was sent as empty by the remote client. |
1711 | + if (identity.empty()) |
1712 | + { |
1713 | + throw unity::InvalidArgumentException("RegistryObject::locate(): Cannot locate scope with empty id"); |
1714 | + } |
1715 | |
1716 | + ObjectProxy proxy; |
1717 | + ProcessMap::iterator proc_it; |
1718 | { |
1719 | lock_guard<decltype(mutex_)> lock(mutex_); |
1720 | - // If the id is empty, it was sent as empty by the remote client. |
1721 | - if (identity.empty()) |
1722 | - { |
1723 | - throw unity::InvalidArgumentException("RegistryObject::locate(): Cannot locate scope with empty id"); |
1724 | - } |
1725 | |
1726 | - scope_it = scopes_.find(identity); |
1727 | + auto scope_it = scopes_.find(identity); |
1728 | if (scope_it == scopes_.end()) |
1729 | { |
1730 | throw NotFoundException("RegistryObject::locate(): Tried to locate unknown local scope", identity); |
1731 | } |
1732 | + proxy = scope_it->second.proxy(); |
1733 | |
1734 | proc_it = scope_processes_.find(identity); |
1735 | if (proc_it == scope_processes_.end()) |
1736 | @@ -157,15 +181,15 @@ |
1737 | } |
1738 | } |
1739 | |
1740 | + // Exec after unlocking, so we can start processing another locate() |
1741 | proc_it->second.exec(death_observer_, executor_); |
1742 | - return scope_it->second.proxy(); |
1743 | + |
1744 | + return proxy; |
1745 | } |
1746 | |
1747 | bool RegistryObject::add_local_scope(std::string const& scope_id, ScopeMetadata const& metadata, |
1748 | ScopeExecData const& exec_data) |
1749 | { |
1750 | - lock_guard<decltype(mutex_)> lock(mutex_); |
1751 | - bool return_value = true; |
1752 | if (scope_id.empty()) |
1753 | { |
1754 | throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot add scope with empty id"); |
1755 | @@ -175,6 +199,9 @@ |
1756 | throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot create a scope with '/' in its id"); |
1757 | } |
1758 | |
1759 | + lock_guard<decltype(mutex_)> lock(mutex_); |
1760 | + |
1761 | + bool return_value = true; |
1762 | if (scopes_.find(scope_id) != scopes_.end()) |
1763 | { |
1764 | scopes_.erase(scope_id); |
1765 | @@ -188,7 +215,6 @@ |
1766 | |
1767 | bool RegistryObject::remove_local_scope(std::string const& scope_id) |
1768 | { |
1769 | - lock_guard<decltype(mutex_)> lock(mutex_); |
1770 | // If the id is empty, it was sent as empty by the remote client. |
1771 | if (scope_id.empty()) |
1772 | { |
1773 | @@ -196,6 +222,8 @@ |
1774 | "with empty id"); |
1775 | } |
1776 | |
1777 | + lock_guard<decltype(mutex_)> lock(mutex_); |
1778 | + |
1779 | scope_processes_.erase(scope_id); |
1780 | return scopes_.erase(scope_id) == 1; |
1781 | } |
1782 | @@ -208,6 +236,8 @@ |
1783 | |
1784 | bool RegistryObject::is_scope_running(std::string const& scope_id) |
1785 | { |
1786 | + lock_guard<decltype(mutex_)> lock(mutex_); |
1787 | + |
1788 | auto it = scope_processes_.find(scope_id); |
1789 | if (it != scope_processes_.end()) |
1790 | { |
1791 | @@ -224,14 +254,16 @@ |
1792 | |
1793 | void RegistryObject::on_process_death(core::posix::Process const& process) |
1794 | { |
1795 | - // the death observer has signaled that a child has died. |
1796 | - // broadcast this message to each scope process until we have found the process in question. |
1797 | - // (this is slightly more efficient than just connecting the signal to every scope process) |
1798 | + // The death observer has signaled that a child has died. |
1799 | + // Broadcast this message to each scope process until we have found the process in question. |
1800 | + // (This is slightly more efficient than just connecting the signal to every scope process.) |
1801 | pid_t pid = process.pid(); |
1802 | for (auto& scope_process : scope_processes_) |
1803 | { |
1804 | if (scope_process.second.on_process_death(pid)) |
1805 | + { |
1806 | break; |
1807 | + } |
1808 | } |
1809 | } |
1810 | |
1811 | |
1812 | === modified file 'src/scopes/internal/RuntimeConfig.cpp' |
1813 | --- src/scopes/internal/RuntimeConfig.cpp 2014-02-05 13:08:06 +0000 |
1814 | +++ src/scopes/internal/RuntimeConfig.cpp 2014-05-08 12:06:13 +0000 |
1815 | @@ -20,6 +20,7 @@ |
1816 | |
1817 | #include <unity/scopes/internal/DfltConfig.h> |
1818 | #include <unity/UnityExceptions.h> |
1819 | +#include <iostream> // TODO: remove this |
1820 | |
1821 | using namespace std; |
1822 | |
1823 | @@ -32,14 +33,15 @@ |
1824 | namespace internal |
1825 | { |
1826 | |
1827 | -const char* RuntimeConfig::RUNTIME_CONFIG_GROUP = "Runtime"; |
1828 | - |
1829 | namespace |
1830 | { |
1831 | - const string registry_identity_str = "Registry.Identity"; |
1832 | - const string registry_configfile_str = "Registry.ConfigFile"; |
1833 | - const string default_middleware_str = "Default.Middleware"; |
1834 | - const string default_middleware_configfile_str = "ConfigFile"; |
1835 | + const string runtime_config_group = "Runtime"; |
1836 | + const string registry_identity_key = "Registry.Identity"; |
1837 | + const string registry_configfile_key = "Registry.ConfigFile"; |
1838 | + const string ss_registry_identity_key = "Smartscopes.Registry.Identity"; |
1839 | + const string ss_configfile_key = "Smartscopes.ConfigFile"; |
1840 | + const string default_middleware_key = "Default.Middleware"; |
1841 | + const string default_middleware_configfile_key = ".ConfigFile"; |
1842 | } |
1843 | |
1844 | RuntimeConfig::RuntimeConfig(string const& configfile) : |
1845 | @@ -47,25 +49,38 @@ |
1846 | { |
1847 | if (configfile.empty()) // Default config |
1848 | { |
1849 | - registry_identity_ = "Registry"; |
1850 | + registry_identity_ = DFLT_REGISTRY_ID; |
1851 | registry_configfile_ = DFLT_REGISTRY_INI; |
1852 | - default_middleware_ = "Zmq"; |
1853 | - default_middleware_configfile_ = "Zmq.ini"; |
1854 | + ss_registry_identity_ = DFLT_SS_REGISTRY_ID; |
1855 | + ss_configfile_ = DFLT_SS_INI; |
1856 | + default_middleware_ = DFLT_MIDDLEWARE; |
1857 | + default_middleware_configfile_ = DFLT_ZMQ_MIDDLEWARE_INI; |
1858 | } |
1859 | else |
1860 | { |
1861 | - registry_identity_ = get_optional_string(RUNTIME_CONFIG_GROUP, registry_identity_str); |
1862 | - auto pos = registry_identity_.find_first_of("@:/"); |
1863 | - if (pos != string::npos) |
1864 | - { |
1865 | - throw_ex("Illegal character in value for " + registry_identity_str + ": \"" + registry_identity_ + |
1866 | - "\": identity cannot contain '" + registry_identity_[pos] + "'"); |
1867 | - } |
1868 | - registry_configfile_ = get_optional_string(RUNTIME_CONFIG_GROUP, registry_configfile_str); |
1869 | - default_middleware_ = get_middleware(RUNTIME_CONFIG_GROUP, default_middleware_str); |
1870 | - default_middleware_configfile_ = get_string(RUNTIME_CONFIG_GROUP, |
1871 | - default_middleware_ + "." + default_middleware_configfile_str); |
1872 | + registry_identity_ = get_optional_string(runtime_config_group, registry_identity_key); |
1873 | + registry_configfile_ = get_optional_string(runtime_config_group, registry_configfile_key); |
1874 | + ss_configfile_ = get_optional_string(runtime_config_group, ss_configfile_key); |
1875 | + ss_registry_identity_ = get_optional_string(runtime_config_group, ss_registry_identity_key); |
1876 | + default_middleware_ = get_middleware(runtime_config_group, default_middleware_key); |
1877 | + default_middleware_configfile_ = get_optional_string(runtime_config_group, |
1878 | + default_middleware_ + default_middleware_configfile_key, |
1879 | + DFLT_MIDDLEWARE_INI); |
1880 | } |
1881 | + |
1882 | + const KnownEntries known_entries = { |
1883 | + { runtime_config_group, |
1884 | + { |
1885 | + registry_identity_key, |
1886 | + registry_configfile_key, |
1887 | + ss_registry_identity_key, |
1888 | + ss_configfile_key, |
1889 | + default_middleware_key, |
1890 | + default_middleware_ + default_middleware_configfile_key |
1891 | + } |
1892 | + } |
1893 | + }; |
1894 | + check_unknown_entries(known_entries); |
1895 | } |
1896 | |
1897 | RuntimeConfig::~RuntimeConfig() |
1898 | @@ -82,6 +97,16 @@ |
1899 | return registry_configfile_; |
1900 | } |
1901 | |
1902 | +string RuntimeConfig::ss_registry_identity() const |
1903 | +{ |
1904 | + return ss_registry_identity_; |
1905 | +} |
1906 | + |
1907 | +string RuntimeConfig::ss_configfile() const |
1908 | +{ |
1909 | + return ss_configfile_; |
1910 | +} |
1911 | + |
1912 | string RuntimeConfig::default_middleware() const |
1913 | { |
1914 | return default_middleware_; |
1915 | |
1916 | === modified file 'src/scopes/internal/RuntimeImpl.cpp' |
1917 | --- src/scopes/internal/RuntimeImpl.cpp 2014-04-28 06:24:24 +0000 |
1918 | +++ src/scopes/internal/RuntimeImpl.cpp 2014-05-08 12:06:13 +0000 |
1919 | @@ -64,18 +64,17 @@ |
1920 | scope_id_ = "c-" + id.gen(); |
1921 | } |
1922 | |
1923 | - string config_file(configfile.empty() ? DFLT_RUNTIME_INI : configfile); |
1924 | - configfile_ = config_file; |
1925 | - |
1926 | try |
1927 | { |
1928 | // Create the middleware factory and get the registry identity and config filename. |
1929 | - RuntimeConfig config(config_file); |
1930 | + RuntimeConfig config(configfile); |
1931 | string default_middleware = config.default_middleware(); |
1932 | string middleware_configfile = config.default_middleware_configfile(); |
1933 | middleware_factory_.reset(new MiddlewareFactory(this)); |
1934 | registry_configfile_ = config.registry_configfile(); |
1935 | registry_identity_ = config.registry_identity(); |
1936 | + ss_configfile_ = config.ss_configfile(); |
1937 | + ss_registry_identity_ = config.ss_registry_identity(); |
1938 | |
1939 | middleware_ = middleware_factory_->create(scope_id_, default_middleware, middleware_configfile); |
1940 | middleware_->start(); |
1941 | @@ -91,18 +90,15 @@ |
1942 | } |
1943 | else |
1944 | { |
1945 | - // Create the registry proxy. |
1946 | + // Create the registry proxy |
1947 | RegistryConfig reg_config(registry_identity_, registry_configfile_); |
1948 | - string reg_mw_configfile = reg_config.mw_configfile(); |
1949 | - registry_endpoint_ = reg_config.endpoint(); |
1950 | - registry_endpointdir_ = reg_config.endpointdir(); |
1951 | - auto registry_mw_proxy = middleware_->create_registry_proxy(registry_identity_, registry_endpoint_); |
1952 | + auto registry_mw_proxy = middleware_->registry_proxy(); |
1953 | registry_ = make_shared<RegistryImpl>(registry_mw_proxy, this); |
1954 | } |
1955 | } |
1956 | catch (unity::Exception const& e) |
1957 | { |
1958 | - throw ConfigException("Cannot instantiate run time for " + scope_id + ", config file: " + config_file); |
1959 | + throw ConfigException("Cannot instantiate run time for " + scope_id_ + ", config file: " + configfile); |
1960 | } |
1961 | } |
1962 | |
1963 | @@ -169,8 +165,6 @@ |
1964 | middleware_->wait_for_shutdown(); |
1965 | middleware_ = nullptr; |
1966 | middleware_factory_.reset(nullptr); |
1967 | - |
1968 | - registry_ = nullptr; |
1969 | } |
1970 | |
1971 | string RuntimeImpl::scope_id() const |
1972 | @@ -179,11 +173,6 @@ |
1973 | return scope_id_; |
1974 | } |
1975 | |
1976 | -string RuntimeImpl::configfile() const |
1977 | -{ |
1978 | - return configfile_; |
1979 | -} |
1980 | - |
1981 | MiddlewareFactory const* RuntimeImpl::factory() const |
1982 | { |
1983 | lock_guard<mutex> lock(mutex_); |
1984 | @@ -212,26 +201,22 @@ |
1985 | |
1986 | string RuntimeImpl::registry_configfile() const |
1987 | { |
1988 | - lock_guard<mutex> lock(mutex_); |
1989 | - return registry_configfile_; |
1990 | + return registry_configfile_; // Immutable |
1991 | } |
1992 | |
1993 | string RuntimeImpl::registry_identity() const |
1994 | { |
1995 | - lock_guard<mutex> lock(mutex_); |
1996 | - return registry_identity_; |
1997 | -} |
1998 | - |
1999 | -string RuntimeImpl::registry_endpointdir() const |
2000 | -{ |
2001 | - lock_guard<mutex> lock(mutex_); |
2002 | - return registry_endpointdir_; |
2003 | -} |
2004 | - |
2005 | -string RuntimeImpl::registry_endpoint() const |
2006 | -{ |
2007 | - lock_guard<mutex> lock(mutex_); |
2008 | - return registry_endpoint_; |
2009 | + return registry_identity_; // Immutable |
2010 | +} |
2011 | + |
2012 | +string RuntimeImpl::ss_configfile() const |
2013 | +{ |
2014 | + return ss_configfile_; // Immutable |
2015 | +} |
2016 | + |
2017 | +string RuntimeImpl::ss_registry_identity() const |
2018 | +{ |
2019 | + return ss_registry_identity_; // Immutable |
2020 | } |
2021 | |
2022 | Reaper::SPtr RuntimeImpl::reply_reaper() const |
2023 | @@ -270,15 +255,19 @@ |
2024 | |
2025 | ThreadSafeQueue<future<void>>::SPtr RuntimeImpl::future_queue() const |
2026 | { |
2027 | - lock_guard<mutex> lock(mutex_); |
2028 | - return future_queue_; |
2029 | -} |
2030 | - |
2031 | -void RuntimeImpl::run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file) |
2032 | + return future_queue_; // Immutable |
2033 | +} |
2034 | + |
2035 | +void RuntimeImpl::run_scope(ScopeBase *const scope_base, string const& scope_ini_file) |
2036 | +{ |
2037 | + run_scope(scope_base, "", scope_ini_file); |
2038 | +} |
2039 | + |
2040 | +void RuntimeImpl::run_scope(ScopeBase *const scope_base, string const& runtime_ini_file, string const& scope_ini_file) |
2041 | { |
2042 | // Retrieve the registry middleware and create a proxy to its state receiver |
2043 | RegistryConfig reg_conf(registry_identity_, registry_configfile_); |
2044 | - auto reg_runtime = create(registry_identity_, configfile_); |
2045 | + auto reg_runtime = create(registry_identity_, runtime_ini_file); |
2046 | auto reg_mw = reg_runtime->factory()->find(registry_identity_, reg_conf.mw_kind()); |
2047 | auto reg_state_receiver = reg_mw->create_state_receiver_proxy("StateReceiver"); |
2048 | |
2049 | @@ -286,8 +275,8 @@ |
2050 | |
2051 | { |
2052 | // dirname modifies its argument, so we need a copy of scope lib path |
2053 | - std::vector<char> scope_ini(scope_ini_file.c_str(), scope_ini_file.c_str() + scope_ini_file.size() + 1); |
2054 | - const std::string scope_dir(dirname(&scope_ini[0])); |
2055 | + vector<char> scope_ini(scope_ini_file.c_str(), scope_ini_file.c_str() + scope_ini_file.size() + 1); |
2056 | + const string scope_dir(dirname(&scope_ini[0])); |
2057 | scope_base->p->set_scope_directory(scope_dir); |
2058 | } |
2059 | |
2060 | |
2061 | === modified file 'src/scopes/internal/ScopeConfig.cpp' |
2062 | --- src/scopes/internal/ScopeConfig.cpp 2014-04-23 13:26:03 +0000 |
2063 | +++ src/scopes/internal/ScopeConfig.cpp 2014-05-08 12:06:13 +0000 |
2064 | @@ -37,16 +37,19 @@ |
2065 | |
2066 | namespace |
2067 | { |
2068 | - const string overrideable_str = "Override"; |
2069 | - const string scope_name_str = "DisplayName"; |
2070 | - const string description_str = "Description"; |
2071 | - const string author_str = "Author"; |
2072 | - const string art_str = "Art"; |
2073 | - const string icon_str = "Icon"; |
2074 | - const string search_hint_str = "SearchHint"; |
2075 | - const string hot_key_str = "HotKey"; |
2076 | - const string invisible_str = "Invisible"; |
2077 | - const string scope_runner_exec = "ScopeRunner"; |
2078 | + const string scope_config_group = "ScopeConfig"; |
2079 | + const string overrideable_key = "Override"; |
2080 | + const string scope_name_key = "DisplayName"; |
2081 | + const string description_key = "Description"; |
2082 | + const string author_key = "Author"; |
2083 | + const string art_key = "Art"; |
2084 | + const string icon_key = "Icon"; |
2085 | + const string search_hint_key = "SearchHint"; |
2086 | + const string hot_key_key = "HotKey"; |
2087 | + const string invisible_key = "Invisible"; |
2088 | + const string scoperunner_key = "ScopeRunner"; |
2089 | + |
2090 | + const string scope_appearance_group = "Appearance"; |
2091 | } |
2092 | |
2093 | ScopeConfig::ScopeConfig(string const& configfile) : |
2094 | @@ -54,23 +57,23 @@ |
2095 | { |
2096 | try |
2097 | { |
2098 | - overrideable_ = parser()->get_boolean(SCOPE_CONFIG_GROUP, overrideable_str); |
2099 | + overrideable_ = parser()->get_boolean(scope_config_group, overrideable_key); |
2100 | } |
2101 | catch (LogicException const&) |
2102 | { |
2103 | overrideable_ = false; |
2104 | } |
2105 | |
2106 | - display_name_ = parser()->get_locale_string(SCOPE_CONFIG_GROUP, scope_name_str); |
2107 | - description_ = parser()->get_locale_string(SCOPE_CONFIG_GROUP, description_str); |
2108 | - author_ = parser()->get_string(SCOPE_CONFIG_GROUP, author_str); |
2109 | + display_name_ = parser()->get_locale_string(scope_config_group, scope_name_key); |
2110 | + description_ = parser()->get_locale_string(scope_config_group, description_key); |
2111 | + author_ = parser()->get_string(scope_config_group, author_key); |
2112 | |
2113 | // For optional values, we store them in a unique_ptr so we can distinguish the "not set at all" case |
2114 | // from the "explicitly set to empty string" case. parser()->get_string throws LogicException if |
2115 | // the key is not present, so we ignore the exception for optional values. |
2116 | try |
2117 | { |
2118 | - string art = parser()->get_string(SCOPE_CONFIG_GROUP, art_str); |
2119 | + string art = parser()->get_string(scope_config_group, art_key); |
2120 | art_.reset(new string(art)); |
2121 | } |
2122 | catch (LogicException const&) |
2123 | @@ -78,7 +81,7 @@ |
2124 | } |
2125 | try |
2126 | { |
2127 | - string icon = parser()->get_string(SCOPE_CONFIG_GROUP, icon_str); |
2128 | + string icon = parser()->get_string(scope_config_group, icon_key); |
2129 | icon_.reset(new string(icon)); |
2130 | } |
2131 | catch (LogicException const&) |
2132 | @@ -86,7 +89,7 @@ |
2133 | } |
2134 | try |
2135 | { |
2136 | - string hint = parser()->get_locale_string(SCOPE_CONFIG_GROUP, search_hint_str); |
2137 | + string hint = parser()->get_locale_string(scope_config_group, search_hint_key); |
2138 | search_hint_.reset(new string(hint)); |
2139 | } |
2140 | catch (LogicException const&) |
2141 | @@ -94,7 +97,7 @@ |
2142 | } |
2143 | try |
2144 | { |
2145 | - string key = parser()->get_string(SCOPE_CONFIG_GROUP, hot_key_str); |
2146 | + string key = parser()->get_string(scope_config_group, hot_key_key); |
2147 | hot_key_.reset(new string(key)); |
2148 | } |
2149 | catch (LogicException const&) |
2150 | @@ -102,35 +105,58 @@ |
2151 | } |
2152 | try |
2153 | { |
2154 | - string key = parser()->get_string(SCOPE_CONFIG_GROUP, invisible_str); |
2155 | - std::transform(begin(key), end(key), begin(key), ::toupper); |
2156 | - invisible_.reset(new bool(key == "TRUE")); |
2157 | + invisible_ = parser()->get_boolean(scope_config_group, invisible_key); |
2158 | } |
2159 | catch (LogicException const&) |
2160 | { |
2161 | + invisible_ = false; |
2162 | } |
2163 | |
2164 | // custom scope runner executable is optional |
2165 | try |
2166 | { |
2167 | - string key = parser()->get_string(SCOPE_CONFIG_GROUP, scope_runner_exec); |
2168 | + string key = parser()->get_string(scope_config_group, scoperunner_key); |
2169 | scope_runner_.reset(new string(key)); |
2170 | } |
2171 | catch (LogicException const&) |
2172 | { |
2173 | } |
2174 | |
2175 | - // read all display attributes from SCOPE_DISPLAY_GROUP config group |
2176 | + // read all display attributes from scope_appearance_group |
2177 | try |
2178 | { |
2179 | - for (auto const& key: parser()->get_keys(SCOPE_DISPLAY_GROUP)) |
2180 | + for (auto const& key: parser()->get_keys(scope_appearance_group)) |
2181 | { |
2182 | - appearance_attributes_[key] = parser()->get_string(SCOPE_DISPLAY_GROUP, key); |
2183 | + appearance_attributes_[key] = parser()->get_string(scope_appearance_group, key); |
2184 | } |
2185 | } |
2186 | catch (LogicException const&) |
2187 | { |
2188 | } |
2189 | + |
2190 | + const KnownEntries known_entries = { |
2191 | + { scope_config_group, |
2192 | + { |
2193 | + overrideable_key, |
2194 | + scope_name_key, |
2195 | + description_key, |
2196 | + author_key, |
2197 | + art_key, |
2198 | + icon_key, |
2199 | + search_hint_key, |
2200 | + invisible_key, |
2201 | + hot_key_key, |
2202 | + scoperunner_key |
2203 | + } |
2204 | + }, |
2205 | + // TODO: once we know what appearance attributes are supported, |
2206 | + // we need to add them here. |
2207 | + { scope_appearance_group, |
2208 | + { |
2209 | + } |
2210 | + } |
2211 | + }; |
2212 | + check_unknown_entries(known_entries); |
2213 | } |
2214 | |
2215 | ScopeConfig::~ScopeConfig() |
2216 | @@ -161,7 +187,7 @@ |
2217 | { |
2218 | if (!art_) |
2219 | { |
2220 | - throw NotFoundException("Art not set", art_str); |
2221 | + throw NotFoundException("Art not set", art_key); |
2222 | } |
2223 | return *art_; |
2224 | } |
2225 | @@ -170,7 +196,7 @@ |
2226 | { |
2227 | if (!icon_) |
2228 | { |
2229 | - throw NotFoundException("Icon not set", icon_str); |
2230 | + throw NotFoundException("Icon not set", icon_key); |
2231 | } |
2232 | return *icon_; |
2233 | } |
2234 | @@ -179,7 +205,7 @@ |
2235 | { |
2236 | if (!search_hint_) |
2237 | { |
2238 | - throw NotFoundException("Hint not set", search_hint_str); |
2239 | + throw NotFoundException("Hint not set", search_hint_key); |
2240 | } |
2241 | return *search_hint_; |
2242 | } |
2243 | @@ -188,25 +214,21 @@ |
2244 | { |
2245 | if (!hot_key_) |
2246 | { |
2247 | - throw NotFoundException("Key not set", hot_key_str); |
2248 | + throw NotFoundException("Key not set", hot_key_key); |
2249 | } |
2250 | return *hot_key_; |
2251 | } |
2252 | |
2253 | bool ScopeConfig::invisible() const |
2254 | { |
2255 | - if (!invisible_) |
2256 | - { |
2257 | - return false; |
2258 | - } |
2259 | - return *invisible_; |
2260 | + return invisible_; |
2261 | } |
2262 | |
2263 | string ScopeConfig::scope_runner() const |
2264 | { |
2265 | if (!scope_runner_) |
2266 | { |
2267 | - throw NotFoundException("Runner binary not set", scope_runner_exec); |
2268 | + throw NotFoundException("Runner binary not set", scoperunner_key); |
2269 | } |
2270 | return *scope_runner_; |
2271 | } |
2272 | |
2273 | === modified file 'src/scopes/internal/smartscopes/CMakeLists.txt' |
2274 | --- src/scopes/internal/smartscopes/CMakeLists.txt 2014-02-13 07:43:40 +0000 |
2275 | +++ src/scopes/internal/smartscopes/CMakeLists.txt 2014-05-08 12:06:13 +0000 |
2276 | @@ -1,4 +1,5 @@ |
2277 | set(SRC |
2278 | + ${CMAKE_CURRENT_SOURCE_DIR}/SSConfig.cpp |
2279 | ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryCtrlObject.cpp |
2280 | ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryObject.cpp |
2281 | ${CMAKE_CURRENT_SOURCE_DIR}/SSRegistryObject.cpp |
2282 | |
2283 | === added file 'src/scopes/internal/smartscopes/SSConfig.cpp' |
2284 | --- src/scopes/internal/smartscopes/SSConfig.cpp 1970-01-01 00:00:00 +0000 |
2285 | +++ src/scopes/internal/smartscopes/SSConfig.cpp 2014-05-08 12:06:13 +0000 |
2286 | @@ -0,0 +1,129 @@ |
2287 | +/* |
2288 | + * Copyright (C) 2014 Canonical Ltd |
2289 | + * |
2290 | + * This program is free software: you can redistribute it and/or modify |
2291 | + * it under the terms of the GNU Lesser General Public License version 3 as |
2292 | + * published by the Free Software Foundation. |
2293 | + * |
2294 | + * This program is distributed in the hope that it will be useful, |
2295 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2296 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2297 | + * GNU Lesser General Public License for more details. |
2298 | + * |
2299 | + * You should have received a copy of the GNU Lesser General Public License |
2300 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2301 | + * |
2302 | + * Authored by: Michi Henning <michi.henning@canonical.com> |
2303 | + */ |
2304 | + |
2305 | +#include <unity/scopes/internal/smartscopes/SSConfig.h> |
2306 | + |
2307 | +#include <unity/scopes/internal/DfltConfig.h> |
2308 | +#include <unity/scopes/ScopeExceptions.h> |
2309 | + |
2310 | +#include <unistd.h> |
2311 | + |
2312 | +#include <unity/UnityExceptions.h> // TODO: remove this in config-fixes-stage2 merge proposal |
2313 | + |
2314 | +using namespace std; |
2315 | + |
2316 | +namespace unity |
2317 | +{ |
2318 | + |
2319 | +namespace scopes |
2320 | +{ |
2321 | + |
2322 | +namespace internal |
2323 | +{ |
2324 | + |
2325 | +namespace smartscopes |
2326 | +{ |
2327 | + |
2328 | +namespace |
2329 | +{ |
2330 | + const string ss_config_group = "Smartscopes"; |
2331 | + const string http_reply_timeout_key = "Http.Reply.Timeout"; |
2332 | + const string reg_refresh_rate_key = "Registry.Refresh.Rate"; |
2333 | + const string reg_refresh_fail_timeout_key = "Registry.Refresh.Fail.Timeout"; |
2334 | + const string scope_identity_key = "Scope.Identity"; |
2335 | +} |
2336 | + |
2337 | +SSConfig::SSConfig(string const& configfile) : |
2338 | + ConfigBase(configfile, DFLT_SS_INI) |
2339 | +{ |
2340 | + if (configfile.empty()) |
2341 | + { |
2342 | + http_reply_timeout_ = DFLT_SS_HTTP_TIMEOUT; |
2343 | + reg_refresh_rate_ = DFLT_SS_REG_REFRESH_RATE; |
2344 | + reg_refresh_fail_timeout_ = DFLT_SS_REG_REFRESH_FAIL_TIMEOUT; |
2345 | + scope_identity_ = DFLT_SS_SCOPE_IDENTITY; |
2346 | + } |
2347 | + else |
2348 | + { |
2349 | + // TODO: replace code below with commented-out lines as part of config-fixes-stage2 merge proposal: |
2350 | + // http_reply_timeout_ = get_optional_int(ss_config_group, http_reply_timeout_key, DFLT_SS_HTTP_TIMEOUT); |
2351 | + // reg_refresh_rate_ = get_optional_int(ss_config_group, reg_refresh_rate_key, DFLT_SS_REG_REFRESH); |
2352 | + // reg_refresh_fail_timeout_ = get_optional_int(ss_config_group, |
2353 | + // reg_refresh_fail_timeout_key, |
2354 | + // DFLT_SS_REG_REFRESH_FAIL_TIMEOUT); |
2355 | + // scope_identity_ = get_optional_int(ss_config_group, scope_identity_key, DFLT_SS_SCOPE_IDENTITY); |
2356 | + try |
2357 | + { |
2358 | + http_reply_timeout_ = parser()->get_int(ss_config_group, http_reply_timeout_key); |
2359 | + reg_refresh_rate_ = parser()->get_int(ss_config_group, reg_refresh_rate_key); |
2360 | + reg_refresh_fail_timeout_ = parser()->get_int(ss_config_group, reg_refresh_fail_timeout_key); |
2361 | + scope_identity_ = parser()->get_int(ss_config_group, scope_identity_key); |
2362 | + } |
2363 | + catch (unity::LogicException const&) |
2364 | + { |
2365 | + http_reply_timeout_ = DFLT_SS_HTTP_TIMEOUT; |
2366 | + reg_refresh_rate_ = DFLT_SS_REG_REFRESH_RATE; |
2367 | + reg_refresh_fail_timeout_ = DFLT_SS_REG_REFRESH_FAIL_TIMEOUT; |
2368 | + scope_identity_ = DFLT_SS_SCOPE_IDENTITY; |
2369 | + } |
2370 | + } |
2371 | + |
2372 | + const KnownEntries known_entries = { |
2373 | + { ss_config_group, |
2374 | + { |
2375 | + http_reply_timeout_key, |
2376 | + reg_refresh_rate_key, |
2377 | + reg_refresh_fail_timeout_key, |
2378 | + scope_identity_key, |
2379 | + } |
2380 | + } |
2381 | + }; |
2382 | + check_unknown_entries(known_entries); |
2383 | +} |
2384 | + |
2385 | +SSConfig::~SSConfig() |
2386 | +{ |
2387 | +} |
2388 | + |
2389 | +int SSConfig::http_reply_timeout() const |
2390 | +{ |
2391 | + return http_reply_timeout_; |
2392 | +} |
2393 | + |
2394 | +int SSConfig::reg_refresh_rate() const |
2395 | +{ |
2396 | + return reg_refresh_rate_; |
2397 | +} |
2398 | + |
2399 | +int SSConfig::reg_refresh_fail_timeout() const |
2400 | +{ |
2401 | + return reg_refresh_fail_timeout_; |
2402 | +} |
2403 | + |
2404 | +string SSConfig::scope_identity() const |
2405 | +{ |
2406 | + return scope_identity_; |
2407 | +} |
2408 | + |
2409 | +} // namespace smartscopes |
2410 | + |
2411 | +} // namespace internal |
2412 | + |
2413 | +} // namespace scopes |
2414 | + |
2415 | +} // namespace unity |
2416 | |
2417 | === modified file 'src/scopes/internal/smartscopes/SSRegistryObject.cpp' |
2418 | --- src/scopes/internal/smartscopes/SSRegistryObject.cpp 2014-04-03 12:57:25 +0000 |
2419 | +++ src/scopes/internal/smartscopes/SSRegistryObject.cpp 2014-05-08 12:06:13 +0000 |
2420 | @@ -28,7 +28,6 @@ |
2421 | |
2422 | #include <iostream> |
2423 | |
2424 | -static const uint c_failed_refresh_timeout = 10; ///! TODO get from config |
2425 | static const char* c_dbussend_cmd = "dbus-send /com/canonical/unity/scopes com.canonical.unity.scopes.InvalidateResults string:smart-scopes"; |
2426 | |
2427 | namespace unity |
2428 | @@ -44,19 +43,19 @@ |
2429 | { |
2430 | |
2431 | SSRegistryObject::SSRegistryObject(MiddlewareBase::SPtr middleware, |
2432 | + SSConfig const& ss_config, |
2433 | std::string const& ss_scope_endpoint, |
2434 | - uint http_reply_timeout, |
2435 | - uint refresh_rate_in_sec, |
2436 | std::string const& sss_url, |
2437 | bool caching_enabled) |
2438 | : ssclient_(std::make_shared<SmartScopesClient>( |
2439 | - std::make_shared<HttpClientQt>(http_reply_timeout), |
2440 | + std::make_shared<HttpClientQt>(ss_config.http_reply_timeout() * 1000), // need millisecs |
2441 | std::make_shared<JsonCppNode>(), sss_url)) |
2442 | , refresh_stopped_(false) |
2443 | , middleware_(middleware) |
2444 | , ss_scope_endpoint_(ss_scope_endpoint) |
2445 | - , regular_refresh_timeout_(refresh_rate_in_sec) |
2446 | - , next_refresh_timeout_(refresh_rate_in_sec) |
2447 | + , regular_refresh_timeout_(ss_config.reg_refresh_rate()) |
2448 | + , next_refresh_timeout_(ss_config.reg_refresh_rate()) |
2449 | + , failed_refresh_timeout_(ss_config.reg_refresh_fail_timeout()) |
2450 | , caching_enabled_(caching_enabled) |
2451 | { |
2452 | // get remote scopes then start the auto-refresh background thread |
2453 | @@ -183,14 +182,14 @@ |
2454 | } |
2455 | else |
2456 | { |
2457 | - next_refresh_timeout_ = c_failed_refresh_timeout; |
2458 | + next_refresh_timeout_ = failed_refresh_timeout_; |
2459 | } |
2460 | } |
2461 | catch (std::exception const& e) |
2462 | { |
2463 | std::cerr << e.what() << std::endl; |
2464 | // refresh again soon as get_remote_scopes failed |
2465 | - next_refresh_timeout_ = c_failed_refresh_timeout; |
2466 | + next_refresh_timeout_ = failed_refresh_timeout_; |
2467 | return; |
2468 | } |
2469 | |
2470 | |
2471 | === modified file 'src/scopes/internal/zmq_middleware/ZmqConfig.cpp' |
2472 | --- src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2014-01-23 11:28:34 +0000 |
2473 | +++ src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2014-05-08 12:06:13 +0000 |
2474 | @@ -18,6 +18,11 @@ |
2475 | |
2476 | #include <unity/scopes/internal/zmq_middleware/ZmqConfig.h> |
2477 | |
2478 | +#include <unity/scopes/internal/DfltConfig.h> |
2479 | +#include <unity/scopes/ScopeExceptions.h> |
2480 | + |
2481 | +#include <unistd.h> |
2482 | + |
2483 | using namespace std; |
2484 | |
2485 | namespace unity |
2486 | @@ -29,27 +34,43 @@ |
2487 | namespace internal |
2488 | { |
2489 | |
2490 | -const char* ZmqConfig::ZMQ_CONFIG_GROUP = "Zmq"; |
2491 | - |
2492 | namespace |
2493 | { |
2494 | - const string public_dir_str = "EndpointDir.Public"; |
2495 | - const string private_dir_str = "EndpointDir.Private"; |
2496 | + const string zmq_config_group = "Zmq"; |
2497 | + const string public_dir_key = "EndpointDir"; |
2498 | } |
2499 | |
2500 | ZmqConfig::ZmqConfig(string const& configfile) : |
2501 | - ConfigBase(configfile) |
2502 | + ConfigBase(configfile, DFLT_ZMQ_MIDDLEWARE_INI) |
2503 | { |
2504 | - if (configfile.empty()) |
2505 | - { |
2506 | - public_dir_ = "/tmp"; |
2507 | - private_dir_ = "/tmp"; |
2508 | - } |
2509 | - else |
2510 | - { |
2511 | - public_dir_ = get_string(ZMQ_CONFIG_GROUP, public_dir_str); |
2512 | - private_dir_ = get_string(ZMQ_CONFIG_GROUP, private_dir_str); |
2513 | - } |
2514 | + if (!configfile.empty()) |
2515 | + { |
2516 | + public_dir_ = get_optional_string(zmq_config_group, public_dir_key); |
2517 | + } |
2518 | + |
2519 | + // Set the endpoint directory if it was not set explicitly. |
2520 | + // We look for the XDG_RUNTIME_DIR env variable. If that is not |
2521 | + // set, we give up. |
2522 | + if (public_dir_.empty()) |
2523 | + { |
2524 | + char* xdg_runtime_dir = secure_getenv("XDG_RUNTIME_DIR"); |
2525 | + if (!xdg_runtime_dir || *xdg_runtime_dir == '\0') |
2526 | + { |
2527 | + throw ConfigException("No endpoint directories specified, and XDG_RUNTIME_DIR " |
2528 | + "environment variable not set"); |
2529 | + } |
2530 | + public_dir_ = string(xdg_runtime_dir) + "/zmq"; |
2531 | + } |
2532 | + private_dir_ = public_dir_ + "/priv"; |
2533 | + |
2534 | + const KnownEntries known_entries = { |
2535 | + { zmq_config_group, |
2536 | + { |
2537 | + public_dir_key |
2538 | + } |
2539 | + } |
2540 | + }; |
2541 | + check_unknown_entries(known_entries); |
2542 | } |
2543 | |
2544 | ZmqConfig::~ZmqConfig() |
2545 | |
2546 | === modified file 'src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp' |
2547 | --- src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2014-04-28 06:24:24 +0000 |
2548 | +++ src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2014-05-08 12:06:13 +0000 |
2549 | @@ -40,6 +40,7 @@ |
2550 | #include <unity/UnityExceptions.h> |
2551 | |
2552 | #include <iostream> // TODO: remove this once logging is added |
2553 | +#include <sys/stat.h> |
2554 | |
2555 | using namespace std; |
2556 | |
2557 | @@ -70,9 +71,22 @@ |
2558 | char const* scope_category = "Scope"; // scope adapter category name |
2559 | char const* registry_category = "Registry"; // registry adapter category name |
2560 | |
2561 | +// Create a directory with mode rwx------t if it doesn't exist yet. |
2562 | +// We set the sticky bit to prevent the directory from being deleted: |
2563 | +// if it happens to be under $XDG_RUNTIME_DIR and is not accessed |
2564 | +// for more than six hours, the system may delete it. |
2565 | + |
2566 | +void create_dir(string const& dir) |
2567 | +{ |
2568 | + if (mkdir(dir.c_str(), 0700 | S_ISVTX) == -1 && errno != EEXIST) |
2569 | + { |
2570 | + throw FileException("cannot create endpoint directory " + dir, errno); |
2571 | + } |
2572 | +} |
2573 | + |
2574 | } // namespace |
2575 | |
2576 | -ZmqMiddleware::ZmqMiddleware(string const& server_name, string const& configfile, RuntimeImpl* runtime) |
2577 | +ZmqMiddleware::ZmqMiddleware(string const& server_name, RuntimeImpl* runtime, string const& configfile) |
2578 | try : |
2579 | MiddlewareBase(runtime), |
2580 | server_name_(server_name), |
2581 | @@ -82,6 +96,17 @@ |
2582 | locate_timeout_(2000) // TODO: get timeout from config |
2583 | { |
2584 | assert(!server_name.empty()); |
2585 | + |
2586 | + // Create the endpoint dirs if they don't exist. |
2587 | + try |
2588 | + { |
2589 | + create_dir(config_.public_dir()); |
2590 | + create_dir(config_.private_dir()); |
2591 | + } |
2592 | + catch (...) |
2593 | + { |
2594 | + throw MiddlewareException("cannot initialize zmq middleware for scope " + server_name); |
2595 | + } |
2596 | } |
2597 | catch (zmqpp::exception const& e) |
2598 | { |
2599 | @@ -347,90 +372,63 @@ |
2600 | return proxy->to_string(); |
2601 | } |
2602 | |
2603 | -MWRegistryProxy ZmqMiddleware::create_registry_proxy(string const& identity, string const& endpoint) |
2604 | -{ |
2605 | - MWRegistryProxy proxy; |
2606 | - try |
2607 | - { |
2608 | - proxy.reset(new ZmqRegistry(this, endpoint, identity, registry_category, twoway_timeout_)); |
2609 | - } |
2610 | - catch (zmqpp::exception const& e) |
2611 | - { |
2612 | - rethrow_zmq_ex(e); |
2613 | - } |
2614 | - return proxy; |
2615 | +MWRegistryProxy ZmqMiddleware::registry_proxy() |
2616 | +{ |
2617 | + lock_guard<mutex> lock(data_mutex_); |
2618 | + |
2619 | + if (!registry_proxy_) |
2620 | + { |
2621 | + string r_id = runtime()->registry_identity(); // May be empty, if no registry is configured. |
2622 | + if (!r_id.empty()) |
2623 | + { |
2624 | + string r_endp = "ipc://" + config_.public_dir() + "/" + r_id; |
2625 | + registry_proxy_.reset(new ZmqRegistry(this, r_endp, r_id, registry_category, twoway_timeout_)); |
2626 | + } |
2627 | + } |
2628 | + return registry_proxy_; |
2629 | +} |
2630 | + |
2631 | +MWRegistryProxy ZmqMiddleware::ss_registry_proxy() |
2632 | +{ |
2633 | + lock_guard<mutex> lock(data_mutex_); |
2634 | + |
2635 | + if (!ss_registry_proxy_) |
2636 | + { |
2637 | + string ssr_id = runtime()->ss_registry_identity(); // May be empty, if no registry is configured. |
2638 | + if (!ssr_id.empty()) |
2639 | + { |
2640 | + string ssr_endp = "ipc://" + config_.public_dir() + "/" + ssr_id; |
2641 | + ss_registry_proxy_.reset(new ZmqRegistry(this, ssr_endp, ssr_id, registry_category, twoway_timeout_)); |
2642 | + } |
2643 | + } |
2644 | + return ss_registry_proxy_; |
2645 | } |
2646 | |
2647 | MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity) |
2648 | { |
2649 | - MWScopeProxy proxy; |
2650 | - try |
2651 | - { |
2652 | - string endpoint = "ipc://" + config_.private_dir() + "/" + identity; |
2653 | - proxy.reset(new ZmqScope(this, endpoint, identity, scope_category, twoway_timeout_)); |
2654 | - } |
2655 | - catch (zmqpp::exception const& e) |
2656 | - { |
2657 | - rethrow_zmq_ex(e); |
2658 | - } |
2659 | - return proxy; |
2660 | + string endpoint = "ipc://" + config_.private_dir() + "/" + identity; |
2661 | + return make_shared<ZmqScope>(this, endpoint, identity, scope_category, twoway_timeout_); |
2662 | } |
2663 | |
2664 | MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity, string const& endpoint) |
2665 | { |
2666 | - MWScopeProxy proxy; |
2667 | - try |
2668 | - { |
2669 | - proxy.reset(new ZmqScope(this, endpoint, identity, scope_category, twoway_timeout_)); |
2670 | - } |
2671 | - catch (zmqpp::exception const& e) |
2672 | - { |
2673 | - rethrow_zmq_ex(e); |
2674 | - } |
2675 | - return proxy; |
2676 | + return make_shared<ZmqScope>(this, endpoint, identity, scope_category, twoway_timeout_); |
2677 | } |
2678 | |
2679 | MWQueryProxy ZmqMiddleware::create_query_proxy(string const& identity, string const& endpoint) |
2680 | { |
2681 | - MWQueryProxy proxy; |
2682 | - try |
2683 | - { |
2684 | - proxy.reset(new ZmqQuery(this, endpoint, identity, query_category)); |
2685 | - } |
2686 | - catch (zmqpp::exception const& e) |
2687 | - { |
2688 | - rethrow_zmq_ex(e); |
2689 | - } |
2690 | - return proxy; |
2691 | + return make_shared<ZmqQuery>(this, endpoint, identity, query_category); |
2692 | } |
2693 | |
2694 | MWQueryCtrlProxy ZmqMiddleware::create_query_ctrl_proxy(string const& identity, string const& endpoint) |
2695 | { |
2696 | - MWQueryCtrlProxy proxy; |
2697 | - try |
2698 | - { |
2699 | - proxy.reset(new ZmqQueryCtrl(this, endpoint, identity, ctrl_category)); |
2700 | - } |
2701 | - catch (zmqpp::exception const& e) |
2702 | - { |
2703 | - rethrow_zmq_ex(e); |
2704 | - } |
2705 | - return proxy; |
2706 | + return make_shared<ZmqQueryCtrl>(this, endpoint, identity, ctrl_category); |
2707 | } |
2708 | |
2709 | MWStateReceiverProxy ZmqMiddleware::create_state_receiver_proxy(std::string const& identity) |
2710 | { |
2711 | - MWStateReceiverProxy proxy; |
2712 | - try |
2713 | - { |
2714 | - proxy.reset(new ZmqStateReceiver(this, "ipc://" + config_.private_dir() + "/" + server_name_ + state_suffix, |
2715 | - identity, state_category)); |
2716 | - } |
2717 | - catch (zmqpp::exception const& e) |
2718 | - { |
2719 | - rethrow_zmq_ex(e); |
2720 | - } |
2721 | - return proxy; |
2722 | + string endpoint = "ipc://" + config_.private_dir() + "/" + server_name_ + state_suffix; |
2723 | + return make_shared<ZmqStateReceiver>(this, endpoint, identity, state_category); |
2724 | } |
2725 | |
2726 | MWQueryCtrlProxy ZmqMiddleware::add_query_ctrl_object(QueryCtrlObjectBase::SPtr const& ctrl) |
2727 | @@ -526,7 +524,7 @@ |
2728 | try |
2729 | { |
2730 | shared_ptr<RegistryI> ri(make_shared<RegistryI>(registry)); |
2731 | - auto adapter = find_adapter(server_name_, runtime()->registry_endpointdir(), registry_category); |
2732 | + auto adapter = find_adapter(server_name_, config_.public_dir(), registry_category); |
2733 | function<void()> df; |
2734 | auto p = safe_add(df, adapter, identity, ri); |
2735 | registry->set_disconnect_function(df); |
2736 | |
2737 | === modified file 'src/scopes/internal/zmq_middleware/ZmqObject.cpp' |
2738 | --- src/scopes/internal/zmq_middleware/ZmqObject.cpp 2014-04-17 05:59:48 +0000 |
2739 | +++ src/scopes/internal/zmq_middleware/ZmqObject.cpp 2014-05-08 12:06:13 +0000 |
2740 | @@ -47,9 +47,6 @@ |
2741 | { |
2742 | // this mutex protects all members of all ZmqObjectProxies |
2743 | std::mutex shared_mutex; |
2744 | - |
2745 | - // There is only one registry proxy, so share it across all ZmqObjectProxies |
2746 | - ZmqRegistryProxy shared_reg_proxy = nullptr; |
2747 | } |
2748 | |
2749 | #define MONITOR_ENDPOINT "ipc:///tmp/scopes-monitor" |
2750 | @@ -217,40 +214,16 @@ |
2751 | } |
2752 | catch (TimeoutException const&) |
2753 | { |
2754 | - // retrieve the registry proxy if we haven't already done so |
2755 | - { |
2756 | - lock_guard<mutex> lock(shared_mutex); |
2757 | - if (!shared_reg_proxy) |
2758 | - { |
2759 | - auto runtime = mw_base() ? mw_base()->runtime() : nullptr; |
2760 | - if (!runtime) |
2761 | - { |
2762 | - throw; |
2763 | - } |
2764 | - |
2765 | - // we must do this via lazy initialization as attempting to do this in |
2766 | - // the constructor causes a deadlock when accessing runtime methods |
2767 | - shared_reg_proxy = dynamic_pointer_cast<ZmqRegistry>(mw_base()->create_registry_proxy( |
2768 | - runtime->registry_identity(), |
2769 | - runtime->registry_endpoint())); |
2770 | - |
2771 | - // this really shouldn't happen but if we do fail to retrieve the |
2772 | - // registry proxy, just rethrow the exception |
2773 | - if (!shared_reg_proxy) |
2774 | - { |
2775 | - throw; |
2776 | - } |
2777 | - } |
2778 | - } |
2779 | - |
2780 | - // if this object is the registry itself, rethrow the exception |
2781 | - if (identity() == shared_reg_proxy->identity()) |
2782 | + auto registry_proxy = mw_base()->registry_proxy(); |
2783 | + |
2784 | + // If no registry is configured or if this object is the registry itself, rethrow the exception |
2785 | + if (!registry_proxy || identity() == registry_proxy->identity()) |
2786 | { |
2787 | throw; |
2788 | } |
2789 | |
2790 | // rebind |
2791 | - ObjectProxy new_proxy = shared_reg_proxy->locate(identity()); |
2792 | + ObjectProxy new_proxy = registry_proxy->locate(identity()); |
2793 | |
2794 | // update our proxy with the newly received data |
2795 | // (we need to first store values in local variables outside of the mutex, |
2796 | @@ -312,7 +285,7 @@ |
2797 | // If a request times out, we must trash the corresponding socket, otherwise |
2798 | // zmq gets confused: the reply will never be read, so the socket ends up |
2799 | // in a bad state. |
2800 | - // (removing a socket from the connection pool deletes it, hense closing the socket) |
2801 | + // (Removing a socket from the connection pool deletes it, hence closing the socket.) |
2802 | pool.remove(endpoint); |
2803 | throw TimeoutException("Request timed out after " + std::to_string(timeout) + " milliseconds"); |
2804 | } |
2805 | |
2806 | === modified file 'test/gtest/scopes/Activation/Activation_test.cpp' |
2807 | --- test/gtest/scopes/Activation/Activation_test.cpp 2014-04-15 05:36:38 +0000 |
2808 | +++ test/gtest/scopes/Activation/Activation_test.cpp 2014-05-08 12:06:13 +0000 |
2809 | @@ -513,7 +513,7 @@ |
2810 | |
2811 | RaiiScopeThread(std::string const& scope_id, std::string const& configfile) |
2812 | : runtime(Runtime::create_scope_runtime(scope_id, configfile)), |
2813 | - scope_thread([this]{ runtime->run_scope(&scope, "/foo"); }) {} |
2814 | + scope_thread([this, configfile]{ runtime->run_scope(&scope, configfile, "/foo"); }) {} |
2815 | |
2816 | ~RaiiScopeThread() |
2817 | { |
2818 | |
2819 | === modified file 'test/gtest/scopes/Activation/Registry.ini.in' |
2820 | --- test/gtest/scopes/Activation/Registry.ini.in 2014-04-08 08:26:44 +0000 |
2821 | +++ test/gtest/scopes/Activation/Registry.ini.in 2014-05-08 12:06:13 +0000 |
2822 | @@ -1,7 +1,5 @@ |
2823 | [Registry] |
2824 | Middleware = Zmq |
2825 | -Zmq.Endpoint = ipc:///tmp/socket_for_registry |
2826 | -Zmq.EndpointDir = /tmp |
2827 | Zmq.ConfigFile = Zmq.ini |
2828 | Scope.InstallDir = /unused |
2829 | Click.InstallDir = /unused |
2830 | |
2831 | === modified file 'test/gtest/scopes/Activation/Zmq.ini.in' |
2832 | --- test/gtest/scopes/Activation/Zmq.ini.in 2014-01-14 17:31:16 +0000 |
2833 | +++ test/gtest/scopes/Activation/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
2834 | @@ -1,3 +1,2 @@ |
2835 | [Zmq] |
2836 | -EndpointDir.Public = /tmp |
2837 | -EndpointDir.Private = /tmp |
2838 | +EndpointDir = /tmp |
2839 | |
2840 | === modified file 'test/gtest/scopes/Filters/Filters_test.cpp' |
2841 | --- test/gtest/scopes/Filters/Filters_test.cpp 2014-04-15 05:36:38 +0000 |
2842 | +++ test/gtest/scopes/Filters/Filters_test.cpp 2014-05-08 12:06:13 +0000 |
2843 | @@ -80,7 +80,7 @@ |
2844 | |
2845 | RaiiScopeThread(std::string const& scope_id, std::string const& configfile) |
2846 | : runtime(Runtime::create_scope_runtime(scope_id, configfile)), |
2847 | - scope_thread([this]{ runtime->run_scope(&scope, "/foo"); }) {} |
2848 | + scope_thread([this, configfile]{ runtime->run_scope(&scope, configfile, "/foo"); }) {} |
2849 | |
2850 | ~RaiiScopeThread() |
2851 | { |
2852 | |
2853 | === modified file 'test/gtest/scopes/Filters/Registry.ini.in' |
2854 | --- test/gtest/scopes/Filters/Registry.ini.in 2014-04-08 08:26:44 +0000 |
2855 | +++ test/gtest/scopes/Filters/Registry.ini.in 2014-05-08 12:06:13 +0000 |
2856 | @@ -1,7 +1,5 @@ |
2857 | [Registry] |
2858 | Middleware = Zmq |
2859 | -Zmq.Endpoint = ipc:///tmp/socket_for_registry |
2860 | -Zmq.EndpointDir = /tmp |
2861 | Zmq.ConfigFile = Zmq.ini |
2862 | Scope.InstallDir = /unused |
2863 | Click.InstallDir = /unused |
2864 | |
2865 | === modified file 'test/gtest/scopes/Filters/Zmq.ini.in' |
2866 | --- test/gtest/scopes/Filters/Zmq.ini.in 2014-01-24 12:51:40 +0000 |
2867 | +++ test/gtest/scopes/Filters/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
2868 | @@ -1,3 +1,2 @@ |
2869 | [Zmq] |
2870 | -EndpointDir.Public = /tmp |
2871 | -EndpointDir.Private = /tmp |
2872 | +EndpointDir = /tmp |
2873 | |
2874 | === modified file 'test/gtest/scopes/Invocation/Invocation_test.cpp' |
2875 | --- test/gtest/scopes/Invocation/Invocation_test.cpp 2014-05-05 09:21:30 +0000 |
2876 | +++ test/gtest/scopes/Invocation/Invocation_test.cpp 2014-05-08 12:06:13 +0000 |
2877 | @@ -120,10 +120,10 @@ |
2878 | EXPECT_EQ("", receiver->error_message()); |
2879 | } |
2880 | |
2881 | -void scope_thread(Runtime::SPtr const& rt) |
2882 | +void scope_thread(Runtime::SPtr const& rt, string const& runtime_ini_file) |
2883 | { |
2884 | TestScope scope; |
2885 | - rt->run_scope(&scope, "/foo"); |
2886 | + rt->run_scope(&scope, runtime_ini_file, "/foo"); |
2887 | } |
2888 | |
2889 | int main(int argc, char **argv) |
2890 | @@ -131,7 +131,7 @@ |
2891 | ::testing::InitGoogleTest(&argc, argv); |
2892 | |
2893 | Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini")); |
2894 | - std::thread scope_t(scope_thread, srt); |
2895 | + std::thread scope_t(scope_thread, srt, "Runtime.ini"); |
2896 | |
2897 | // Give thread some time to bind to its endpoint, to avoid getting ObjectNotExistException |
2898 | // from a synchronous remote call. |
2899 | |
2900 | === modified file 'test/gtest/scopes/Invocation/Registry.ini.in' |
2901 | --- test/gtest/scopes/Invocation/Registry.ini.in 2014-04-17 01:36:29 +0000 |
2902 | +++ test/gtest/scopes/Invocation/Registry.ini.in 2014-05-08 12:06:13 +0000 |
2903 | @@ -1,7 +1,5 @@ |
2904 | [Registry] |
2905 | Middleware = Zmq |
2906 | -Zmq.Endpoint = ipc:///tmp/socket_for_registry |
2907 | -Zmq.EndpointDir = /tmp |
2908 | Zmq.ConfigFile = Zmq.ini |
2909 | Scope.InstallDir = /unused |
2910 | Click.InstallDir = /unused |
2911 | |
2912 | === modified file 'test/gtest/scopes/Invocation/Zmq.ini.in' |
2913 | --- test/gtest/scopes/Invocation/Zmq.ini.in 2014-04-17 01:36:29 +0000 |
2914 | +++ test/gtest/scopes/Invocation/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
2915 | @@ -1,3 +1,2 @@ |
2916 | [Zmq] |
2917 | -EndpointDir.Public = /tmp |
2918 | -EndpointDir.Private = /tmp |
2919 | +EndpointDir = /tmp |
2920 | |
2921 | === modified file 'test/gtest/scopes/Registry/RegistryTest.ini.in' |
2922 | --- test/gtest/scopes/Registry/RegistryTest.ini.in 2014-04-08 08:26:44 +0000 |
2923 | +++ test/gtest/scopes/Registry/RegistryTest.ini.in 2014-05-08 12:06:13 +0000 |
2924 | @@ -1,7 +1,5 @@ |
2925 | [Registry] |
2926 | Middleware = Zmq |
2927 | -Zmq.Endpoint = ipc:///tmp/RegistryTest |
2928 | -Zmq.EndpointDir = /tmp |
2929 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini |
2930 | Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes |
2931 | OEM.InstallDir = /unused |
2932 | |
2933 | === modified file 'test/gtest/scopes/Registry/Registry_test.cpp' |
2934 | --- test/gtest/scopes/Registry/Registry_test.cpp 2014-05-05 11:20:55 +0000 |
2935 | +++ test/gtest/scopes/Registry/Registry_test.cpp 2014-05-08 12:06:13 +0000 |
2936 | @@ -80,11 +80,13 @@ |
2937 | // wait for the registry to become available on middleware |
2938 | // FIXME: remove this once we have async queries and can set arbitrary timeout when calling registry |
2939 | const int num_retries = 10; |
2940 | + bool registry_started = false; |
2941 | for (int i = 0; i < num_retries; ++i) |
2942 | { |
2943 | try |
2944 | { |
2945 | r->list(); // this will throw if the registry is not yet available on middleware |
2946 | + registry_started = true; |
2947 | break; |
2948 | } |
2949 | catch (std::exception const&) |
2950 | @@ -92,6 +94,7 @@ |
2951 | sleep(1); |
2952 | } |
2953 | } |
2954 | + ASSERT_TRUE(registry_started); |
2955 | |
2956 | auto meta = r->get_metadata("testscopeA"); |
2957 | EXPECT_EQ("testscopeA", meta.scope_id()); |
2958 | |
2959 | === modified file 'test/gtest/scopes/Registry/Runtime.ini.in' |
2960 | --- test/gtest/scopes/Registry/Runtime.ini.in 2014-04-03 16:50:44 +0000 |
2961 | +++ test/gtest/scopes/Registry/Runtime.ini.in 2014-05-08 12:06:13 +0000 |
2962 | @@ -3,3 +3,4 @@ |
2963 | Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/RegistryTest.ini |
2964 | Default.Middleware = Zmq |
2965 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini |
2966 | +Smartscopes.Registry.Identity = |
2967 | |
2968 | === modified file 'test/gtest/scopes/Registry/Zmq.ini.in' |
2969 | --- test/gtest/scopes/Registry/Zmq.ini.in 2014-04-01 16:58:32 +0000 |
2970 | +++ test/gtest/scopes/Registry/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
2971 | @@ -1,3 +1,2 @@ |
2972 | [Zmq] |
2973 | -EndpointDir.Public = /tmp |
2974 | -EndpointDir.Private = /tmp |
2975 | +EndpointDir = /tmp |
2976 | |
2977 | === modified file 'test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp' |
2978 | --- test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp 2014-04-14 05:11:28 +0000 |
2979 | +++ test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp 2014-05-08 12:06:13 +0000 |
2980 | @@ -102,6 +102,6 @@ |
2981 | |
2982 | MyScope scope; |
2983 | auto runtime = Runtime::create_scope_runtime("testscopeB", rt_config); |
2984 | - runtime->run_scope(&scope, scope_config); |
2985 | + runtime->run_scope(&scope, rt_config, scope_config); |
2986 | return 0; |
2987 | } |
2988 | |
2989 | === modified file 'test/gtest/scopes/Runtime/Registry.ini.in' |
2990 | --- test/gtest/scopes/Runtime/Registry.ini.in 2014-04-08 08:26:44 +0000 |
2991 | +++ test/gtest/scopes/Runtime/Registry.ini.in 2014-05-08 12:06:13 +0000 |
2992 | @@ -1,7 +1,5 @@ |
2993 | [Registry] |
2994 | Middleware = Zmq |
2995 | -Zmq.Endpoint = ipc:///tmp/socket_for_registry |
2996 | -Zmq.EndpointDir = /tmp |
2997 | Zmq.ConfigFile = Zmq.ini |
2998 | Scope.InstallDir = /unused |
2999 | Click.InstallDir = /unused |
3000 | |
3001 | === modified file 'test/gtest/scopes/Runtime/Runtime_test.cpp' |
3002 | --- test/gtest/scopes/Runtime/Runtime_test.cpp 2014-04-17 07:17:31 +0000 |
3003 | +++ test/gtest/scopes/Runtime/Runtime_test.cpp 2014-05-08 12:06:13 +0000 |
3004 | @@ -382,22 +382,22 @@ |
3005 | this_thread::sleep_for(chrono::milliseconds(200)); |
3006 | } |
3007 | |
3008 | -void scope_thread(Runtime::SPtr const& rt) |
3009 | +void scope_thread(Runtime::SPtr const& rt, string const& runtime_ini_file) |
3010 | { |
3011 | TestScope scope; |
3012 | - rt->run_scope(&scope, "/foo"); |
3013 | + rt->run_scope(&scope, runtime_ini_file, "/foo"); |
3014 | } |
3015 | |
3016 | -void pusher_thread(Runtime::SPtr const& rt) |
3017 | +void pusher_thread(Runtime::SPtr const& rt, string const& runtime_ini_file) |
3018 | { |
3019 | PusherScope scope; |
3020 | - rt->run_scope(&scope, "/foo"); |
3021 | + rt->run_scope(&scope, runtime_ini_file, "/foo"); |
3022 | } |
3023 | |
3024 | -void slow_create_thread(Runtime::SPtr const& rt) |
3025 | +void slow_create_thread(Runtime::SPtr const& rt, string const& runtime_ini_file) |
3026 | { |
3027 | SlowCreateScope scope; |
3028 | - rt->run_scope(&scope, "/foo"); |
3029 | + rt->run_scope(&scope, runtime_ini_file, "/foo"); |
3030 | } |
3031 | |
3032 | int main(int argc, char **argv) |
3033 | @@ -405,13 +405,13 @@ |
3034 | ::testing::InitGoogleTest(&argc, argv); |
3035 | |
3036 | Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini")); |
3037 | - std::thread scope_t(scope_thread, srt); |
3038 | + std::thread scope_t(scope_thread, srt, "Runtime.ini"); |
3039 | |
3040 | Runtime::SPtr prt = move(Runtime::create_scope_runtime("PusherScope", "Runtime.ini")); |
3041 | - std::thread pusher_t(pusher_thread, prt); |
3042 | + std::thread pusher_t(pusher_thread, prt, "Runtime.ini"); |
3043 | |
3044 | Runtime::SPtr scrt = move(Runtime::create_scope_runtime("SlowCreateScope", "Runtime.ini")); |
3045 | - std::thread slow_create_t(slow_create_thread, scrt); |
3046 | + std::thread slow_create_t(slow_create_thread, scrt, "Runtime.ini"); |
3047 | |
3048 | // Give threads some time to bind to their endpoints, to avoid getting ObjectNotExistException |
3049 | // from a synchronous remote call. |
3050 | |
3051 | === modified file 'test/gtest/scopes/Runtime/Zmq.ini.in' |
3052 | --- test/gtest/scopes/Runtime/Zmq.ini.in 2013-11-29 12:20:25 +0000 |
3053 | +++ test/gtest/scopes/Runtime/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
3054 | @@ -1,3 +1,2 @@ |
3055 | [Zmq] |
3056 | -EndpointDir.Public = /tmp |
3057 | -EndpointDir.Private = /tmp |
3058 | +EndpointDir = /tmp |
3059 | |
3060 | === modified file 'test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp' |
3061 | --- test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-05-08 07:25:37 +0000 |
3062 | +++ test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-05-08 12:06:13 +0000 |
3063 | @@ -22,6 +22,8 @@ |
3064 | |
3065 | #include <gtest/gtest.h> |
3066 | |
3067 | +#include <scope-api-testconfig.h> |
3068 | + |
3069 | using namespace std; |
3070 | using namespace unity; |
3071 | using namespace unity::scopes; |
3072 | @@ -41,22 +43,25 @@ |
3073 | } |
3074 | }; |
3075 | |
3076 | +const string TEST_DIR = string(TEST_BUILD_ROOT) + "/gtest/scopes/internal/ConfigBase"; |
3077 | +const string TEST_INI = TEST_DIR + "/Test.ini"; |
3078 | + |
3079 | TEST(ConfigBase, basic) |
3080 | { |
3081 | - MyConfig c("Test.ini"); |
3082 | + MyConfig c(TEST_INI); |
3083 | EXPECT_TRUE(c.parser().get()); |
3084 | } |
3085 | |
3086 | TEST(ConfigBase, optional_string) |
3087 | { |
3088 | - MyConfig c("Test.ini"); |
3089 | + MyConfig c(TEST_INI); |
3090 | EXPECT_EQ("", c.get_optional_string("SomeGroup", "NoSuchKey")); |
3091 | EXPECT_EQ("", c.get_optional_string("SomeGroup", "Empty")); |
3092 | } |
3093 | |
3094 | TEST(ConfigBase, non_optional_string) |
3095 | { |
3096 | - MyConfig c("Test.ini"); |
3097 | + MyConfig c(TEST_INI); |
3098 | try |
3099 | { |
3100 | c.get_string("SomeGroup", "Empty"); |
3101 | @@ -64,13 +69,13 @@ |
3102 | } |
3103 | catch (ConfigException const& e) |
3104 | { |
3105 | - EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal empty value for Empty", e.what()); |
3106 | + EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": Illegal empty value for Empty", e.what()); |
3107 | } |
3108 | } |
3109 | |
3110 | TEST(ConfigBase, middleware) |
3111 | { |
3112 | - MyConfig c("Test.ini"); |
3113 | + MyConfig c(TEST_INI); |
3114 | EXPECT_EQ("Zmq", c.get_middleware("SomeGroup", "Zmq.Middleware")); |
3115 | EXPECT_EQ("REST", c.get_middleware("SomeGroup", "REST.Middleware")); |
3116 | try |
3117 | @@ -80,9 +85,9 @@ |
3118 | } |
3119 | catch (ConfigException const& e) |
3120 | { |
3121 | - EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for Zmq.BadMiddleware: \"foo\": " |
3122 | - "legal values are \"Zmq\" and \"REST\"", |
3123 | - e.what()); |
3124 | + EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": Illegal value for Zmq.BadMiddleware: \"foo\": " |
3125 | + "legal values are \"Zmq\" and \"REST\"", |
3126 | + e.what()); |
3127 | } |
3128 | try |
3129 | { |
3130 | @@ -91,15 +96,15 @@ |
3131 | } |
3132 | catch (ConfigException const& e) |
3133 | { |
3134 | - EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for REST.BadMiddleware: \"bar\": " |
3135 | - "legal values are \"Zmq\" and \"REST\"", |
3136 | - e.what()); |
3137 | + EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": Illegal value for REST.BadMiddleware: \"bar\": " |
3138 | + "legal values are \"Zmq\" and \"REST\"", |
3139 | + e.what()); |
3140 | } |
3141 | } |
3142 | |
3143 | TEST(ConfigBase, throw_ex) |
3144 | { |
3145 | - MyConfig c("Test.ini"); |
3146 | + MyConfig c(TEST_INI); |
3147 | EXPECT_TRUE(c.parser().get()); |
3148 | |
3149 | try |
3150 | @@ -108,7 +113,7 @@ |
3151 | } |
3152 | catch (ConfigException const& e) |
3153 | { |
3154 | - EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": error", e.what()); |
3155 | + EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": error", e.what()); |
3156 | } |
3157 | } |
3158 | |
3159 | @@ -116,11 +121,22 @@ |
3160 | { |
3161 | try |
3162 | { |
3163 | - MyConfig c("no_such_file"); |
3164 | + MyConfig c("wrong_extension.x"); |
3165 | + } |
3166 | + catch (ConfigException const& e) |
3167 | + { |
3168 | + EXPECT_STREQ("unity::scopes::ConfigException: invalid config file name: \"wrong_extension.x\": " |
3169 | + "missing .ini extension", |
3170 | + e.what()); |
3171 | + } |
3172 | + |
3173 | + try |
3174 | + { |
3175 | + MyConfig c("no_such_file.ini"); |
3176 | } |
3177 | catch (FileException const& e) |
3178 | { |
3179 | - EXPECT_STREQ("unity::FileException: Could not load ini file no_such_file: No such file or directory (errno = 4)", |
3180 | + EXPECT_STREQ("unity::FileException: Could not load ini file no_such_file.ini: No such file or directory (errno = 4)", |
3181 | e.what()); |
3182 | } |
3183 | } |
3184 | |
3185 | === modified file 'test/gtest/scopes/internal/RegistryConfig/Registry.ini.in' |
3186 | --- test/gtest/scopes/internal/RegistryConfig/Registry.ini.in 2014-05-08 07:25:37 +0000 |
3187 | +++ test/gtest/scopes/internal/RegistryConfig/Registry.ini.in 2014-05-08 12:06:13 +0000 |
3188 | @@ -1,7 +1,5 @@ |
3189 | [Registry] |
3190 | Middleware = Zmq |
3191 | -Zmq.Endpoint = ipc:///tmp/socket_for_registry |
3192 | -Zmq.EndpointDir = /tmp/socket_for_registry |
3193 | Zmq.ConfigFile = Zmq.ini |
3194 | Scope.InstallDir = /SomeDir |
3195 | Scoperunner.Path = /SomeAbsolutePath |
3196 | |
3197 | === modified file 'test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp' |
3198 | --- test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-05-08 07:25:37 +0000 |
3199 | +++ test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-05-08 12:06:13 +0000 |
3200 | @@ -33,7 +33,6 @@ |
3201 | RegistryConfig c("Registry", TEST_REGISTRY_PATH); |
3202 | EXPECT_EQ("Registry", c.identity()); |
3203 | EXPECT_EQ("Zmq", c.mw_kind()); |
3204 | - EXPECT_EQ("ipc:///tmp/socket_for_registry", c.endpoint()); |
3205 | EXPECT_EQ("Zmq.ini", c.mw_configfile()); |
3206 | } |
3207 | |
3208 | |
3209 | === modified file 'test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in' |
3210 | --- test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in 2013-11-19 02:51:46 +0000 |
3211 | +++ test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in 2014-05-08 12:06:13 +0000 |
3212 | @@ -1,7 +1,6 @@ |
3213 | [Registry] |
3214 | Middleware = Zmq |
3215 | Zmq.Endpoint = ipc:///tmp/socket_for_registry |
3216 | -Zmq.EndpointDir = /tmp/socket_for_registry |
3217 | Zmq.ConfigFile = Zmq.ini |
3218 | Scope.InstallDir = /SomeDir |
3219 | Scoperunner.Path = SomeRelativePath |
3220 | |
3221 | === modified file 'test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in' |
3222 | --- test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in 2014-04-08 08:26:44 +0000 |
3223 | +++ test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in 2014-05-08 12:06:13 +0000 |
3224 | @@ -1,7 +1,5 @@ |
3225 | [Registry] |
3226 | Middleware = Zmq |
3227 | -Zmq.Endpoint = ipc:///tmp/socket_for_registry |
3228 | -Zmq.EndpointDir = /tmp |
3229 | Zmq.ConfigFile = Zmq.ini |
3230 | Scope.InstallDir = /unused |
3231 | Click.InstallDir = /unused |
3232 | |
3233 | === modified file 'test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in' |
3234 | --- test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in 2014-02-24 14:56:26 +0000 |
3235 | +++ test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
3236 | @@ -1,3 +1,2 @@ |
3237 | [Zmq] |
3238 | -EndpointDir.Public = /tmp |
3239 | -EndpointDir.Private = /tmp |
3240 | +EndpointDir = /tmp |
3241 | |
3242 | === modified file 'test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp' |
3243 | --- test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-02-05 13:08:06 +0000 |
3244 | +++ test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-05-08 12:06:13 +0000 |
3245 | @@ -35,35 +35,6 @@ |
3246 | EXPECT_EQ("Zmq", c.default_middleware()); |
3247 | } |
3248 | |
3249 | -TEST(RuntimeConfig, BadRegistryID) |
3250 | -{ |
3251 | - try |
3252 | - { |
3253 | - RuntimeConfig c("BadRegID.ini"); |
3254 | - FAIL(); |
3255 | - } |
3256 | - catch (ConfigException const& e) |
3257 | - { |
3258 | - EXPECT_STREQ("unity::scopes::ConfigException: \"BadRegID.ini\": Illegal character in value for " |
3259 | - "Registry.Identity: \"Regi/stry\": identity cannot contain '/'", |
3260 | - e.what()); |
3261 | - } |
3262 | -} |
3263 | - |
3264 | -TEST(RuntimeConfig, MiddlewareEmpty) |
3265 | -{ |
3266 | - try |
3267 | - { |
3268 | - RuntimeConfig c("MWEmpty.ini"); |
3269 | - FAIL(); |
3270 | - } |
3271 | - catch (ConfigException const& e) |
3272 | - { |
3273 | - EXPECT_STREQ("unity::scopes::ConfigException: \"MWEmpty.ini\": Illegal empty value for Default.Middleware", |
3274 | - e.what()); |
3275 | - } |
3276 | -} |
3277 | - |
3278 | TEST(RuntimeConfig, BadMiddleware) |
3279 | { |
3280 | try |
3281 | |
3282 | === modified file 'test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in' |
3283 | --- test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in 2014-04-08 08:26:44 +0000 |
3284 | +++ test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in 2014-05-08 12:06:13 +0000 |
3285 | @@ -1,9 +1,7 @@ |
3286 | [Registry] |
3287 | Middleware = Zmq |
3288 | -Zmq.Endpoint = ipc:///tmp/socket_for_registry |
3289 | -Zmq.EndpointDir = /tmp |
3290 | Zmq.ConfigFile = Zmq.ini |
3291 | Scoperunner.Path = /SomePath |
3292 | -Scope.ConfigDir = /tmp |
3293 | +Scope.InstallDir = /tmp |
3294 | Scope.InstallDir = /tmp |
3295 | Click.InstallDir = /unused |
3296 | |
3297 | === modified file 'test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in' |
3298 | --- test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in 2013-11-29 12:20:25 +0000 |
3299 | +++ test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
3300 | @@ -1,3 +1,2 @@ |
3301 | [Zmq] |
3302 | -EndpointDir.Public = /tmp |
3303 | -EndpointDir.Private = /tmp |
3304 | +EndpointDir = /tmp |
3305 | |
3306 | === modified file 'test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp' |
3307 | --- test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-04-15 04:53:44 +0000 |
3308 | +++ test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-05-08 12:06:13 +0000 |
3309 | @@ -37,7 +37,7 @@ |
3310 | TEST(ScopeMetadataImpl, basic) |
3311 | { |
3312 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3313 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get()); |
3314 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini"); |
3315 | |
3316 | unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw)); |
3317 | mi->set_scope_id("scope_id"); |
3318 | @@ -231,7 +231,7 @@ |
3319 | TEST(ScopeMetadataImpl, serialize) |
3320 | { |
3321 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3322 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get()); |
3323 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini"); |
3324 | |
3325 | unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw)); |
3326 | mi->set_scope_id("scope_id"); |
3327 | @@ -280,7 +280,7 @@ |
3328 | TEST(ScopeMetadataImpl, serialize_exceptions) |
3329 | { |
3330 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3331 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get()); |
3332 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini"); |
3333 | |
3334 | ScopeMetadataImpl mi(&mw); |
3335 | try |
3336 | @@ -347,7 +347,7 @@ |
3337 | TEST(ScopeMetadataImpl, deserialize_exceptions) |
3338 | { |
3339 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3340 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get()); |
3341 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini"); |
3342 | |
3343 | VariantMap m; |
3344 | try |
3345 | |
3346 | === modified file 'test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in' |
3347 | --- test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in 2013-11-28 00:27:48 +0000 |
3348 | +++ test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
3349 | @@ -1,3 +1,2 @@ |
3350 | [Zmq] |
3351 | -EndpointDir.Public = /tmp |
3352 | -EndpointDir.Private = /tmp |
3353 | +EndpointDir = /tmp |
3354 | |
3355 | === modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in' |
3356 | --- test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in 2014-02-04 12:31:29 +0000 |
3357 | +++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in 2014-05-08 12:06:13 +0000 |
3358 | @@ -1,10 +1,5 @@ |
3359 | -[Runtime] |
3360 | -Registry.Identity = SSRegistryTest |
3361 | - |
3362 | [Registry] |
3363 | Middleware = Zmq |
3364 | -Zmq.Endpoint = ipc:///tmp/SSRegistryTest |
3365 | -Zmq.EndpointDir = /tmp |
3366 | Zmq.ConfigFile = Zmq.ini |
3367 | Scope.InstallDir = /tmp |
3368 | Scoperunner.Path = /tmp |
3369 | |
3370 | === modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in' |
3371 | --- test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in 2014-01-17 09:59:38 +0000 |
3372 | +++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
3373 | @@ -1,3 +1,2 @@ |
3374 | [Zmq] |
3375 | -EndpointDir.Public = /tmp |
3376 | -EndpointDir.Private = /tmp |
3377 | +EndpointDir = /tmp |
3378 | |
3379 | === modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp' |
3380 | --- test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2014-04-16 07:04:34 +0000 |
3381 | +++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2014-05-08 12:06:13 +0000 |
3382 | @@ -61,12 +61,14 @@ |
3383 | std::string mw_kind = reg_conf.mw_kind(); |
3384 | std::string mw_configfile = reg_conf.mw_configfile(); |
3385 | |
3386 | + SSConfig ss_config(reg_rt_->ss_configfile()); |
3387 | + |
3388 | // Get middleware handles from runtimes |
3389 | reg_mw_ = reg_rt_->factory()->find(reg_id_, mw_kind); |
3390 | scope_mw_ = scope_rt_->factory()->create(scope_id_, mw_kind, mw_configfile); |
3391 | |
3392 | // Instantiate a SS registry and scope objects |
3393 | - reg_ = SSRegistryObject::SPtr(new SSRegistryObject(reg_mw_, scope_mw_->get_scope_endpoint(), 20000, 60, |
3394 | + reg_ = SSRegistryObject::SPtr(new SSRegistryObject(reg_mw_, ss_config, scope_mw_->get_scope_endpoint(), |
3395 | "http://127.0.0.1:" + std::to_string(server_.port_), false)); |
3396 | scope_ = SSScopeObject::UPtr(new SSScopeObject(scope_id_, scope_mw_, reg_)); |
3397 | |
3398 | @@ -119,7 +121,7 @@ |
3399 | EXPECT_THROW(reg_->get_metadata("dummy.scope.3"), NotFoundException); |
3400 | |
3401 | // locate should throw (via mw) |
3402 | - MWRegistryProxy mw_reg = reg_mw_->create_registry_proxy(reg_id_, reg_mw_->get_scope_endpoint()); |
3403 | + MWRegistryProxy mw_reg = reg_mw_->registry_proxy(); |
3404 | EXPECT_THROW(mw_reg->locate("Dummy Demo Scope"), RegistryException); |
3405 | |
3406 | // list scopes (via mw) |
3407 | |
3408 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp' |
3409 | --- test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-04-28 06:24:24 +0000 |
3410 | +++ test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-05-08 12:06:13 +0000 |
3411 | @@ -18,6 +18,7 @@ |
3412 | |
3413 | #include <unity/scopes/internal/zmq_middleware/ObjectAdapter.h> |
3414 | |
3415 | +#include <scope-api-testconfig.h> |
3416 | #include <scopes/internal/zmq_middleware/capnproto/Message.capnp.h> |
3417 | #include <unity/scopes/internal/RuntimeImpl.h> |
3418 | #include <unity/scopes/internal/zmq_middleware/ServantBase.h> |
3419 | @@ -31,7 +32,6 @@ |
3420 | #include <boost/regex.hpp> // Use Boost implementation until http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631 is fixed. |
3421 | #include <capnp/serialize.h> |
3422 | #include <gtest/gtest.h> |
3423 | -#include <scope-api-testconfig.h> |
3424 | |
3425 | using namespace std; |
3426 | using namespace unity; |
3427 | @@ -54,8 +54,8 @@ |
3428 | |
3429 | TEST(ObjectAdapter, basic) |
3430 | { |
3431 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3432 | - (RuntimeImpl*)0x1); |
3433 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3434 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3435 | |
3436 | // Instantiate and destroy oneway and twoway adapters with single and multiple threads. |
3437 | { |
3438 | @@ -133,8 +133,8 @@ |
3439 | |
3440 | TEST(ObjectAdapter, state_change) |
3441 | { |
3442 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3443 | - (RuntimeImpl*)0x1); |
3444 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3445 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3446 | |
3447 | { |
3448 | wait(); |
3449 | @@ -228,8 +228,8 @@ |
3450 | |
3451 | TEST(ObjectAdapter, wait_for_shutdown) |
3452 | { |
3453 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3454 | - (RuntimeImpl*)0x1); |
3455 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3456 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3457 | |
3458 | // Start the adapter and call shutdown() from a different thread after a delay, and wait for the |
3459 | // shutdown to complete. We check that the shutdown happens after at least the delay that was specified, |
3460 | @@ -276,7 +276,7 @@ |
3461 | TEST(ObjectAdapter, add_remove_find) |
3462 | { |
3463 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3464 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); |
3465 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3466 | |
3467 | wait(); |
3468 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 5); |
3469 | @@ -337,8 +337,8 @@ |
3470 | |
3471 | TEST(ObjectAdapter, dispatch_oneway_to_twoway) |
3472 | { |
3473 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3474 | - (RuntimeImpl*)0x1); |
3475 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3476 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3477 | |
3478 | wait(); |
3479 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3480 | @@ -373,8 +373,8 @@ |
3481 | |
3482 | TEST(ObjectAdapter, dispatch_twoway_to_oneway) |
3483 | { |
3484 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3485 | - (RuntimeImpl*)0x1); |
3486 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3487 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3488 | |
3489 | wait(); |
3490 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Oneway, 1); |
3491 | @@ -400,8 +400,8 @@ |
3492 | |
3493 | TEST(ObjectAdapter, dispatch_not_exist) |
3494 | { |
3495 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3496 | - (RuntimeImpl*)0x1); |
3497 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3498 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3499 | |
3500 | wait(); |
3501 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3502 | @@ -442,8 +442,8 @@ |
3503 | |
3504 | TEST(ObjectAdapter, bad_header) |
3505 | { |
3506 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3507 | - (RuntimeImpl*)0x1); |
3508 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3509 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3510 | |
3511 | { |
3512 | wait(); |
3513 | @@ -503,8 +503,8 @@ |
3514 | |
3515 | TEST(ObjectAdapter, corrupt_header) |
3516 | { |
3517 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3518 | - (RuntimeImpl*)0x1); |
3519 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3520 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3521 | |
3522 | { |
3523 | wait(); |
3524 | @@ -563,7 +563,7 @@ |
3525 | TEST(ObjectAdapter, invoke_ok) |
3526 | { |
3527 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3528 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); |
3529 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3530 | |
3531 | wait(); |
3532 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3533 | @@ -615,7 +615,7 @@ |
3534 | TEST(ObjectAdapter, invoke_object_not_exist) |
3535 | { |
3536 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3537 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); |
3538 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3539 | |
3540 | wait(); |
3541 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3542 | @@ -660,7 +660,7 @@ |
3543 | TEST(ObjectAdapter, invoke_operation_not_exist) |
3544 | { |
3545 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3546 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); |
3547 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3548 | |
3549 | wait(); |
3550 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3551 | @@ -780,7 +780,7 @@ |
3552 | TEST(ObjectAdapter, twoway_threading) |
3553 | { |
3554 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3555 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); |
3556 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3557 | |
3558 | // Single servant to which we send requests concurrently. |
3559 | shared_ptr<CountingServant> o(new CountingServant(100)); |
3560 | @@ -814,7 +814,7 @@ |
3561 | TEST(ObjectAdapter, oneway_threading) |
3562 | { |
3563 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3564 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); |
3565 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3566 | |
3567 | // Single servant to which we send requests concurrently. |
3568 | shared_ptr<CountingServant> o(new CountingServant(100)); |
3569 | @@ -885,7 +885,7 @@ |
3570 | TEST(ObjectAdapter, servant_map_destructor) |
3571 | { |
3572 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3573 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); |
3574 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3575 | |
3576 | { |
3577 | wait(); |
3578 | @@ -1056,8 +1056,9 @@ |
3579 | |
3580 | wait(200); // Give zmq some time to finish the bind. |
3581 | |
3582 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3583 | - (RuntimeImpl*)0x1); |
3584 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3585 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3586 | + |
3587 | wait(); |
3588 | try |
3589 | { |
3590 | @@ -1093,8 +1094,8 @@ |
3591 | |
3592 | wait(200); // Give zmq some time to finish the bind. |
3593 | |
3594 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3595 | - (RuntimeImpl*)0x1); |
3596 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3597 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3598 | wait(); |
3599 | try |
3600 | { |
3601 | @@ -1122,8 +1123,8 @@ |
3602 | |
3603 | TEST(ObjectAdapter, dflt_servant) |
3604 | { |
3605 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3606 | - (RuntimeImpl*)0x1); |
3607 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3608 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3609 | |
3610 | wait(); |
3611 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3612 | @@ -1177,8 +1178,8 @@ |
3613 | |
3614 | TEST(ObjectAdapter, dflt_servant_exceptions) |
3615 | { |
3616 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", |
3617 | - (RuntimeImpl*)0x1); |
3618 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3619 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3620 | |
3621 | wait(); |
3622 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3623 | |
3624 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in' |
3625 | --- test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in 2013-11-28 00:27:48 +0000 |
3626 | +++ test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
3627 | @@ -1,3 +1,2 @@ |
3628 | [Zmq] |
3629 | -EndpointDir.Public = /tmp |
3630 | -EndpointDir.Private = /tmp |
3631 | +EndpointDir = /tmp |
3632 | |
3633 | === modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp' |
3634 | --- test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-05-05 07:14:52 +0000 |
3635 | +++ test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-05-08 12:06:13 +0000 |
3636 | @@ -96,7 +96,6 @@ |
3637 | string identity = runtime->registry_identity(); |
3638 | RegistryConfig c(identity, runtime->registry_configfile()); |
3639 | string mw_kind = c.mw_kind(); |
3640 | - string mw_endpoint = c.endpoint(); |
3641 | string mw_configfile = c.mw_configfile(); |
3642 | |
3643 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
3644 | @@ -120,7 +119,6 @@ |
3645 | string identity = runtime->registry_identity(); |
3646 | RegistryConfig c(identity, runtime->registry_configfile()); |
3647 | string mw_kind = c.mw_kind(); |
3648 | - string mw_endpoint = c.endpoint(); |
3649 | string mw_configfile = c.mw_configfile(); |
3650 | |
3651 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
3652 | @@ -170,7 +168,6 @@ |
3653 | string identity = runtime->registry_identity(); |
3654 | RegistryConfig c(identity, runtime->registry_configfile()); |
3655 | string mw_kind = c.mw_kind(); |
3656 | - string mw_endpoint = c.endpoint(); |
3657 | string mw_configfile = c.mw_configfile(); |
3658 | |
3659 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
3660 | @@ -223,7 +220,6 @@ |
3661 | string identity = runtime->registry_identity(); |
3662 | RegistryConfig c(identity, runtime->registry_configfile()); |
3663 | string mw_kind = c.mw_kind(); |
3664 | - string mw_endpoint = c.endpoint(); |
3665 | string mw_configfile = c.mw_configfile(); |
3666 | |
3667 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
3668 | @@ -316,7 +312,6 @@ |
3669 | string identity = runtime->registry_identity(); |
3670 | RegistryConfig c(identity, runtime->registry_configfile()); |
3671 | string mw_kind = c.mw_kind(); |
3672 | - string mw_endpoint = c.endpoint(); |
3673 | string mw_configfile = c.mw_configfile(); |
3674 | RegistryObject::ScopeExecData dummy_exec_data; |
3675 | |
3676 | @@ -500,7 +495,7 @@ |
3677 | // test locating the same scope multiple times |
3678 | TEST_F(RegistryTest, locate_one) |
3679 | { |
3680 | - // locate all scopes (hense starting all scope processes) |
3681 | + // locate all scopes (hence starting all scope processes) |
3682 | for (auto const& scope_id : scope_ids) |
3683 | { |
3684 | EXPECT_EQ(proxies[scope_id], reg->locate(scope_id)); |
3685 | @@ -603,7 +598,7 @@ |
3686 | // test removing a scope |
3687 | TEST_F(RegistryTest, locate_remove) |
3688 | { |
3689 | - // locate all scopes (hense starting all scope processes) |
3690 | + // locate all scopes (hence starting all scope processes) |
3691 | for (auto const& scope_id : scope_ids) |
3692 | { |
3693 | EXPECT_EQ(proxies[scope_id], reg->locate(scope_id)); |
3694 | @@ -612,7 +607,7 @@ |
3695 | // check that 6 new processes were started |
3696 | EXPECT_EQ(6, process_count()); |
3697 | |
3698 | - // remove a scope (hense killing the process) |
3699 | + // remove a scope (hence killing the process) |
3700 | EXPECT_TRUE(reg->remove_local_scope(scope_ids[0])); |
3701 | |
3702 | // check that we now have 5 scopes running |
3703 | |
3704 | === modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in' |
3705 | --- test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in 2014-03-17 06:45:44 +0000 |
3706 | +++ test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in 2014-05-08 12:06:13 +0000 |
3707 | @@ -1,10 +1,5 @@ |
3708 | -[Runtime] |
3709 | -Registry.Identity = TestRegistry |
3710 | - |
3711 | [Registry] |
3712 | Middleware = Zmq |
3713 | -Zmq.Endpoint = ipc:///tmp/TestRegistry |
3714 | -Zmq.EndpointDir = /tmp |
3715 | Zmq.ConfigFile = Zmq.ini |
3716 | Scope.InstallDir = /tmp |
3717 | Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner |
3718 | |
3719 | === modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in' |
3720 | --- test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in 2013-11-28 00:27:48 +0000 |
3721 | +++ test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
3722 | @@ -1,3 +1,2 @@ |
3723 | [Zmq] |
3724 | -EndpointDir.Public = /tmp |
3725 | -EndpointDir.Private = /tmp |
3726 | +EndpointDir = /tmp |
3727 | |
3728 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp' |
3729 | --- test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp 2014-01-22 03:29:48 +0000 |
3730 | +++ test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp 2014-05-08 12:06:13 +0000 |
3731 | @@ -93,8 +93,8 @@ |
3732 | |
3733 | TEST(ServantBase, success) |
3734 | { |
3735 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini", |
3736 | - (RuntimeImpl*)0x1); |
3737 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3738 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini"); |
3739 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3740 | Current current; |
3741 | current.op_name = "op"; |
3742 | @@ -110,8 +110,8 @@ |
3743 | |
3744 | TEST(ServantBase, ping) |
3745 | { |
3746 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini", |
3747 | - (RuntimeImpl*)0x1); |
3748 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3749 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini"); |
3750 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3751 | Current current; |
3752 | current.op_name = "ping"; |
3753 | @@ -127,8 +127,8 @@ |
3754 | |
3755 | TEST(ServantBase, exceptions) |
3756 | { |
3757 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini", |
3758 | - (RuntimeImpl*)0x1); |
3759 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3760 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini"); |
3761 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3762 | Current current; |
3763 | current.op_name = "op"; |
3764 | |
3765 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in' |
3766 | --- test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in 2013-11-28 00:27:48 +0000 |
3767 | +++ test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
3768 | @@ -1,3 +1,2 @@ |
3769 | [Zmq] |
3770 | -EndpointDir.Public = /tmp |
3771 | -EndpointDir.Private = /tmp |
3772 | +EndpointDir = /tmp |
3773 | |
3774 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in' |
3775 | --- test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in 2013-11-28 00:27:48 +0000 |
3776 | +++ test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in 2014-05-08 12:06:13 +0000 |
3777 | @@ -1,3 +1,2 @@ |
3778 | [Zmq] |
3779 | -EndpointDir.Public = /tmp |
3780 | -EndpointDir.Private = /tmp |
3781 | +EndpointDir = /tmp |
3782 | |
3783 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp' |
3784 | --- test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp 2014-04-09 07:29:37 +0000 |
3785 | +++ test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp 2014-05-08 12:06:13 +0000 |
3786 | @@ -18,13 +18,13 @@ |
3787 | |
3788 | #include <unity/scopes/internal/zmq_middleware/ZmqMiddleware.h> |
3789 | |
3790 | +#include <scope-api-testconfig.h> |
3791 | #include <unity/scopes/internal/RuntimeImpl.h> |
3792 | #include <unity/scopes/internal/MWObjectProxy.h> |
3793 | #include <unity/scopes/internal/zmq_middleware/ZmqObjectProxy.h> |
3794 | #include <unity/scopes/ScopeExceptions.h> |
3795 | |
3796 | #include <gtest/gtest.h> |
3797 | -#include <scope-api-testconfig.h> |
3798 | |
3799 | using namespace std; |
3800 | using namespace unity::scopes; |
3801 | @@ -35,9 +35,8 @@ |
3802 | |
3803 | TEST(ZmqMiddleware, basic) |
3804 | { |
3805 | - ZmqMiddleware mw("testscope", |
3806 | - TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini", |
3807 | - (RuntimeImpl*)0x1); |
3808 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3809 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini"); |
3810 | mw.start(); |
3811 | sleep(1); |
3812 | mw.stop(); |
3813 | @@ -46,7 +45,7 @@ |
3814 | TEST(ZmqMiddleware, string_to_proxy) |
3815 | { |
3816 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3817 | - ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini", rt.get()); |
3818 | + ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini"); |
3819 | |
3820 | ObjectProxy p; |
3821 | ScopeProxy sp; |
3822 | @@ -84,9 +83,8 @@ |
3823 | |
3824 | TEST(ZmqMiddleware, string_to_proxy_ex) |
3825 | { |
3826 | - ZmqMiddleware mw("testscope", |
3827 | - TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini", |
3828 | - (RuntimeImpl*)0x1); |
3829 | + ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3830 | + TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini"); |
3831 | |
3832 | try |
3833 | { |
3834 | |
3835 | === modified file 'test/whitespace/check_whitespace.py' |
3836 | --- test/whitespace/check_whitespace.py 2014-04-04 07:34:33 +0000 |
3837 | +++ test/whitespace/check_whitespace.py 2014-05-08 12:06:13 +0000 |
3838 | @@ -60,7 +60,7 @@ |
3839 | for lino, line in enumerate(ifile, start=1): |
3840 | if whitespace_pat.match(line) or tab_indent_pat.match(line): |
3841 | errors.append(lino) |
3842 | - if line == "\n": |
3843 | + if line == "\n" and lino != 1: # Don't complain about empty file with only a single line |
3844 | newlines_at_end += 1 |
3845 | else: |
3846 | newlines_at_end = 0 |
3847 | |
3848 | === modified file 'unity-scopes.map' |
3849 | --- unity-scopes.map 2014-04-10 14:39:05 +0000 |
3850 | +++ unity-scopes.map 2014-05-08 12:06:13 +0000 |
3851 | @@ -20,6 +20,7 @@ |
3852 | unity::scopes::internal::ScopeMetadataImpl::*; |
3853 | unity::scopes::internal::ScopeObject::*; |
3854 | unity::scopes::internal::StateReceiverObject::*; |
3855 | + unity::scopes::internal::smartscopes::SSConfig::*; |
3856 | unity::scopes::internal::smartscopes::SSRegistryObject::*; |
3857 | unity::scopes::internal::smartscopes::SSScopeObject::*; |
3858 | }; |
FAILED: Continuous integration, rev:303 jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- ci/452/ jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- utopic- amd64-ci/ 4/console jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- utopic- armhf-ci/ 4/console jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- utopic- i386-ci/ 4/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- scopes- api-devel- ci/452/ rebuild
http://