Skip to content

Commit

Permalink
mshv: fix before_case in mshvlog_is_active test
Browse files Browse the repository at this point in the history
This test checks if CONFIG_MSHV_DIAG is enabled. If enabled, the test
requires /dev/mshv_diag device to be present.

Signed-off-by: Praveen K Paladugu <[email protected]>
  • Loading branch information
praveen-pk committed Sep 18, 2024
1 parent ea0f2f1 commit c29c2c9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions microsoft/testsuites/mshv/mshv_root_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
TestSuiteMetadata,
)
from lisa.testsuite import TestResult
from lisa.tools import Dmesg, Ls, Service
from lisa.util import SkippedException

from lisa.tools import Dmesg, Ls, Service, KernelConfig
from lisa.util import SkippedException, LisaException

@TestSuiteMetadata(
area="mshv",
Expand All @@ -33,12 +32,12 @@ class MshvHostTestSuite(TestSuite):

def before_case(self, log: Logger, **kwargs: Any) -> None:
node = kwargs["node"]
if not node.tools[Ls].path_exists("/dev/mshv", sudo=True):
raise SkippedException("This suite is for MSHV root partition only")
if not node.tools[KernelConfig].is_enabled("CONFIG_MSHV_DIAG"):
raise SkippedException("MSHV_DIAG not enabled, skip")

if not node.tools[Ls].path_exists("/dev/mshv_diag", sudo=True):
raise SkippedException(
"mshv_diag module should be loaded on MSHV root parition."
raise LisaException(
"mshv_diag device should exist, when CONFIG_MSHV_DIAG is enabled."
)

@TestCaseMetadata(
Expand Down

0 comments on commit c29c2c9

Please sign in to comment.