Add the test infrastructure

This commit introduces all the schema and tools to be able to run tests:
virtual env script creator, test-requirements, tools directory...

It is actually copied directly from neutron repo and it does not
introduce any special customization from it.

Change-Id: I3d9a47a0bb1a02509420ff8ace59e0cf21311c65
Migrate unit tests

Move unit tests for the plugin from downstream neutron repository
to the new plugin repository.

Change-Id: Ic87494ee5ba3a3470393c7bbfc8ab5bdaccc7d8e
Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Fix the network deletion error

Network deletion errors out because L3 data is not processed
correctly.

Change-Id: Ic2acba1e7ac95ad36e97a1d452e747eefd6b911e
Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Merge "Fix the network deletion error"
Move extensions directory

Directory 'extensions' need to be moved into neutron package to have
coherency and a separated tree between code base and tests.

run_tests script needs to be changed to run the tests.

Some minor flake8 violations fixed. Now the package is clean.

Change-Id: I305e5b4d1fa7037534da1473c8286b792128744e
Merge "Move extensions directory"
Configure 'api_extensions_path' in midonet plugin

'api_extensions_path' need to be set before creating the test api and
instantiate the PluginAwareExtensionsManager in the 'test_db_plugin'
module.

Otherwise, the plugin will raise an exception like:

ExtensionsNotFound: Extensions not found: ['extension_name']

when adding new vendor extensions in the 'supported_extension_aliases'
attribute in the MidonetPluginV2 class.

Change-Id: I666bdadb8cef37d54444e9b55aaab923b6ccf717
Catch up with the upstream change in dhcp driver

A change in upstream neutron:
https://github.com/openstack/neutron/commit/9569b2fe58d0e836071992f545886ca985d5ace8

changed dhcp driver interface.
This patch quickly fixes the issue just by making use of
Dnsmasq driver's methods.

Fixes: MN-2757

Change-Id: I4c8a4476ed82e4a4efdd762ae4f14587871a02a6
Merge "Configure 'api_extensions_path' in midonet plugin"
Add host extension

Host extension for midonet exposed as is documented here:
https://github.com/midokura/midonet-docs/blob/master/api/source/api/\
rest-api-specification.rst#host

Host Version has been merged into Host entity.

Host interface read only resource exposed too.

Full tests over exposed endpoints.

Change-Id: I990e4fec04bc853e221c609d6c404cba363284b4
Move utilities in the core plugin to the util module

This patch moves handle_api_error, MidonetApiExcption and
MidonetPluginException to midonet/neutron/common/util.py.

Change-Id: I011140d3f85f9c48e7d5cdbe5c5b85c7e400634f
Signed-off-by: Taku Fukushima <tfukushima@midokura.com>
Midonet Network extension

New Midonet Network (Bridge) extension. Using midonet, the network
creation will show the own bridge inbound and outbound filters.

Change-Id: I65512dde6311a81c5a94a7ebd9d2508df9241510
Add system status extension

Manage and view the Midonet system status from the Neutron API.

Change-Id: Icf30fdd1776bfe914f3ac0020dfb25bdd0a882d1
Add subnet (DHCP Subnet) extension

Add Midonet attributes to Neutron subnet's resource. DHCP hosts endpoint
embedded in the subnet as well.

Change-Id: Idf9a014b08d6c3adc9eed31a09a54fdadd54313d
Use the new MidonetClient object

Old MidonetClient is deprecated in the favor of the new one.

Change-Id: Iba38406066b4ffdddf766490da6441190abf5409
Signed-off-by: Ryu Ishimoto <ryu@midokura.com>
Add skeleton of a decorator for API handler mixins

This patch adds a decorator function that generates required methods for
API handler mixins based on the given list of strings represent required
handlers.

Change-Id: I8da516c849d1216201af9e753ab9fd1fe6ce9ddb
Signed-off-by: Taku Fukushima <tfukushima@midokura.com>
Modify the core plugin to load extensions

Change-Id: Iff53db4754aac857e4dd10a2be1ade975029eb14
Signed-off-by: Taku Fukushima <tfukushima@midokura.com>
Add constants for generate_methods

This patch adds symbols for 'list', 'show', 'create', 'update' and
'delete'. It'd be too easy to have typos for them and I added symbols
for them to make it easier to detect typos using the static checker.

Change-Id: I7e786ba0ca0e24c272ab016b3fdf25cc608a87f3
Signed-off-by: Taku Fukushima <tfukushima@midokura.com>
Add Tunnel Zone and Tunnel Zone Host API handlers

This patch adds TunnelzoneHandlerMixin and
TunnelzonehostHandlerMixin to the core plugin using
generate_methods decorators.

Change-Id: Ia652c5afa0e00a358325b80d6c6dab27152ced56
Signed-off-by: Taku Fukushima <tfukushima@midokura.com>