Kaiwei Fan [Mon, 28 Oct 2013 22:47:51 +0000 (15:47 -0700)]
Fix random unit-test failure for NVP advanced plugin
Two problems were observed:
1. Tasks are not scheduled as desired in greenthread. The fix is to
increase the max status probing time from 1 second to 10 seconds.
2. An error message is show in unit-test log output. Turns out in
addition to a bug that may cause task manager stop prematurely,
another unit-test case test_vcns_driver can cause same error
message being displayed in the log.
Akihiro MOTOKI [Fri, 18 Oct 2013 06:09:29 +0000 (15:09 +0900)]
Ensure OVS plugin is loaded in OVS plugin test
In TestOpenvswitchSGServerRpcCallBack and NetworkBindingsTest
in OVS plugin tests, OVS plugin was not loaded properly.
* For NetworkBindingsTest, it can be fixed by changing setUp()
to take 'plugin' arguments in the base test classes
SecurityGroupDBTestCase and SGServerRpcCallBackMixinTestCase.
This fixes bug 1242510 in ML2 unit tests.
* For NetworkBindingsTest, it can be fixed by passing the plugin
class to super.setUp(). The test itself needs to be updated
because network binding is added when a network is created.
* NetworkBindingsTest in Linux Bridge plugin has the same issue,
so it is also fixed in this patch.
Eugene Nikanorov [Tue, 22 Oct 2013 13:49:00 +0000 (17:49 +0400)]
LBaaS: Fix incorrect pool status change
Avoid incorrect status change when deleting the pool.
We can check for the conditions prior putting the pool
to PENDING_DELETE state, in case delete conditions are met
it is safe to change the state to PENDING_DELETE.
Also, change create_vip and update_vip operations to respect
PENDING_DELETE and avoid race conditions.
Aaron Rosen [Fri, 25 Oct 2013 00:22:56 +0000 (17:22 -0700)]
NVP: Correct NVP router port mac to match neutron
Previously when router ports were created the mac_address from neutron
was not passed to nvp so nvp generated it's own mac_address for the port.
This patch fixes this by passing the mac_address on the port to nvp.
Zhongyue Luo [Wed, 9 Oct 2013 01:44:01 +0000 (09:44 +0800)]
Utilizes assertIsNone and assertIsNotNone
Using assertEqual/assertNotEqual to test if an element
is or is not None is too python2.4.
Our unit testing framework supports assertIsNone and assertIsNotNone
which were created for these types of tests.
Make test_nvp_sync.SyncLoopingCallTestCase reliable
This patch removes the previous check that verified the mocked
looping call had an exact number of calls, and replaces it with a
simpler check that just verifies that the mock has been called.
As a consequence, this patch also shortens the test duration.
Baodong Li [Tue, 8 Oct 2013 15:19:32 +0000 (15:19 +0000)]
Detect and process live-migration in Cisco plugin
With Cisco/Nexus plugin, migration is not fully supported. Logic to detect
port binding change needs to be added in update_port(), and provisioning of
nexus switch(es) should be done accordingly
added test code for update_port() in the model layer and the db layer
Brian Haley [Fri, 27 Sep 2013 14:57:40 +0000 (10:57 -0400)]
Spawn arping in thread to speed-up floating IP
Change _send_gratuitous_arp_packet() to spawn a thread to call
arping after a floating IP is assigned. This way it doesn't
stall _process_routers() from returning quickly due to calling
pool.waitall().
The code currently raises when it's not able to find the port to be
deleted on the backend. This might happen, for instance, when the
port is manually removed or, in some cases, if port creation failed
in the first place.
There's little sense in raising when a resource to be removed is not
found; therefore this patch replaces the raise statement with a log
statement.
When recycling an IP, allocation pools are loaded with an inner
join with ip avaiblity ranges. However, if the pool is exhausted,
there will be no availability ranges and the query will return
no results because of the inner join. It will therefore be
impossible to reuse IP addresses once the pool has been exhausted.
This patch tries to reload allocation pools without joining on
IP avaiability ranges if the first query did not return any result.
Replacing an inner join with an outer join will not be possible
as postgresql backend does not support 'SELECT ... FOR UPDATE' with
outer joins (for more info see bug 1215350).
The patch also contains unit tests for verifying IP are recycled
correctly even when the pool is exhausted.
Joe Gordon [Tue, 15 Oct 2013 01:46:14 +0000 (18:46 -0700)]
Set wsgi logger to use __name__
Although underneath this is the eventlet.wsgi.server server, Other
OpenStack projects, don't use that logger instead they use there own.
This will also mean the wsgi server will stop logging on just the
warning level. We want wsgi server to at least log on info level
so it will log when a request is processed and what the return code is.
The SystemExit exception should be logged in dhcp-agent, the
operator may miss the useful exception messages to debug.
* Add error log for SystemExit in dhcp-agent.
* Add addCleanup(mock.patch.stopall) in setup()
* Remove teardown()
* Add unit test for None and nonexistent interface_driver.
Jakub Libosvar [Thu, 3 Oct 2013 17:45:09 +0000 (19:45 +0200)]
Removing rpc communication from db transaction
In a transaction context of ExtraRoute_db_mixin.update_router() was
called super method that uses subtransaction and communication with l3
agent. In case of agent's heartbeat happens while there is running
transaction, update heartbeat in agents table gets stuck in a deadlock.
Joe Mills [Thu, 3 Oct 2013 16:55:18 +0000 (01:55 +0900)]
Add port bindings to ports created in Midonet
Currently Midokura uses its own script (mm-ctl) to bind ports. However, support
for using this script is left out of the nova and neutron projects. This causes
confusion and makes deployments unnecessarily complicated for customers using
Havana. This fix is to change Neutron to properly set up port bindings to use
the "midonet" vif driver when creating a port. Corresponding changes will be
submitted to the devstack and Nova projects.
zhhuabj [Tue, 15 Oct 2013 05:55:13 +0000 (13:55 +0800)]
Enable one disabled tests in NEC plugin that blocked by 1229954
Enable the disabled tests in NEC plugin that blocked by 1229954
https://github.com/openstack/neutron/blob/master/neutron
/tests/unit/nec/test_security_group.py#L64
zhhuabj [Sat, 12 Oct 2013 09:31:38 +0000 (17:31 +0800)]
Updating address pairs with xml doesn't work
Below command can't work because list element
"allowed_address_pairs" hasn't been updated
into the varaiable "attr.PLURALS"
"neutron port-update <port-uuid> \
--allowed-address-pairs list=true type=dict \
ip_address=10.0.0.1 --request-format xml"
This change adds the ability to monitor the local ovsdb for
interface changes so that the l2 agent can avoid unnecessary
polling. Minimal changes are made to the agent so the risk
of breakage should be low. Future efforts to make the agent
entirely event-based may be able to use OvsdbMonitor as a
starting point.
By default polling minimization is not done, and can only be
enabled by setting 'minimize_polling = True' in the ovs
section of the l2 agent's config file.
Avoid suppressing underlying error when deploy.loadapp fails
Raise log level at the first load attempt. If there is a
fundamental problem with the environment, a Lookup error
is not helpful in troubleshooting the problem further.
Interacting with a long-running asynchronous process requires the
use of non-blocking io. This change adds a helper class that can
launch a long-running process and read stdout and stderr in a
non-blocking fashion via eventlet.
This functionality is intended to support monitoring ovsdb via
a long-running and root-privileged invocation of ovsdb-client.
The complexity of the system interaction in this patch suggested
the addition of a functional test that validated actual behaviour.
The test was added under the neutron/tests/functional path which
is now included in the testr search path.
This fix adds a "nexus_l3_enable" configuration boolean for the
Cisco Nexus plugin. When this config boolean is set to False (default),
then the Nexus switches are only used for L2 switching/segmentation, and
layer 3 functionality is deferred to the OVS subplugin / network
control node. If this config boolean is set to True, layer 3
functionality, e.g. switch virtual interfaces, are supported on
the Nexus switches. (Note that layer 3 functionality is not supported
on all versions/models Nexus switches.)
Some other things addressed with this fix:
- The l3_port_check keyword argument which is optionally passed to the
Cisco plugin's delete_port method was not being forwarded on to the
OVS (sub) plugin. This keyword argument needs to be forwarded to OVS
e.g. when the delete_port is being done in the context of a
router interface delete (whereby l3_port_check==False).
- UT test cases are added for new "nexus_l3_enable" config, which
exercise router interface add/delete.
- The Cisco test_network_plugin.py module is refactored/reorganized
in order to cleanly add a new router interface test class.
- The test_model_update_port_rollback test case was yielding a false
positive result (device_owner was not being passed to self.port).