Allow BaseTestCase use a different conf object

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
Initial framework

Change-Id: I183a6fd41a1971158f237bc94666818fcb136765
Co-authored-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Co-authored-by: Flaper Fesp <flaper87@gmail.com>
Support capping message versions in the client.

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
Add generic serialization support

Copy across Dan Smith's work in commit 93ee6e3.

Change-Id: Id3e500d40e34abb386db878a6a6d457f13521676
Implement a fake driver

A bunch of FIXMEs in here, but it seems like a good start.

Note that this differs from the original fake driver. Rather than the
driver consuming each message in a greenthread, we leave it up to the
choice of executor to determine how the consumer is run in parallel to
the client and we use thread-safe queues to pass the messages and
replies back and forth. The main reason for this is that we don't want
the driver explicitly depending on eventlet.

Change-Id: Id52e12be93c95b779695f62411f02f43d8480e4e
Add parse_url to _utils.

The patch adds parse_url to _utils as an attempt to find a common url
format that satisfies most drivers needs. The code isn't definitive but
instead the beginning for further discussions. Current code parses
transport urls like this:

qpid://test/test
{'exchange': 'test',
 'hosts': [{'host': 'test', 'password': '', 'username': ''}],
 'parameters': {},
 'transport': 'qpid'}

qpid://test:port/test
{'exchange': 'test',
 'hosts': [{'host': 'test:port', 'password': '', 'username': ''}],
 'parameters': {},
 'transport': 'qpid'}

qpid://username:password@test:port/test
{'exchange': 'test',
 'hosts': [{'host': 'test:port',
            'password': 'password',
            'username': 'username'}],
 'parameters': {},
 'transport': 'qpid'}

qpid://username:password@test:port
{'exchange': None,
 'hosts': [{'host': 'test:port',
            'password': 'password',
            'username': 'username'}],
 'parameters': {},
 'transport': 'qpid'}

qpid://username:password@test:port,test2:port2/test
{'exchange': 'test',
 'hosts': [{'host': 'test:port',
            'password': 'password',
            'username': 'username'},
           {'host': 'test2:port2',
            'password': 'password',
            'username': 'username'}],
 'parameters': {},
 'transport': 'qpid'}

qpid://username:password@test:port,:@test2:port2/test
{'exchange': 'test',
 'hosts': [{'host': 'test:port',
            'password': 'password',
            'username': 'username'},
           {'host': 'test2:port2', 'password': '', 'username': ''}],
 'parameters': {},
 'transport': 'qpid'}

qpid://username:password@test:port,:@test2:port2/test?option=value
{'exchange': 'test',
 'hosts': [{'host': 'test:port',
            'password': 'password',
            'username': 'username'},
           {'host': 'test2:port2', 'password': '', 'username': ''}],
 'parameters': {'option': ['value']},
 'transport': 'qpid'}

Change-Id: I890a83add44082f0945a01b2c2313f91ce8cea59
First cut at the notifier API

See:

  https://wiki.openstack.org/wiki/Oslo/Messaging#Emitting_Notifications

Change-Id: Icbc16c8b089158e398acebaac3c599fe529981b7
Co-authored-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Unit tests

Change-Id: I6cbec6fe126b9f49c55dafb35c5ae78591a3608b
Add some notes and test code

Change-Id: I927d3131ff0d0edb7d126399cb028e4c69142836