Skip to content

Commit

Permalink
Hibernation Testcase: Add NoRedundancy Feature Requirement
Browse files Browse the repository at this point in the history
Hibernation test cases requires VM Redundancy type to be
NoRedundancy. Add that to test requirement
  • Loading branch information
adityagesh committed Nov 15, 2024
1 parent 2962dc5 commit ce315cf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions lisa/features/availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,8 @@ def enabled(self) -> bool:
AvailabilitySettings,
availability_type=search_space.SetSpace(True, [AvailabilityType.AvailabilityZone]),
)

AvailabilityTypeNoRedundancy = partial(
AvailabilitySettings,
availability_type=search_space.SetSpace(True, [AvailabilityType.NoRedundancy]),
)
19 changes: 10 additions & 9 deletions microsoft/testsuites/power/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
TestSuiteMetadata,
)
from lisa.features import Disk, HibernationEnabled, Sriov, Synthetic
from lisa.features.availability import AvailabilityTypeNoRedundancy
from lisa.node import Node
from lisa.operating_system import BSD, Windows
from lisa.testsuite import simple_requirement
Expand Down Expand Up @@ -61,7 +62,7 @@ def before_case(self, log: Logger, **kwargs: Any) -> None:
priority=3,
requirement=simple_requirement(
network_interface=Synthetic(),
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
),
)
def verify_hibernation_synthetic_network(self, node: Node, log: Logger) -> None:
Expand All @@ -76,7 +77,7 @@ def verify_hibernation_synthetic_network(self, node: Node, log: Logger) -> None:
priority=3,
requirement=simple_requirement(
network_interface=Sriov(),
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
),
)
def verify_hibernation_sriov_network(self, node: Node, log: Logger) -> None:
Expand All @@ -94,7 +95,7 @@ def verify_hibernation_sriov_network(self, node: Node, log: Logger) -> None:
""",
priority=3,
requirement=simple_requirement(
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
),
)
def verify_hibernation_time_sync(self, node: Node, log: Logger) -> None:
Expand Down Expand Up @@ -136,7 +137,7 @@ def verify_hibernation_time_sync(self, node: Node, log: Logger) -> None:
priority=3,
requirement=simple_requirement(
min_count=2,
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
),
)
def verify_hibernation_with_network_workload(
Expand All @@ -159,7 +160,7 @@ def verify_hibernation_with_network_workload(
""",
priority=3,
requirement=simple_requirement(
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
),
)
def verify_hibernation_with_storage_workload(self, node: Node, log: Logger) -> None:
Expand All @@ -179,7 +180,7 @@ def verify_hibernation_with_storage_workload(self, node: Node, log: Logger) -> N
""",
priority=3,
requirement=simple_requirement(
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
),
)
def verify_hibernation_with_memory_workload(self, node: Node, log: Logger) -> None:
Expand Down Expand Up @@ -207,7 +208,7 @@ def verify_hibernation_with_memory_workload(self, node: Node, log: Logger) -> No
requirement=simple_requirement(
min_nic_count=8,
network_interface=Synthetic(),
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
),
)
def verify_hibernation_synthetic_network_max_nics(
Expand All @@ -225,7 +226,7 @@ def verify_hibernation_synthetic_network_max_nics(
requirement=simple_requirement(
min_nic_count=8,
network_interface=Sriov(),
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
),
)
def verify_hibernation_sriov_network_max_nics(
Expand All @@ -242,7 +243,7 @@ def verify_hibernation_sriov_network_max_nics(
priority=3,
requirement=simple_requirement(
min_nic_count=8,
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
min_data_disk_count=32,
),
)
Expand Down
3 changes: 2 additions & 1 deletion microsoft/testsuites/power/stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
TestSuiteMetadata,
)
from lisa.features import HibernationEnabled, Sriov
from lisa.features.availability import AvailabilityTypeNoRedundancy
from lisa.node import Node
from lisa.operating_system import BSD, Windows
from lisa.testsuite import simple_requirement
Expand Down Expand Up @@ -46,7 +47,7 @@ def before_case(self, log: Logger, **kwargs: Any) -> None:
timeout=720000,
requirement=simple_requirement(
network_interface=Sriov(),
supported_features=[HibernationEnabled()],
supported_features=[HibernationEnabled(), AvailabilityTypeNoRedundancy()],
),
)
def stress_hibernation(self, environment: Environment, log: Logger) -> None:
Expand Down

0 comments on commit ce315cf

Please sign in to comment.