Skip to content

Commit

Permalink
Update "numa_aware_vswitch" and "sriov_free_resource" tests
Browse files Browse the repository at this point in the history
Add nic-partitioning support to "numa_aware_vswitch" and
"sriov_free_resource".

Nic-partitioning sriov stores values in a different way than the usual
deployment topology. Update the tests to support both deployment ways.

Change-Id: Ib0232608128af5cce43d26305a1b3f7200aa8141
  • Loading branch information
MaxBab committed Oct 26, 2020
1 parent dd6e3ab commit 641d142
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion nfv_tempest_plugin/tests/common/shell_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,12 @@ def run_hypervisor_command_build_from_config(file_path, search_param,
assert result != '', "{} {}".format(msg, hypervisor)

result = "[" + result.replace('\n', ", ") + "]"
dev_names = [x['devname'] for x in json.loads(result)]
dev_names = [x.get('devname') for x in json.loads(result)]
# The nic-partitioning deployment does not store "devname" param.
# It has the "domain", "function" and other attributes.
# As a result, many None params added to the list.
# The below command excludes the "None" from the list.
dev_names = [devname for devname in dev_names if devname]
cmd = ''
for device in dev_names:
cmd += "{} {};".format(command, device)
Expand Down
7 changes: 4 additions & 3 deletions nfv_tempest_plugin/tests/scenario/manager_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,10 +911,10 @@ def locate_ovs_physnets(self, node=None, keys=None):
numa_aware_tun = []
pci_whitelist = []
for physnet in numa_phys_content:
if '=>' in physnet:
if 'physical_network' in physnet:
pci_whitelist = yaml.safe_load(physnet.replace('=>', ':'))
elif '=>' in physnet:
numa_aware_phys = yaml.safe_load(physnet.replace('=>', ':'))
elif 'physical_network' in physnet:
pci_whitelist = yaml.safe_load(physnet)
elif ':' in physnet:
bridge_mapping = yaml.safe_load(physnet)
else:
Expand All @@ -940,6 +940,7 @@ def locate_ovs_physnets(self, node=None, keys=None):
# Exclude sriov networks from non numa aware list
sriov_nets = [sriov_net['physical_network']
for sriov_net in pci_whitelist]
sriov_nets = list(set(sriov_nets))
numa_physnets['non_numa_aware_net'] = \
[non_numa for non_numa in numa_physnets['non_numa_aware_net']
if non_numa not in sriov_nets]
Expand Down

0 comments on commit 641d142

Please sign in to comment.