Commit Graph

15 Commits (0befdbcba31dcd0fb43f93e1d48ac186a8f3e0b6)

Author SHA1 Message Date
Maru Newby 798824cab0 Allow setting a rootwrap cmd for functional tests
Previously, sudo-requiring functional tests hardcoded the use of
'sudo' as the root helper.  Devstack gate jobs do not allow
password-less invocation of 'sudo', though, so such tests were unable
to run in the gate.  This patch adds the ability to configure the
rootwrap command installed by devstack by setting the OS_ROOTWRAP_CMD
environment variable in the test execution environment, allowing
sudo-requiring tests to run.

Change-Id: I3b8f6b4f14ac1743e08b9401f73951885165350a
Partial-bug: #1336172
2014-07-02 00:02:08 +00:00
Henry Gessau 17686c1f24 Ignore variable column widths in ovsdb functional tests
The ovsdb tests check the output of "ovsdb-client monitor" before and after
some operations. The first line of output is a header row with spaces for
column separation. The column widths can vary depending on the data in the
columns, so compress multiple spaces to one for testing.

Change-Id: I6b4690ea9ef1c1b215411ca2c39b1e65fec2c6c7
Partial-bug: #1336172
2014-07-01 17:56:49 -04:00
Henry Gessau 54ffa26ce8 Use correct MAX_LEN constant in agent functional tests
Closes-bug: #1334922

Change-Id: I62bd12da21e778f5cca97d6280c107575d912a81
2014-06-26 22:17:09 -04:00
Jenkins 1974244531 Merge "Merge multiple constants defining linux interface maximum length" 2014-06-25 03:48:13 +00:00
Cedric Brandily e299349b3b Merge multiple constants defining linux interface maximum length
DEVICE_NAME_MAX_LEN constant in neutron.common.constants replaces
and correct multiple constants defining linux interface maximum

Closes-Bug: #1332571
Change-Id: I63f760a21e17dcd57b3685b1e71c913d2722e097
2014-06-23 19:45:30 +02:00
liu-sheng b30c47233d Remove the useless vim modelines
Change-Id: I41286e0b8f74c90b7078c3d3fb041b6586d95ab0
Closes-Bug: #1229324
2014-06-21 15:07:31 +08:00
Terry Wilson ab4dc5261e Remove run-time version checking for openvswitch features
The current method of checking openvswitch and kernel versions for
specific feature support is brittle, distro-specific and unsupportable.

This patch removes the runtime version checks and implements a test
script which allows testing specific neutron features or can test
that all features required by a specific configuration are available.

For example, to test VXLAN support in openvswitch, either:

  neutron-sanity-check --ovs_vxlan

or pass in the deployed configuration files with AGENT/tunnel_types
containing 'vxlan', like:

  neutron-sanity-check --config-file /etc/neutron/plugins/ml2.conf.ini

Deployment tools can then test that the required features exist without
relying on version numbers and without incurring a penalty every time
the agent is started.

Implements: blueprint remove-openvswitch-version-check
Change-Id: I5e822d97b9bece9242ba5ac8901aa0ca4f090cfe
2014-06-04 09:25:53 -05:00
Jakub Libosvar c2634fa580 Fix H302 violations in unit tests
H302 violation is reported by flake8 when importing separated objects from
modules instead of importing the whole module.
e.g.   from package.module import function
is changed to
       from package import module

Change-Id: Ic6975f39c755ded54149a9c01fcdcfaf78c596fc
Partial-Bug: #1291032
2014-05-04 12:39:19 +02:00
Kyle Mestery f86d244e45 Add functional tests to verify ovs_lib VXLAN detection
This commit adds a functional test to verify host VXLAN support. It compares
the results of this functional test with the logic in ovs_lib to ensure both
report the same values.

Closes-Bug: #1301101

Change-Id: Id91c755d762bea134cc451952d0f13d64576663a
2014-04-13 19:29:02 +00:00
Kyle Mestery 83a11d406e Add common base class for agent functional tests
Refactor the functional tests a bit to add a common base class for agent
tests. This is needed an upcoming commit which adds a functional test
for VXLAN version checking.

Closes-Bug: #1301363

Change-Id: I438e401cbfb40e5557e5125f2a409bac5c1fd1c2
2014-04-07 08:13:59 +00:00
lizheming 42683e1784 Fix bug:range() is not same in py3.x and py2.x
in python3.x, there is no method named xrange(),
it has replaced by range(),which is equal to xrange() in python2.x.
so we must fix this issue.we use six module to fix this issue.

Change-Id: I9cee3f0df2d8abbf6f66d7c5a3a0fed98df622e8
Closes-Bug: #1268439
2014-03-11 16:44:47 +08:00
Terry Wilson 14950e492a Add configurable ovsdb monitor respawn interval
If minimize_polling=True and the ovsdb-client process died, the
default respawn interval of 0 would mean that we'd start polling
again. This patch adds the option ovsdb_monitor_respawn_interval and
defaults it to 30 seconds.

Change-Id: I12c1e05ec4d6d2bd4d84024a91116e2ac3974868
Close-Bug: 1243867
2013-11-20 15:16:27 -06:00
Terry Wilson 61e9268bd4 Ensure get_pid_to_kill works with rootwrap script
To ensure that correct process is killed when using a rootwrap
script, we must recursively list the children of our top-level
process and kill the last one. This patch uses the psutil python
module which is already used in the heat-cfntools project.

Change-Id: I702bb9dd794c08fcaab637284ee303de1778cbb9
2013-11-20 09:57:23 -06:00
Maru Newby cb0df591a9 Add the option to minimize ovs l2 polling
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.

Closes-Bug: #1177973

Change-Id: I26c035b48a74df2148696869c5a9affae5ab3d27
2013-10-14 22:24:15 +00:00
Maru Newby acf0209b28 Add support for managing async processes
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.

Partial-Bug: #1177973

Change-Id: I9969e556acecf7a9e77d873371cc2ec2647be011
2013-10-14 07:20:02 +00:00