summaryrefslogtreecommitdiffstats
path: root/tests/unit/rpc
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Add support for heartbeating in the kombu RPC driver"HEADmasterJenkins2013-07-081-7/+14
|\
| * Add support for heartbeating in the kombu RPC driverKiall Mac Innes2013-07-081-7/+14
| | | | | | | | | | | | | | | | | | This aides in detecting connection interruptions that would otherwise go unnoticed. Fixes bug #856764 Change-Id: Id4eb3d36036969b62890175d6a33b4e304be0527
* | Replace sys.exit by a RPCExceptionMehdi Abaakouk2013-07-021-7/+29
|/ | | | | | | | This change replace sys.exit by a RPCException like the zmq implementation does, to allow library users to handle the case of the rpc failure in their applications. Change-Id: Iafda7bfa20840fa5488dece1d5ad49e2b14b73b5
* Fix tox.ini configVictor Sergeyev2013-06-271-0/+1
| | | | | | | We found that if tests run with testr --subunit option it can cause wrong implementation of tests results. Change-Id: I98c3f3ed90e2291ef984f07a93c89d24da7855d9
* Refactor KombuStubs fixture.Roman Podolyaka2013-06-261-10/+22
| | | | | | Fixes bug 1192924. Change-Id: Ic6d9715c945e620da20b43310e8e8ba79296e4ad
* Merge "Make AMQP based RPC consumer threads more robust"Jenkins2013-06-262-4/+76
|\
| * Make AMQP based RPC consumer threads more robustRaymond Pekowski2013-06-252-4/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug 1189711 Should RPC consume_in_thread() be more fault tolerant? There are unprotected holes in the thread kicked off by RPC consume_in_thread such that an exception will kill the thread. This exists for both the service (TopicConsumer) and the new reply proxy (DirectConsumer) consumers. This patch plugs those holes as close to the base of the consumer thread as possible by catching all non-caught exceptions and retrying with sleeps between retries and some pacing of the log output to prevent log flooding. Change-Id: I0d6ec8a5e3a310314da201656ee862bb40b41616
* | Merge "Do not raise NEW exceptions"Jenkins2013-06-251-1/+1
|\ \
| * | Do not raise NEW exceptionsSergey Vilgelm2013-06-251-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Raising NEW exception is bad practice, because we lose TraceBack. So all places like: except SomeException as e: raise e should be replaced by except SomeException: raise If we are doing some other actions before reraising we should store information about exception then do all actions and then reraise it. This is caused by eventlet bug. It lost information about exception if it switch threads. fixes bug 1191730 Change-Id: I7bce659591c4c3e4bc41e12d7d8390128c30e2e4
* / Allow BaseTestCase use a different conf objectMark McLoughlin2013-06-252-0/+2
|/ | | | | | | | | | | | | | | | The new messaging work will register options like rpc_backend and, since the existing RPC API registers those options with CONF, we need to run the messaging tests with a different ConfigOpts object. It's actually probably pretty sane for all unit tests to use a per-test ConfigOpts object rather than cfg.CONF anyway. The kombu and zmq tests have an issue with this where they rely on being able to call self.config() before the base class setUp() is called. Fixing this properly is a little tricky, so for now, initialize self.conf early to cfg.CONF just for these tests. Change-Id: I7b2e3db7c21c511f3ab16ac866e0cc80846cbd80
* Merge "Optionally reject messages on exception."Jenkins2013-06-241-1/+104
|\
| * Optionally reject messages on exception.Sandy Walsh2013-06-201-1/+104
| | | | | | | | | | | | | | | | | | Rather than blindly ack() all messages, consumers can be created that reject() the message if an exception occurs in the callback. Currently only implemented in kombu driver. Change-Id: I308dd794b50966e3a189d31b2b51fdac36cd7d3a
* | Update kombu and anyjsonDoug Hellmann2013-06-201-0/+16
|/ | | | | | | | | | | | | | | Update the kombu requirement based on the new value in the global requirements list. The new version of kombu we are using depends on anyjson>=0.3.3. Related to bug #1134575 Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com> Change-Id: I36211a2730bfc712e189d39893ab2af513ce3ba9 Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
* Allow exceptions to hop up cellsMatthew Sherborne2013-06-121-0/+40
| | | | | | | | | | | | | | | | | | When an exception happens in an RPC call using nova cells, it can travel back up several RPC boundaries. eg, child-cell=>parent-cell=>nova-api Before this patch if an exception (eg. AggregateNotFound) was raised in the bottom layer, the next layer up would turn it into a special exception ( AggregateNotFound_Remote ), then in the final layer, it would see this as an unrecognizable exception and raise RemoteException. After this patch, at each layer where the expeption is deserialized, it'll recognize exceptions with the _Remote postfix, and leave them as they are, instead of turning them into RemoteExceptions. It also preserves the exception's original __module__ now. Change-Id: I158a80f1cec20d3e1805b565ffddaffd7a15295b
* Merge "Remove the amqp_rpc_single_reply_queue option from Havana"Jenkins2013-06-112-132/+56
|\
| * Remove the amqp_rpc_single_reply_queue option from HavanaRaymond Pekowski2013-06-052-132/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | blueprint amqp-rpc-fast-reply-queue As part of the Grizzly code review for the above blueprint (Idb09a714), the Grizzly code base is "aware" of this feature in terms of receiving RPCs and provided with an option for enabling it on the RPC send side. It was decided that in Havana the option would be removed, RPCs would only be sent using the new functionality yet awareness of prior functionality be retained for the receiving of RPCs. This code change implements the Havana piece. Change-Id: I5f2a8e432cf84a637c1aa813656c1cbc8db6e7eb
* | Merge "Add can_send_version() to RpcProxy."Jenkins2013-06-111-0/+10
|\ \
| * | Add can_send_version() to RpcProxy.Russell Bryant2013-06-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Add a helper method to the RpcProxy class. This is a little nicer to use for checking to see if a given message is copmatible with the set version cap. Change-Id: Ic44d76f4181351dff367f2d1181a3d508a11db78
* | | Enable hacking H404 test.Dina Belova2013-06-115-37/+24
|/ / | | | | | | | | | | H404 - multi line docstring should start with a summary. Change-Id: I2099e1ee81ff9657f7a07401b8e8f3327d03bdbd
* | Merge "MatchMakerStub - make it work & add test"Jenkins2013-06-111-0/+10
|\ \ | |/ |/|
| * MatchMakerStub - make it work & add testEric Windisch2013-05-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | The super() in MatchMakerStub.__init__ was referencing the wrong class due to copy/paste. I've also added a test for this class. Fixes bug 1185501 Change-Id: I298c8c1df4dcb3d3e905ecbb5400d16b3383fdf9
* | Merge "Enable H306 hacking check."Jenkins2013-06-041-0/+1
|\ \
| * | Enable H306 hacking check.Dina Belova2013-06-041-0/+1
| | | | | | | | | | | | | | | | | | H306 - imports not in alphabetical order. Change-Id: Iaa93bcafed562833318ac86241ad36662c2d8ca6
* | | Fix problem with long messages in QpidBen Nemec2013-06-031-0/+83
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Qpid has a limitation where it cannot serialize a dict containing a string greater than 65535 characters. This change alters the Qpid implementation to JSON encode the dict before sending it, but only if Qpid would fail to serialize it. This maintains as much backward compatibility as possible, though long messages will still fail if they are sent to an older receiver. Fixes bug 1175808 Change-Id: I5d104e099f523508dae2b657f7d06d96984b10f0
* | Enable hacking H402 testSergey Lukjanov2013-06-033-11/+11
| | | | | | | | | | | | H402 one line docstring needs punctuation Change-Id: Ie848453cace318d8310cdf0234c512f4c1121119
* | Merge "Use mox object from moxstubout fixture"Jenkins2013-05-311-2/+0
|\ \
| * | Use mox object from moxstubout fixtureMark McLoughlin2013-05-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The moxstubout fixture creates a mox object which we can re-use in tests. It also ensures verify() is called, which it clearly wasn't in the case of the qpid tests. Change-Id: Ibf3326f18b160865012d40a5841b65438262c4df
* | | Enable hacking H403 testSergey Lukjanov2013-05-301-1/+2
| |/ |/| | | | | | | | | H403 multi line docstring end on new line Change-Id: I33249651026b54ef346214965e909835288bb14e
* | Add generic serialization supportDan Smith2013-05-212-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | This adds a generic serialization model that the RpcProxy and RpcDispatcher will use to serialize and deserialize arguments and return values. The base definition is provided, as well as a default NoOpSerializer which performs no special action (retaining the existing behavior). Related to blueprint rpc-object-serialization Change-Id: I0a33baddee3e28dfc47100eb3216b679558b0bdd
* | Allow RPC_API_NAMESPACE on RpcProxy objectsChris Behrens2013-05-201-2/+13
|/ | | | | | | | | | This allows one to subclass RpcProxy for use with a particular namespace without having to repeatedly pass the namespace into the make_namespaced_msg() method. This new RPC_API_NAMESPACE attribute will be used for the make_msg() call. It is defaulted to None to match previous behavior. Change-Id: Ied62df839cda0be6f9f9b060bbfc22e086f61be8
* Merge "Extract matchmaker_ring to own module"Jenkins2013-05-171-1/+2
|\
| * Extract matchmaker_ring to own moduleEric Windisch2013-05-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | The base matchmaker module should not have all the matchmakers implemented within. Instead, we desire to break them out. For purposes of deprecation, logs a warning when importing from the ZeroMQ driver. Change-Id: I76936edd97309621a9c28363dccd792293a1c0d3
* | Merge "Fixes import order nits"Jenkins2013-05-165-5/+5
|\ \
| * | Fixes import order nitsZhongyue Luo2013-05-155-5/+5
| |/ | | | | | | Change-Id: I4fdc8eed74dd90d6450864daba7492d5e7266448
* / Support capping message versions in the client.Russell Bryant2013-05-151-0/+6
|/ | | | | | | | | | | | | | | | | | | When doing a rolling upgrade, we need to be able to tell all rpc clients to hold off on sending newer versions of messages until all nodes understand the new message version. This patch adds the oslo component of this. It's quite simple. The rpc proxy just stores the version cap and will raise an exception if code ever tries to send a message that exceeds this cap. Allowing the cap to be configured and generating different types of messages based on the configured value is the hard part here, but that is left up to the project using the rpc library. Implements blueprint rpc-version-control. Change-Id: Ia69db03a80dc3b1c63d52c7e163ea3cfec80c882
* Merge "Convert unicode strings for python3 portability"Jenkins2013-05-101-4/+4
|\
| * Convert unicode strings for python3 portabilityChuck Short2013-05-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | From http://docs.python.org/3.1/whatsnew/3.0.html You can no longer use u"..." literals for Unicode text. However, you must use b"..." literals for binary data. Use python-six to make this migration easier. Change-Id: I95166a07f4edf33be55a4bdf2674c2f238a06f19 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* | Merge "Convert unicode for python3 portability"Jenkins2013-05-073-10/+18
|\ \ | |/ |/|
| * Convert unicode for python3 portabilityChuck Short2013-05-063-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | From http://docs.python.org/3.1/whatsnew/3.0.html: "Python 3.0 uses the concepts of text and (binary) data instead of Unicode strings and 8-bit strings." Use six.text_type to Type for representing (Unicode) textual data. This is unicode() in Python 2 and str in Python 3. Change-Id: I3da268a714a34a8e626a2590f01b86e414dc3411 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* | Use range rather than xrangeChuck Short2013-05-011-1/+1
|/ | | | | | | | Use range rather than xrange to improve python3 compatibiltiy. Change-Id: I5a4434bbd2e5d509f84c3aa668eea8e46262816f Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Improve Python 3.x compatibilityDirk Mueller2013-04-221-2/+2
| | | | | | | Mechanical translation of deprecated constructs to 3.x compatible variants. Change-Id: I4988d0ac656903e0d0320aaa8361d4eeb774a0f9
* Add rpc method namespace support.Russell Bryant2013-04-122-6/+50
| | | | | | | | | | | | | | | | | | | | | | RPC endpoints already had the ability to expose multiple APIs ... sort of. You could pass multiple callback objects to the dispatcher and it would check all of them for a method call. This patch adds the ability to set a namespace on a callback object. This makes exposing multiple APIs a bit more like you would expect it to work. You can invoke a method on a specific callback object, as opposed to having it check all of them for the method. This will allow you to create, manage, and version APIs without any potential conflicts with other APIs being exposed by the same endpoint. An example of where I would like to use this is in Nova, where we have some methods that we would like to expose on *all* rpc endpoints. This includes no public API changes and is fully backwards compatible. Implement blueprint rpc-multi-api. Change-Id: Ief4433e2e1c32cfb05b4cd27b87fe32b40f4341d
* Move bin/ scripts to entrypoints.Monty Taylor2013-04-071-1/+1
| | | | | | | Instead of propogating more bin scripts, migrate these to be things that can be consumed as entrypoints. Change-Id: Ic01e0f16fe9e7634708fbb51499ccea3f4f40d63
* rpc: fix positional args in remote exceptionsKiall Mac Innes2013-03-311-2/+23
| | | | | | | | | | Fixes bug #1160475. Positional arguments were dropped during the deserialization of valid remote exceptions, while keyword arguments are correctly supplied. Change-Id: I7b95fc4ed3fb9e5c75f5711ed6aace7aa5593727
* Update to use flake8.Monty Taylor2013-03-246-13/+7
| | | | | | | flake8 is pluggable and handles pep8 and pyflakes, as well as configuration through tox.ini. It also removes the need for flakes.py. Change-Id: If5f7d8ad348b4fb8119fa4ec7b5e9d17bdc72a39
* Merge "Improves Logging for for rpc method timeouts"Jenkins2013-03-221-21/+39
|\
| * Improves Logging for for rpc method timeoutsMatthew Sherborne2013-03-221-21/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the traceback for an rpc timeout from inside an iterator, which gave a useless traceback, into the main flow of the program. It also adds the rpc method being called and the topic used to the exception's message. When the caller logs the message higher up the stack, the log information and traceback will be more useful. Finally it removes the timeout logging in the amqp.py module, in the spirit of bug #1137994 and https://review.openstack.org/#/c/23295/ Works towards: bug #1148516 Change-Id: I29a3b1b97c6114c4479e2b71c1257c4d72131535
* | Enable message envelope.Russell Bryant2013-03-213-36/+2
|/ | | | | | | Grizzly had the ability to receive messages with an envelope, but did not send them. Now update the code to send them. Change-Id: I73aad7697cf83ad4aabb3c2058b7cc4f53f783c2
* Removes unused imports in the tests moduleZhongyue Luo2013-03-206-11/+0
| | | | | | Fixes bug #1157596 Change-Id: I36d5484eaa2f0e21188eed6e70cc1ad785233d6a
* update OpenStack, LLC to OpenStack FoundationMark McClain2013-03-131-1/+1
| | | | | | | | | | fixes bug 1154745 The previous update (https://review.openstack.org/#/c/24103/) missed header files that contained "OpenStack, LLC". This change corrects the missed files to reflect the OpenStack Foundation. Change-Id: I9c6de265267485ef2c82ea7e6d8643e82134d102