return False
+def ipset_supported():
+ try:
+ cmd = ['ipset', '--version']
+ agent_utils.execute(cmd)
+ return True
+ except (OSError, RuntimeError, IndexError, ValueError) as e:
+ LOG.debug("Exception while checking for installed ipset. "
+ "Exception: %s", e)
+ return False
+
+
def get_minimal_dibbler_version_supported():
return MINIMUM_DIBBLER_VERSION
cfg.CONF.import_group('ml2_sriov',
'neutron.plugins.ml2.drivers.mech_sriov.mech_driver.'
'mech_driver')
+ cfg.CONF.import_group('SECURITYGROUP', 'neutron.agent.securitygroups_rpc')
dhcp_agent.register_options(cfg.CONF)
cfg.CONF.register_opts(l3_hamode_db.L3_HA_OPTS)
return result
+def check_ipset():
+ result = checks.ipset_supported()
+ if not result:
+ LOG.error(_LE('Cannot run ipset. Please ensure that it '
+ 'is installed.'))
+ return result
+
+
# Define CLI opts to test specific features, with a callback for the test
OPTS = [
BoolOptCallback('ovs_vxlan', check_ovs_vxlan, default=False,
help=_('Check keepalived IPv6 support')),
BoolOptCallback('dibbler_version', check_dibbler_version,
help=_('Check minimal dibbler version')),
+ BoolOptCallback('ipset_installed', check_ipset,
+ help=_('Check ipset installation')),
]
cfg.CONF.set_override('ovsdb_native', True)
if cfg.CONF.l3_ha:
cfg.CONF.set_override('keepalived_ipv6_support', True)
+ if cfg.CONF.SECURITYGROUP.enable_ipset:
+ cfg.CONF.set_override('ipset_installed', True)
def all_tests_passed():
def test_dibbler_version(self):
checks.dibbler_version_supported()
+ def test_ipset_support(self):
+ checks.ipset_supported()
+
class SanityTestCaseRoot(functional_base.BaseSudoTestCase):
"""Sanity checks that require root access.