Add new configuration test in sanity check: vf_extended_management

This test will check if 'ip link' version installed in this server
supports extended VF management parameter 'min_tx_rate'. This
parameter set the minimum egress rate for an interface.

This test is executed when SR-IOV back-end and QoS extension
are enabled.

DocImpact
Partial-Bug: #1560963

Change-Id: Ie9334f4ad2f6b047bf56689edf3333a8a612364a
This commit is contained in:
Rodolfo Alonso Hernandez 2016-07-18 11:52:12 +01:00 committed by Ihar Hrachyshka
parent 60325f4ae9
commit a2dc3c35e3
4 changed files with 38 additions and 5 deletions

View File

@ -41,6 +41,7 @@ class IpLinkConstants(object):
IP_LINK_CAPABILITY_STATE = "state"
IP_LINK_CAPABILITY_VLAN = "vlan"
IP_LINK_CAPABILITY_RATE = "rate"
IP_LINK_CAPABILITY_MIN_TX_RATE = "min_tx_rate"
IP_LINK_CAPABILITY_SPOOFCHK = "spoofchk"
IP_LINK_SUB_CAPABILITY_QOS = "qos"

View File

@ -144,12 +144,8 @@ def icmpv6_header_match_supported():
actions="NORMAL")
def vf_management_supported():
def _vf_management_support(required_caps):
is_supported = True
required_caps = (
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_STATE,
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_SPOOFCHK,
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_RATE)
try:
vf_section = ip_link_support.IpLinkSupport.get_vf_mgmt_section()
for cap in required_caps:
@ -165,6 +161,24 @@ def vf_management_supported():
return is_supported
def vf_management_supported():
required_caps = (
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_STATE,
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_SPOOFCHK,
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_RATE)
return _vf_management_support(required_caps)
def vf_extended_management_supported():
required_caps = (
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_STATE,
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_SPOOFCHK,
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_RATE,
ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_MIN_TX_RATE,
)
return _vf_management_support(required_caps)
def netns_read_requires_helper():
ipw = ip_lib.IPWrapper()
nsname = "netnsreadtest-" + uuidutils.generate_uuid()

View File

@ -185,6 +185,16 @@ def check_vf_management():
return result
def check_vf_extended_management():
result = checks.vf_extended_management_supported()
if not result:
LOG.error(_LE('Check for VF extended management support failed. '
'Please ensure that the version of ip link '
'being used has VF extended support: version '
'"iproute2-ss140804", git tag "v3.16.0"'))
return result
def check_ovsdb_native():
cfg.CONF.set_override('ovsdb_interface', 'native', group='OVS')
result = checks.ovsdb_native_supported()
@ -248,6 +258,8 @@ OPTS = [
help=_('Check for ICMPv6 header match support')),
BoolOptCallback('vf_management', check_vf_management,
help=_('Check for VF management support')),
BoolOptCallback('vf_extended_management', check_vf_extended_management,
help=_('Check for VF extended management support')),
BoolOptCallback('read_netns', check_read_netns,
help=_('Check netns permission settings')),
BoolOptCallback('dnsmasq_version', check_dnsmasq_version,
@ -307,6 +319,9 @@ def enable_tests_from_config():
cfg.CONF.set_default('ipset_installed', True)
if cfg.CONF.SECURITYGROUP.enable_security_group:
cfg.CONF.set_default('ip6tables_installed', True)
if ('sriovnicswitch' in cfg.CONF.ml2.mechanism_drivers and
'qos' in cfg.CONF.ml2.extension_drivers):
cfg.CONF.set_default('vf_extended_management', True)
def all_tests_passed():

View File

@ -77,6 +77,9 @@ class SanityTestCaseRoot(functional_base.BaseSudoTestCase):
def test_vf_management_runs(self):
checks.vf_management_supported()
def test_vf_extended_management_runs(self):
checks.vf_extended_management_supported()
def test_namespace_root_read_detection_runs(self):
checks.netns_read_requires_helper()