import netaddr
from oslo_log import log as logging
+import six
from neutron.agent.linux import ip_lib
from neutron.agent.linux import ip_link_support
"Exception: %s", e)
return False
return True
+
+
+def ovsdb_native_supported():
+ # Running the test should ensure we are configured for OVSDB native
+ try:
+ ovs = ovs_lib.BaseOVS()
+ ovs.get_bridges()
+ return True
+ except ImportError as ex:
+ LOG.error(_LE("Failed to import required modules. Ensure that the "
+ "python-openvswitch package is installed. Error: %s"),
+ ex.message)
+ except Exception as ex:
+ LOG.exception(six.text_type(ex))
+
+ return False
return result
+def check_ovsdb_native():
+ cfg.CONF.set_override('ovsdb_interface', 'native', group='OVS')
+ result = checks.ovsdb_native_supported()
+ if not result:
+ LOG.error(_LE('Check for native OVSDB support failed.'))
+ return result
+
+
# Define CLI opts to test specific features, with a calback for the test
OPTS = [
BoolOptCallback('ovs_vxlan', check_ovs_vxlan, default=False,
help=_('Check netns permission settings')),
BoolOptCallback('dnsmasq_version', check_dnsmasq_version,
help=_('Check minimal dnsmasq version')),
+ BoolOptCallback('ovsdb_native', check_ovsdb_native,
+ help=_('Check ovsdb native interface support')),
]
cfg.CONF.set_override('read_netns', True)
if cfg.CONF.dhcp_driver == 'neutron.agent.linux.dhcp.Dnsmasq':
cfg.CONF.set_override('dnsmasq_version', True)
+ if cfg.CONF.OVS.ovsdb_interface == 'native':
+ cfg.CONF.set_override('ovsdb_native', True)
def all_tests_passed():