Merge "Check missed ip6tables utility"
This commit is contained in:
commit
fa6e77c0c4
neutron
@ -354,6 +354,17 @@ def ipset_supported():
|
||||
return False
|
||||
|
||||
|
||||
def ip6tables_supported():
|
||||
try:
|
||||
cmd = ['ip6tables', '--version']
|
||||
agent_utils.execute(cmd)
|
||||
return True
|
||||
except (OSError, RuntimeError, IndexError, ValueError) as e:
|
||||
LOG.debug("Exception while checking for installed ip6tables. "
|
||||
"Exception: %s", e)
|
||||
return False
|
||||
|
||||
|
||||
def get_minimal_dibbler_version_supported():
|
||||
return MINIMUM_DIBBLER_VERSION
|
||||
|
||||
|
@ -209,6 +209,13 @@ def check_ipset():
|
||||
return result
|
||||
|
||||
|
||||
def check_ip6tables():
|
||||
result = checks.ip6tables_supported()
|
||||
if not result:
|
||||
LOG.error(_LE('Cannot run ip6tables. 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,
|
||||
@ -243,6 +250,8 @@ OPTS = [
|
||||
help=_('Check minimal dibbler version')),
|
||||
BoolOptCallback('ipset_installed', check_ipset,
|
||||
help=_('Check ipset installation')),
|
||||
BoolOptCallback('ip6tables_installed', check_ip6tables,
|
||||
help=_('Check ip6tables installation')),
|
||||
]
|
||||
|
||||
|
||||
@ -282,6 +291,8 @@ def enable_tests_from_config():
|
||||
cfg.CONF.set_override('keepalived_ipv6_support', True)
|
||||
if cfg.CONF.SECURITYGROUP.enable_ipset:
|
||||
cfg.CONF.set_override('ipset_installed', True)
|
||||
if cfg.CONF.SECURITYGROUP.enable_security_group:
|
||||
cfg.CONF.set_override('ip6tables_installed', True)
|
||||
|
||||
|
||||
def all_tests_passed():
|
||||
|
@ -41,6 +41,9 @@ class SanityTestCase(base.BaseTestCase):
|
||||
def test_ipset_support(self):
|
||||
checks.ipset_supported()
|
||||
|
||||
def test_ip6tables_support(self):
|
||||
checks.ip6tables_supported()
|
||||
|
||||
|
||||
class SanityTestCaseRoot(functional_base.BaseSudoTestCase):
|
||||
"""Sanity checks that require root access.
|
||||
|
Loading…
x
Reference in New Issue
Block a user