Skip tests for unimplemented distros

Skip Cloud Hypervisor, libvirt, KVM tests for distributions other than
Ubuntu and CBLMariner. Lots of failures in other distros leading to
exceedingly high failure rate. Other distros can be enabled after fixing
these issues. Just to clarify: it is the implementation of these test
cases in LISA that doesn't currently support other distros. It is not
a limitation of the tests themselves.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
This commit is contained in:
Anirudh Rayabharam 2022-08-17 05:11:41 +00:00 коммит произвёл Chi Song
Родитель 54a4793ce4
Коммит ab4cc3e830
3 изменённых файлов: 23 добавлений и 5 удалений

Просмотреть файл

@ -14,6 +14,7 @@ from lisa import (
schema,
search_space,
)
from lisa.operating_system import CBLMariner, Ubuntu
from lisa.testsuite import TestResult
from lisa.tools import Lscpu, Modprobe
from lisa.util import SkippedException
@ -39,6 +40,10 @@ class CloudHypervisorTestSuite(TestSuite):
def before_case(self, log: Logger, **kwargs: Any) -> None:
node = kwargs["node"]
if not isinstance(node.os, (CBLMariner, Ubuntu)):
raise SkippedException(
f"Cloud Hypervisor tests are not implemented in LISA for {node.os.name}"
)
self._ensure_virtualization_enabled(node)
@TestCaseMetadata(

Просмотреть файл

@ -10,6 +10,7 @@ from lisa import (
TestSuite,
TestSuiteMetadata,
)
from lisa.operating_system import CBLMariner, Ubuntu
from lisa.testsuite import TestResult
from lisa.tools import Lscpu
from lisa.util import SkippedException
@ -43,5 +44,9 @@ class KvmUnitTestSuite(TestSuite):
virtualization_enabled = node.tools[Lscpu].is_virtualization_enabled()
if not virtualization_enabled:
raise SkippedException("Virtualization is not enabled in hardware")
if not isinstance(node.os, (CBLMariner, Ubuntu)):
raise SkippedException(
f"KVM unit tests are not implemented in LISA for {node.os.name}"
)
node.tools[KvmUnitTests].run_tests(result, environment, log_path)

Просмотреть файл

@ -1,6 +1,7 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from pathlib import Path
from typing import Any
from lisa import (
Environment,
@ -10,6 +11,7 @@ from lisa import (
TestSuite,
TestSuiteMetadata,
)
from lisa.operating_system import Ubuntu
from lisa.testsuite import TestResult
from lisa.tools import Lscpu
from lisa.util import SkippedException
@ -28,6 +30,17 @@ from microsoft.testsuites.libvirt.libvirt_tck_tool import LibvirtTck
""",
)
class LibvirtTckSuite(TestSuite):
def before_case(self, log: Logger, **kwargs: Any) -> None:
node = kwargs["node"]
if not isinstance(node.os, Ubuntu):
raise SkippedException(
f"Libvirt TCK suite is not implemented in LISA for {node.os.name}"
)
# ensure virtualization is enabled in hardware before running tests
virtualization_enabled = node.tools[Lscpu].is_virtualization_enabled()
if not virtualization_enabled:
raise SkippedException("Virtualization is not enabled in hardware")
@TestCaseMetadata(
description="""
Runs the Libvirt TCK (Technology Compatibility Kit) tests with the default
@ -43,9 +56,4 @@ class LibvirtTckSuite(TestSuite):
log_path: Path,
result: TestResult,
) -> None:
# ensure virtualization is enabled in hardware before running tests
virtualization_enabled = node.tools[Lscpu].is_virtualization_enabled()
if not virtualization_enabled:
raise SkippedException("Virtualization is not enabled in hardware")
node.tools[LibvirtTck].run_tests(result, environment, log_path)