Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions lisa/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def check(self, capability: Any) -> search_space.ResultReason:

return result

def _generate_min_capability(self, capability: Any) -> Any:
def _choose_value(self, capability: Any) -> Any:
env = EnvironmentSpace(topology=self.topology)
assert isinstance(capability, EnvironmentSpace), f"actual: {type(capability)}"
assert capability.nodes
Expand All @@ -145,7 +145,7 @@ def _generate_min_capability(self, capability: Any) -> Any:
else:
current_cap = capability.nodes[index]

env.nodes.append(current_req.generate_min_capability(current_cap))
env.nodes.append(current_req.choose_value(current_cap))

return env

Expand Down Expand Up @@ -327,12 +327,11 @@ def create_node_from_requirement(
) -> Node:
min_requirement = cast(
schema.Capability,
node_requirement.generate_min_capability(node_requirement),
)
assert isinstance(min_requirement.node_count, int), (
f"must be int after generate_min_capability, "
f"actual: {min_requirement.node_count}"
node_requirement.choose_value(node_requirement),
)
assert isinstance(
min_requirement.node_count, int
), f"must be int after choose_value, actual: {min_requirement.node_count}"
# node count should be expanded in platform already
assert min_requirement.node_count == 1, f"actual: {min_requirement.node_count}"
mock_runbook = schema.RemoteNode(
Expand Down
2 changes: 1 addition & 1 deletion lisa/features/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __hash__(self) -> int:
def _get_key(self) -> str:
return f"{self.type}/{self.is_enabled}"

def _generate_min_capability(self, capability: Any) -> Any:
def _choose_value(self, capability: Any) -> Any:
return self


Expand Down
4 changes: 2 additions & 2 deletions lisa/features/nvme.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ def check(self, capability: Any) -> search_space.ResultReason:

return result

def _generate_min_capability(self, capability: Any) -> Any:
def _choose_value(self, capability: Any) -> Any:
assert isinstance(capability, NvmeSettings), f"actual: {type(capability)}"
min_value = NvmeSettings()

if self.disk_count or capability.disk_count:
min_value.disk_count = search_space.generate_min_capability_countspace(
min_value.disk_count = search_space.choose_value_countspace(
self.disk_count, capability.disk_count
)

Expand Down
49 changes: 29 additions & 20 deletions lisa/microsoft/testsuites/network/sriov.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def verify_sriov_single_vf_connection_max_cpu(

@TestCaseMetadata(
description="""
This case needs 2 nodes and 8 nics. And it verifies module of sriov network
This case needs 2 nodes and max nics. And it verifies module of sriov network
interface is loaded and each synthetic nic is paired with one VF, and check
rx statistics of source and tx statistics of dest increase after send 200 Mb
file from source to dest.
Expand All @@ -211,8 +211,8 @@ def verify_sriov_single_vf_connection_max_cpu(
requirement=simple_requirement(
min_count=2,
network_interface=schema.NetworkInterfaceOptionSettings(
nic_count=8,
data_path=schema.NetworkDataPath.Sriov,
nic_count=search_space.IntRange(min=2, choose_max_value=True),
),
),
)
Expand All @@ -223,7 +223,7 @@ def verify_sriov_max_vf_connection(self, environment: Environment) -> None:

@TestCaseMetadata(
description="""
This case needs 2 nodes, 8 nics and 64 Vcpus. And it verifies module of sriov
This case needs 2 nodes, max nics and 64 Vcpus. And it verifies module of sriov
network interface is loaded and each synthetic nic is paired with one VF, and
check rx statistics of source and tx statistics of dest increase after send 200
Mb file from source to dest.
Expand All @@ -242,8 +242,8 @@ def verify_sriov_max_vf_connection(self, environment: Environment) -> None:
min_count=2,
min_core_count=64,
network_interface=schema.NetworkInterfaceOptionSettings(
nic_count=8,
data_path=schema.NetworkDataPath.Sriov,
nic_count=search_space.IntRange(min=2, choose_max_value=True),
),
),
)
Expand Down Expand Up @@ -332,7 +332,6 @@ def verify_sriov_disable_enable_on_guest(self, environment: Environment) -> None
requirement=simple_requirement(
network_interface=schema.NetworkInterfaceOptionSettings(
data_path=schema.NetworkDataPath.Sriov,
max_nic_count=8,
),
),
)
Expand Down Expand Up @@ -369,16 +368,18 @@ def verify_sriov_add_max_nics(

@TestCaseMetadata(
description="""
This case verify VM works well when provisioning with max (8) sriov nics.
This case verify VM works well when provisioning with max sriov nics.

Steps,
1. Provision VM with max network interfaces with enabling accelerated network.
2. Do the basic sriov testing.
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=features.Sriov(),
network_interface=schema.NetworkInterfaceOptionSettings(
data_path=schema.NetworkDataPath.Sriov,
nic_count=search_space.IntRange(min=2, choose_max_value=True),
),
),
)
def verify_sriov_provision_with_max_nics(self, environment: Environment) -> None:
Expand All @@ -387,7 +388,7 @@ def verify_sriov_provision_with_max_nics(self, environment: Environment) -> None

@TestCaseMetadata(
description="""
This case verify VM works well when provisioning with max (8) sriov nics.
This case verify VM works well when provisioning with max sriov nics.

Steps,
1. Provision VM with max network interfaces with enabling accelerated network.
Expand All @@ -397,8 +398,10 @@ def verify_sriov_provision_with_max_nics(self, environment: Environment) -> None
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=features.Sriov(),
network_interface=schema.NetworkInterfaceOptionSettings(
data_path=schema.NetworkDataPath.Sriov,
nic_count=search_space.IntRange(min=2, choose_max_value=True),
),
),
)
def verify_sriov_provision_with_max_nics_reboot(
Expand All @@ -413,7 +416,7 @@ def verify_sriov_provision_with_max_nics_reboot(

@TestCaseMetadata(
description="""
This case verify VM works well when provisioning with max (8) sriov nics.
This case verify VM works well when provisioning with max sriov nics.

Steps,
1. Provision VM with max network interfaces with enabling accelerated network.
Expand All @@ -423,8 +426,10 @@ def verify_sriov_provision_with_max_nics_reboot(
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=features.Sriov(),
network_interface=schema.NetworkInterfaceOptionSettings(
data_path=schema.NetworkDataPath.Sriov,
nic_count=search_space.IntRange(min=2, choose_max_value=True),
),
),
)
def verify_sriov_provision_with_max_nics_reboot_from_platform(
Expand All @@ -440,7 +445,7 @@ def verify_sriov_provision_with_max_nics_reboot_from_platform(

@TestCaseMetadata(
description="""
This case verify VM works well when provisioning with max (8) sriov nics.
This case verify VM works well when provisioning with max sriov nics.

Steps,
1. Provision VM with max network interfaces with enabling accelerated network.
Expand All @@ -450,8 +455,10 @@ def verify_sriov_provision_with_max_nics_reboot_from_platform(
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=features.Sriov(),
network_interface=schema.NetworkInterfaceOptionSettings(
data_path=schema.NetworkDataPath.Sriov,
nic_count=search_space.IntRange(min=2, choose_max_value=True),
),
),
)
def verify_sriov_provision_with_max_nics_stop_start_from_platform(
Expand Down Expand Up @@ -479,8 +486,10 @@ def verify_sriov_provision_with_max_nics_stop_start_from_platform(
priority=1,
requirement=simple_requirement(
min_count=2,
min_nic_count=8,
network_interface=features.Sriov(),
network_interface=schema.NetworkInterfaceOptionSettings(
data_path=schema.NetworkDataPath.Sriov,
nic_count=search_space.IntRange(min=2, choose_max_value=True),
),
),
)
def verify_sriov_reload_modules(self, environment: Environment) -> None:
Expand Down Expand Up @@ -528,7 +537,7 @@ def verify_sriov_reload_modules(self, environment: Environment) -> None:
requirement=simple_requirement(
min_count=2,
network_interface=schema.NetworkInterfaceOptionSettings(
nic_count=search_space.IntRange(min=3, max=8),
nic_count=search_space.IntRange(min=3),
data_path=schema.NetworkDataPath.Sriov,
),
# BSD is unsupported since this is testing to patches to the linux kernel
Expand Down
37 changes: 22 additions & 15 deletions lisa/microsoft/testsuites/network/stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
)
from lisa.features import StartStop
from lisa.nic import NicInfo
from lisa.search_space import IntRange
from lisa.sut_orchestrator import AZURE
from lisa.tools import Cat, Iperf3

Expand Down Expand Up @@ -137,7 +138,7 @@ def stress_sriov_disable_enable(self, environment: Environment) -> None:

@TestCaseMetadata(
description="""
This case verify VM works well when provison with max (8) synthetic nics.
This case verify VM works well when provison with max synthetic nics.

Steps,
1. Provision VM with max network interfaces with synthetic network.
Expand All @@ -148,8 +149,8 @@ def stress_sriov_disable_enable(self, environment: Environment) -> None:
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=schema.NetworkInterfaceOptionSettings(
nic_count=IntRange(min=2, choose_max_value=True),
data_path=schema.NetworkDataPath.Synthetic,
),
),
Expand All @@ -165,7 +166,7 @@ def stress_synthetic_provision_with_max_nics_reboot(

@TestCaseMetadata(
description="""
This case verify VM works well when provison with max (8) synthetic nics.
This case verify VM works well when provison with max synthetic nics.

Steps,
1. Provision VM with max network interfaces with synthetic network.
Expand All @@ -176,8 +177,8 @@ def stress_synthetic_provision_with_max_nics_reboot(
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=schema.NetworkInterfaceOptionSettings(
nic_count=IntRange(min=2, choose_max_value=True),
data_path=schema.NetworkDataPath.Synthetic,
),
),
Expand All @@ -194,7 +195,7 @@ def stress_synthetic_with_max_nics_reboot_from_platform(

@TestCaseMetadata(
description="""
This case verify VM works well when provison with max (8) synthetic nics.
This case verify VM works well when provison with max synthetic nics.

Steps,
1. Provision VM with max network interfaces with synthetic network.
Expand All @@ -205,8 +206,8 @@ def stress_synthetic_with_max_nics_reboot_from_platform(
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=schema.NetworkInterfaceOptionSettings(
nic_count=IntRange(min=2, choose_max_value=True),
data_path=schema.NetworkDataPath.Synthetic,
),
),
Expand All @@ -224,7 +225,7 @@ def stress_synthetic_with_max_nics_stop_start_from_platform(

@TestCaseMetadata(
description="""
This case verify VM works well when provisioning with max (8) sriov nics.
This case verify VM works well when provisioning with max sriov nics.

Steps,
1. Provision VM with max network interfaces with enabling accelerated network.
Expand All @@ -235,8 +236,10 @@ def stress_synthetic_with_max_nics_stop_start_from_platform(
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=features.Sriov(),
network_interface=schema.NetworkInterfaceOptionSettings(
nic_count=IntRange(min=2, choose_max_value=True),
data_path=schema.NetworkDataPath.Sriov,
),
),
)
def stress_sriov_with_max_nics_reboot(self, environment: Environment) -> None:
Expand All @@ -250,7 +253,7 @@ def stress_sriov_with_max_nics_reboot(self, environment: Environment) -> None:

@TestCaseMetadata(
description="""
This case verify VM works well when provisioning with max (8) sriov nics.
This case verify VM works well when provisioning with max sriov nics.

Steps,
1. Provision VM with max network interfaces with enabling accelerated network.
Expand All @@ -261,8 +264,10 @@ def stress_sriov_with_max_nics_reboot(self, environment: Environment) -> None:
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=features.Sriov(),
network_interface=schema.NetworkInterfaceOptionSettings(
nic_count=IntRange(min=2, choose_max_value=True),
data_path=schema.NetworkDataPath.Sriov,
),
),
)
def stress_sriov_with_max_nics_reboot_from_platform(
Expand All @@ -279,7 +284,7 @@ def stress_sriov_with_max_nics_reboot_from_platform(

@TestCaseMetadata(
description="""
This case verify VM works well when provisioning with max (8) sriov nics.
This case verify VM works well when provisioning with max sriov nics.

Steps,
1. Provision VM with max network interfaces with enabling accelerated network.
Expand All @@ -290,8 +295,10 @@ def stress_sriov_with_max_nics_reboot_from_platform(
""",
priority=2,
requirement=simple_requirement(
min_nic_count=8,
network_interface=features.Sriov(),
network_interface=schema.NetworkInterfaceOptionSettings(
nic_count=IntRange(min=2, choose_max_value=True),
data_path=schema.NetworkDataPath.Sriov,
)
),
)
def stress_sriov_with_max_nics_stop_start_from_platform(
Expand Down
Loading
Loading