Skip to content

Commit

Permalink
reboot or start VM, the VF will be removed and added, move detect dev…
Browse files Browse the repository at this point in the history
…ices before checking the module
  • Loading branch information
LiliDeng committed Feb 21, 2023
1 parent 2cb5569 commit 4bd803f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions microsoft/testsuites/network/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,7 @@ def sriov_basic_test(
environment: Environment, vm_nics: Dict[str, Dict[str, NicInfo]]
) -> None:
for node in environment.nodes.list():
# 1. Check module of sriov network device is loaded.
used_module = get_used_module(node)
if not node.tools[KernelConfig].is_built_in(modules_config_dict[used_module]):
lsmod = node.tools[Lsmod]
assert_that(lsmod.module_exists(used_module, force_run=True)).described_as(
"The module of sriov network device isn't loaded."
).is_true()

# 2. Check VF counts listed from lspci is expected.
# 1. Check VF counts listed from lspci is expected.
lspci = node.tools[Lspci]
devices_slots = lspci.get_device_names_by_type(
constants.DEVICE_TYPE_SRIOV, force_run=True
Expand All @@ -114,6 +106,14 @@ def sriov_basic_test(
" please check the driver works properly"
).is_length(len([x for x in vm_nics[node.name].values() if x.lower != ""]))

# 2. Check module of sriov network device is loaded.
used_module = get_used_module(node)
if not node.tools[KernelConfig].is_built_in(modules_config_dict[used_module]):
lsmod = node.tools[Lsmod]
assert_that(lsmod.module_exists(used_module, force_run=True)).described_as(
"The module of sriov network device isn't loaded."
).is_true()


def sriov_vf_connection_test(
environment: Environment,
Expand Down

0 comments on commit 4bd803f

Please sign in to comment.