From 8a8a79f81d656955815d5f283b4486216f6b8b7c Mon Sep 17 00:00:00 2001 From: Igor Ponomarev Date: Tue, 21 Nov 2023 16:24:48 +0600 Subject: [PATCH] tests: Rename StdoutTestCase to LavaDispatcherTestCase That TestCase class has nothing to do with the Stdout. Instead it is used in most lava_dispatcher tests. --- doc/v2/development.rst | 4 +-- .../lava_dispatcher/pipeline_refs/readme.txt | 2 +- tests/lava_dispatcher/test_auto_login.py | 4 +-- tests/lava_dispatcher/test_avh.py | 4 +-- tests/lava_dispatcher/test_barebox.py | 6 ++-- tests/lava_dispatcher/test_basic.py | 14 ++++----- tests/lava_dispatcher/test_bootloader.py | 4 +-- tests/lava_dispatcher/test_cmsis.py | 4 +-- tests/lava_dispatcher/test_command.py | 4 +-- tests/lava_dispatcher/test_compression.py | 6 ++-- tests/lava_dispatcher/test_connections.py | 10 +++---- tests/lava_dispatcher/test_defs.py | 12 ++++---- tests/lava_dispatcher/test_depthcharge.py | 4 +-- tests/lava_dispatcher/test_devices.py | 10 +++---- tests/lava_dispatcher/test_docker.py | 8 ++--- tests/lava_dispatcher/test_download.py | 4 +-- tests/lava_dispatcher/test_fastboot.py | 4 +-- tests/lava_dispatcher/test_flasher.py | 4 +-- tests/lava_dispatcher/test_fvp.py | 4 +-- tests/lava_dispatcher/test_gdb.py | 4 +-- tests/lava_dispatcher/test_grub.py | 4 +-- tests/lava_dispatcher/test_interactive.py | 8 ++--- tests/lava_dispatcher/test_ipxe.py | 4 +-- tests/lava_dispatcher/test_iso.py | 4 +-- tests/lava_dispatcher/test_jlink.py | 4 +-- tests/lava_dispatcher/test_kexec.py | 4 +-- tests/lava_dispatcher/test_kvm.py | 30 +++++++++---------- tests/lava_dispatcher/test_lavashell.py | 8 ++--- tests/lava_dispatcher/test_lxc.py | 6 ++-- tests/lava_dispatcher/test_menus.py | 6 ++-- tests/lava_dispatcher/test_messages.py | 4 +-- tests/lava_dispatcher/test_monitor.py | 4 +-- tests/lava_dispatcher/test_mps.py | 4 +-- tests/lava_dispatcher/test_multi.py | 8 ++--- tests/lava_dispatcher/test_multinode.py | 8 ++--- tests/lava_dispatcher/test_musca.py | 4 +-- tests/lava_dispatcher/test_n1sdp.py | 4 +-- tests/lava_dispatcher/test_openocd.py | 4 +-- tests/lava_dispatcher/test_power.py | 4 +-- tests/lava_dispatcher/test_pyocd.py | 4 +-- tests/lava_dispatcher/test_recovery.py | 4 +-- tests/lava_dispatcher/test_removable.py | 4 +-- tests/lava_dispatcher/test_retries.py | 6 ++-- tests/lava_dispatcher/test_test_shell.py | 6 ++-- tests/lava_dispatcher/test_uboot.py | 8 ++--- tests/lava_dispatcher/test_uboot_dfu.py | 4 +-- tests/lava_dispatcher/test_uboot_ums.py | 4 +-- tests/lava_dispatcher/test_uefi_shell.py | 4 +-- tests/lava_dispatcher/test_user_commands.py | 4 +-- tests/lava_dispatcher/test_uuu.py | 8 +++-- tests/lava_dispatcher/test_vland.py | 4 +-- 51 files changed, 150 insertions(+), 148 deletions(-) diff --git a/doc/v2/development.rst b/doc/v2/development.rst index cfae8f41ee..a26cce7c36 100644 --- a/doc/v2/development.rst +++ b/doc/v2/development.rst @@ -577,10 +577,10 @@ test. .. code-block:: python import unittest - from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase + from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.lava_dispatcher.utils import infrastructure_error_multi_paths - class TestFastbootDeploy(StdoutTestCase): # pylint: disable=too-many-public-methods + class TestFastbootDeploy(LavaDispatcherTestCase): # pylint: disable=too-many-public-methods def setUp(self): super().setUp() diff --git a/tests/lava_dispatcher/pipeline_refs/readme.txt b/tests/lava_dispatcher/pipeline_refs/readme.txt index 2b0860c7a5..91b492027e 100644 --- a/tests/lava_dispatcher/pipeline_refs/readme.txt +++ b/tests/lava_dispatcher/pipeline_refs/readme.txt @@ -25,7 +25,7 @@ or just The name of the pipeline_ref file should match the name of the equivalent file in sample_jobs. To change multiple pipeline references at the same time, change -self.update_ref to True in test_basic.StdoutTestCase - always check all changes to +self.update_ref to True in test_basic.LavaDispatcherTestCase - always check all changes to the pipeline reference files *carefully* before sending for review. Once you have a new unit test function with the pipeline_reference check in place, diff --git a/tests/lava_dispatcher/test_auto_login.py b/tests/lava_dispatcher/test_auto_login.py index fbba9a0f06..ab76cf6225 100644 --- a/tests/lava_dispatcher/test_auto_login.py +++ b/tests/lava_dispatcher/test_auto_login.py @@ -8,10 +8,10 @@ from lava_dispatcher.action import Pipeline from lava_dispatcher.actions.boot import AutoLoginAction from lava_dispatcher.job import Job -from tests.lava_dispatcher.test_basic import StdoutTestCase +from tests.lava_dispatcher.test_basic import LavaDispatcherTestCase -class AutoLoginTestCase(StdoutTestCase): +class AutoLoginTestCase(LavaDispatcherTestCase): def _make_pipeline(self, params): job = Job(1234, {}, None) job.device = {"actions": {"boot": {"methods": []}}} diff --git a/tests/lava_dispatcher/test_avh.py b/tests/lava_dispatcher/test_avh.py index 158a6698ef..2e124d92e3 100644 --- a/tests/lava_dispatcher/test_avh.py +++ b/tests/lava_dispatcher/test_avh.py @@ -7,7 +7,7 @@ from unittest.mock import ANY, call, patch from lava_common.exceptions import JobError -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase try: from avh_api.model.image import Image @@ -72,7 +72,7 @@ def test_accepts_boot(): ) -class TestAvhActions(StdoutTestCase): +class TestAvhActions(LavaDispatcherTestCase): def setUp(self, job="sample_jobs/avh-rpi4b.yaml"): super().setUp() self.factory = Factory() diff --git a/tests/lava_dispatcher/test_barebox.py b/tests/lava_dispatcher/test_barebox.py index c6e0efd41c..1976844ed3 100644 --- a/tests/lava_dispatcher/test_barebox.py +++ b/tests/lava_dispatcher/test_barebox.py @@ -15,7 +15,7 @@ from lava_dispatcher.device import NewDevice from lava_dispatcher.parser import JobParser from lava_dispatcher.utils import filesystem -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class BareboxFactory(Factory): @@ -29,7 +29,7 @@ def create_bbb_job(self, filename): return self.create_job("bbb-03-barebox.jinja2", filename) -class TestBareboxAction(StdoutTestCase): +class TestBareboxAction(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = BareboxFactory() @@ -178,7 +178,7 @@ def test_download_action(self, which_mock): self.assertEqual(extract.timeout.duration, 240) -class TestKernelConversion(StdoutTestCase): +class TestKernelConversion(LavaDispatcherTestCase): def setUp(self): self.device = NewDevice( os.path.join(os.path.dirname(__file__), "devices/bbb-01-barebox.yaml") diff --git a/tests/lava_dispatcher/test_basic.py b/tests/lava_dispatcher/test_basic.py index 06a465ba6d..1fa015c4d3 100644 --- a/tests/lava_dispatcher/test_basic.py +++ b/tests/lava_dispatcher/test_basic.py @@ -30,7 +30,7 @@ from tests.utils import DummyLogger -class StdoutTestCase(unittest.TestCase): +class LavaDispatcherTestCase(unittest.TestCase): # set to True to update pipeline_references automatically. update_ref = False @@ -47,7 +47,7 @@ def pipeline_reference(cls, filename, job=None): return yaml_safe_load(f_ref) -class TestAction(StdoutTestCase): +class TestAction(LavaDispatcherTestCase): def test_references_a_device(self): device = object() cmd = Action() @@ -55,7 +55,7 @@ def test_references_a_device(self): self.assertIs(cmd.device, device) -class TestPipelineInit(StdoutTestCase): +class TestPipelineInit(LavaDispatcherTestCase): class FakeAction(Action): def __init__(self): self.ran = False @@ -109,7 +109,7 @@ def test_parsed_commands(self): ) -class TestValidation(StdoutTestCase): +class TestValidation(LavaDispatcherTestCase): def test_action_is_valid_if_there_are_not_errors(self): action = Action() action.__errors__ = [1] @@ -263,7 +263,7 @@ def create_kvm_job(self, filename, validate=False): return job -class TestPipeline(StdoutTestCase): +class TestPipeline(LavaDispatcherTestCase): class FakeAction(Action): name = "fake-action" @@ -468,7 +468,7 @@ def test_namespace_data(self): ) -class TestFakeActions(StdoutTestCase): +class TestFakeActions(LavaDispatcherTestCase): class KeepConnection(Action): name = "keep-connection" @@ -520,7 +520,7 @@ def test_change_connection(self): self.assertIsNot(conn, pipe.run_actions(conn, None)) -class TestStrategySelector(StdoutTestCase): +class TestStrategySelector(LavaDispatcherTestCase): """ Check the lambda operation """ diff --git a/tests/lava_dispatcher/test_bootloader.py b/tests/lava_dispatcher/test_bootloader.py index 3bda03e5d0..a92ba30e4b 100644 --- a/tests/lava_dispatcher/test_bootloader.py +++ b/tests/lava_dispatcher/test_bootloader.py @@ -5,7 +5,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later from lava_common.exceptions import InfrastructureError -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class BootloaderFactory(Factory): @@ -13,7 +13,7 @@ def create_bootloader_job(self, filename): return self.create_job("b2260-01.jinja2", filename) -class TestBootBootloader(StdoutTestCase): +class TestBootBootloader(LavaDispatcherTestCase): def test_pipeline(self): factory = BootloaderFactory() job = factory.create_bootloader_job("sample_jobs/b2260-bootloader.yaml") diff --git a/tests/lava_dispatcher/test_cmsis.py b/tests/lava_dispatcher/test_cmsis.py index 70c8f3b70e..165a26da65 100644 --- a/tests/lava_dispatcher/test_cmsis.py +++ b/tests/lava_dispatcher/test_cmsis.py @@ -6,7 +6,7 @@ from lava_common.exceptions import JobError -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class Cmsis_Factory(Factory): @@ -23,7 +23,7 @@ def create_k64f_job_with_power(self, filename): return self.create_job("frdm-k64f-power-01.jinja2", filename) -class TestCMSISAction(StdoutTestCase): +class TestCMSISAction(LavaDispatcherTestCase): def test_usb_mass_exists(self): factory = Cmsis_Factory() job = factory.create_k64f_job( diff --git a/tests/lava_dispatcher/test_command.py b/tests/lava_dispatcher/test_command.py index f2da3edc99..38fc8388c2 100644 --- a/tests/lava_dispatcher/test_command.py +++ b/tests/lava_dispatcher/test_command.py @@ -4,10 +4,10 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase -class TestCommand(StdoutTestCase): +class TestCommand(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() diff --git a/tests/lava_dispatcher/test_compression.py b/tests/lava_dispatcher/test_compression.py index 92af29f49b..7234433044 100644 --- a/tests/lava_dispatcher/test_compression.py +++ b/tests/lava_dispatcher/test_compression.py @@ -15,7 +15,7 @@ from lava_common.exceptions import InfrastructureError, JobError from lava_dispatcher.utils.compression import decompress_command_map, decompress_file -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase def setup_responses() -> RequestsMock: @@ -43,7 +43,7 @@ def setup_responses() -> RequestsMock: return requests_mock -class TestDecompression(StdoutTestCase): +class TestDecompression(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() @@ -174,7 +174,7 @@ def test_bad_download_decompression(self): test_multiple_bad_checksums.run(None, None) -class TestDownloadDecompressionMap(StdoutTestCase): +class TestDownloadDecompressionMap(LavaDispatcherTestCase): def test_download_decompression_map(self): """ Previously had an issue with decompress_command_map being modified. diff --git a/tests/lava_dispatcher/test_connections.py b/tests/lava_dispatcher/test_connections.py index 501f185c18..ae4bbdab06 100644 --- a/tests/lava_dispatcher/test_connections.py +++ b/tests/lava_dispatcher/test_connections.py @@ -16,7 +16,7 @@ from lava_dispatcher.actions.boot.ssh import SchrootAction from lava_dispatcher.protocols.multinode import MultinodeProtocol from lava_dispatcher.utils.filesystem import check_ssh_identity_file -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import infrastructure_error @@ -34,7 +34,7 @@ def create_bbb_job(self, filename): return self.create_job("bbb-02.jinja2", filename, validate=False) -class TestConnection(StdoutTestCase): +class TestConnection(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = ConnectionFactory() @@ -438,7 +438,7 @@ def test_guest_ssh(self): self.assertEqual(description_ref, self.guest_job.pipeline.describe()) -class TestConsoleConnections(StdoutTestCase): +class TestConsoleConnections(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = ConnectionFactory() @@ -500,7 +500,7 @@ def test_connection_tags(self, which_mock): self.assertEqual(["primary", "telnet"], connect.tag_dict[connect.hardware]) -class TestTimeouts(StdoutTestCase): +class TestTimeouts(LavaDispatcherTestCase): """ Test action and connection timeout parsing. """ @@ -639,7 +639,7 @@ def test_action_connection_timeout(self): self.assertEqual(retry.connection_timeout.duration, 45) -class TestDisconnect(StdoutTestCase): +class TestDisconnect(LavaDispatcherTestCase): """ Test disconnect action """ diff --git a/tests/lava_dispatcher/test_defs.py b/tests/lava_dispatcher/test_defs.py index f0ae15de0c..6e76974084 100644 --- a/tests/lava_dispatcher/test_defs.py +++ b/tests/lava_dispatcher/test_defs.py @@ -32,7 +32,7 @@ from lava_dispatcher.actions.test.shell import PatternFixup from lava_dispatcher.parser import JobParser from lava_dispatcher.power import FinalizeAction -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.lava_dispatcher.test_uboot import UBootFactory from tests.utils import infrastructure_error, infrastructure_error_multi_paths @@ -53,7 +53,7 @@ def check_missing_path(testcase, exception, path): testcase.fail(exception) -class TestDefinitionHandlers(StdoutTestCase): +class TestDefinitionHandlers(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() @@ -246,7 +246,7 @@ def test_overlay_override(self): ) -class TestDefinitionSimple(StdoutTestCase): +class TestDefinitionSimple(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -273,7 +273,7 @@ def test_job_without_tests(self): ) # deploy without test only needs DownloaderAction -class TestDefinitionParams(StdoutTestCase): +class TestDefinitionParams(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() @@ -394,7 +394,7 @@ def test_install_repos(self, GitHelper): shutil.rmtree(runner_path) -class TestSkipInstall(StdoutTestCase): +class TestSkipInstall(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = UBootFactory() @@ -468,7 +468,7 @@ def check_rpcinfo(server="127.0.0.1"): return False -class TestDefinitions(StdoutTestCase): +class TestDefinitions(LavaDispatcherTestCase): """ For compatibility until the V1 code is removed and we can start cleaning up Lava Test Shell. diff --git a/tests/lava_dispatcher/test_depthcharge.py b/tests/lava_dispatcher/test_depthcharge.py index efe408f011..e57dc5803f 100644 --- a/tests/lava_dispatcher/test_depthcharge.py +++ b/tests/lava_dispatcher/test_depthcharge.py @@ -9,7 +9,7 @@ import unittest from unittest.mock import patch -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger, infrastructure_error @@ -26,7 +26,7 @@ def create_jaq_job(self, filename): return job -class TestDepthchargeAction(StdoutTestCase): +class TestDepthchargeAction(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = DepthchargeFactory() diff --git a/tests/lava_dispatcher/test_devices.py b/tests/lava_dispatcher/test_devices.py index e923e2e7bc..b946de82ef 100644 --- a/tests/lava_dispatcher/test_devices.py +++ b/tests/lava_dispatcher/test_devices.py @@ -14,13 +14,13 @@ from lava_dispatcher.actions.boot.u_boot import BootloaderInterruptAction, UBootAction from lava_dispatcher.device import NewDevice from lava_dispatcher.parser import JobParser -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger, infrastructure_error # Test the loading of test definitions within the deploy stage -class TestDeviceParser(StdoutTestCase): +class TestDeviceParser(LavaDispatcherTestCase): def test_new_device(self): factory = Factory() (rendered, _) = factory.create_device("kvm01.jinja2") @@ -47,7 +47,7 @@ class FakeAction(Action): summary = "fake action" -class TestJobDeviceParameters(StdoutTestCase): +class TestJobDeviceParameters(LavaDispatcherTestCase): """ Test parsing of device configuration into job parameters """ @@ -137,7 +137,7 @@ def test_device_constants(self): ) -class TestDeviceEnvironment(StdoutTestCase): +class TestDeviceEnvironment(LavaDispatcherTestCase): """ Test parsing of device environment support """ @@ -232,7 +232,7 @@ def test_device_environment(self, which_mock): self.assertTrue(found) -class TestCommand(StdoutTestCase): +class TestCommand(LavaDispatcherTestCase): def test_silent(self): fake = FakeAction() command = "true" diff --git a/tests/lava_dispatcher/test_docker.py b/tests/lava_dispatcher/test_docker.py index 40607c874d..22d8d659eb 100644 --- a/tests/lava_dispatcher/test_docker.py +++ b/tests/lava_dispatcher/test_docker.py @@ -7,7 +7,7 @@ from pathlib import Path from unittest.mock import MagicMock, patch -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class DockerFactory(Factory): @@ -23,7 +23,7 @@ def create_docker_job(self, filename, dispatcher_config=None): ) -class TestDocker(StdoutTestCase): +class TestDocker(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = DockerFactory() @@ -103,7 +103,7 @@ def test_boot(self, shell_command, *args): ) -class TestDockerDispatcherPrefix(StdoutTestCase): +class TestDockerDispatcherPrefix(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = DockerFactory() @@ -158,7 +158,7 @@ def create_docker_db410c_job(self, filename): return self.create_job("db410c-01.jinja2", filename) -class TestDockerDb410c(StdoutTestCase): +class TestDockerDb410c(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = DockerDb410cFactory() diff --git a/tests/lava_dispatcher/test_download.py b/tests/lava_dispatcher/test_download.py index 08c7ad8d0d..90873f46e3 100644 --- a/tests/lava_dispatcher/test_download.py +++ b/tests/lava_dispatcher/test_download.py @@ -7,11 +7,11 @@ import unittest from lava_common.exceptions import JobError -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import infrastructure_error_multi_paths -class TestDownloadDeploy(StdoutTestCase): +class TestDownloadDeploy(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() diff --git a/tests/lava_dispatcher/test_fastboot.py b/tests/lava_dispatcher/test_fastboot.py index ae50c9d7bf..24c9f91639 100644 --- a/tests/lava_dispatcher/test_fastboot.py +++ b/tests/lava_dispatcher/test_fastboot.py @@ -16,7 +16,7 @@ from lava_dispatcher.utils.containers import DockerDriver, LxcDriver, NullDriver from lava_dispatcher.utils.fastboot import OptionalContainerFastbootAction from lava_dispatcher.utils.lxc import is_lxc_requested, lxc_cmd_prefix -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import infrastructure_error, infrastructure_error_multi_paths @@ -252,7 +252,7 @@ def test_run_fastboot( assert run_cmd.mock_calls[3].args[0][0:2] == ["docker", "stop"] -class TestFastbootDeploy(StdoutTestCase): +class TestFastbootDeploy(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = FastBootFactory() diff --git a/tests/lava_dispatcher/test_flasher.py b/tests/lava_dispatcher/test_flasher.py index 4abf0530cc..43d4be5c1b 100644 --- a/tests/lava_dispatcher/test_flasher.py +++ b/tests/lava_dispatcher/test_flasher.py @@ -16,7 +16,7 @@ from lava_dispatcher.actions.deploy.flasher import Flasher, FlasherAction from lava_dispatcher.device import PipelineDevice from lava_dispatcher.job import Job -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger @@ -27,7 +27,7 @@ def create_b2260_job(self, filename): return job -class TestFlasher(StdoutTestCase): +class TestFlasher(LavaDispatcherTestCase): def test_pipeline(self): factory = FlasherFactory() job = factory.create_b2260_job("sample_jobs/b2260-flasher.yaml") diff --git a/tests/lava_dispatcher/test_fvp.py b/tests/lava_dispatcher/test_fvp.py index 2aab09faff..e67a653bea 100644 --- a/tests/lava_dispatcher/test_fvp.py +++ b/tests/lava_dispatcher/test_fvp.py @@ -4,10 +4,10 @@ # # SPDX-License-Identifier: GPL-2.0-or-later from lava_dispatcher.action import Action -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase -class TestFVPActions(StdoutTestCase): +class TestFVPActions(LavaDispatcherTestCase): def setUp(self, job="sample_jobs/fvp_foundation.yaml"): super().setUp() self.factory = Factory() diff --git a/tests/lava_dispatcher/test_gdb.py b/tests/lava_dispatcher/test_gdb.py index 65b19bb421..1c88266641 100644 --- a/tests/lava_dispatcher/test_gdb.py +++ b/tests/lava_dispatcher/test_gdb.py @@ -8,7 +8,7 @@ from lava_common.exceptions import InfrastructureError, JobError from lava_dispatcher.utils.shell import which -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase def check_docker(): @@ -35,7 +35,7 @@ def create_cc3230SF_docker_job(self, filename): return self.create_job("cc3220SF-docker-01.jinja2", filename) -class TestGDB(StdoutTestCase): +class TestGDB(LavaDispatcherTestCase): @unittest.skipIf(check_docker(), "docker not available") @unittest.skipIf(check_gdb_multipart(), "gdb-multiarch not available") def test_validate_errors(self): diff --git a/tests/lava_dispatcher/test_grub.py b/tests/lava_dispatcher/test_grub.py index 2f827bc0b5..4309f1e589 100644 --- a/tests/lava_dispatcher/test_grub.py +++ b/tests/lava_dispatcher/test_grub.py @@ -22,7 +22,7 @@ from lava_dispatcher.utils import filesystem from lava_dispatcher.utils.network import dispatcher_ip from lava_dispatcher.utils.strings import substitute -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import infrastructure_error, infrastructure_error_multi_paths @@ -43,7 +43,7 @@ def create_hikey960_job(self, filename): return self.create_job("hi960-hikey-01.jinja2", filename) -class TestGrubAction(StdoutTestCase): +class TestGrubAction(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = GrubFactory() diff --git a/tests/lava_dispatcher/test_interactive.py b/tests/lava_dispatcher/test_interactive.py index 939078ba84..356d43e264 100644 --- a/tests/lava_dispatcher/test_interactive.py +++ b/tests/lava_dispatcher/test_interactive.py @@ -19,7 +19,7 @@ TestError, ) from lava_dispatcher.actions.test.interactive import TestInteractiveAction -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class InteractiveFactory(Factory): @@ -33,7 +33,7 @@ def test_pipeline(): "b2260-01.jinja2", "sample_jobs/b2260-interactive.yaml" ) job.validate() - description_ref = StdoutTestCase.pipeline_reference( + description_ref = LavaDispatcherTestCase.pipeline_reference( "b2260-interactive.yaml", job=job ) assert description_ref == job.pipeline.describe() # nosec @@ -45,7 +45,7 @@ def test_bbb(): "bbb-01.jinja2", "sample_jobs/bbb-uboot-interactive.yaml" ) job.validate() - description_ref = StdoutTestCase.pipeline_reference( + description_ref = LavaDispatcherTestCase.pipeline_reference( "bbb-uboot-interactive.yaml", job=job ) assert description_ref == job.pipeline.describe() # nosec @@ -61,7 +61,7 @@ def test_stages(monkeypatch): "docker-01.jinja2", "sample_jobs/docker-interactive.yaml" ) job.validate() - description_ref = StdoutTestCase.pipeline_reference( + description_ref = LavaDispatcherTestCase.pipeline_reference( "docker-interactive.yaml", job=job ) assert description_ref == job.pipeline.describe() # nosec diff --git a/tests/lava_dispatcher/test_ipxe.py b/tests/lava_dispatcher/test_ipxe.py index 651150c793..5fd96c2b73 100644 --- a/tests/lava_dispatcher/test_ipxe.py +++ b/tests/lava_dispatcher/test_ipxe.py @@ -19,11 +19,11 @@ from lava_dispatcher.parser import JobParser from lava_dispatcher.utils.network import dispatcher_ip from lava_dispatcher.utils.strings import substitute -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger, infrastructure_error -class TestBootloaderAction(StdoutTestCase): +class TestBootloaderAction(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() diff --git a/tests/lava_dispatcher/test_iso.py b/tests/lava_dispatcher/test_iso.py index 2fa652f8f9..7c13969360 100644 --- a/tests/lava_dispatcher/test_iso.py +++ b/tests/lava_dispatcher/test_iso.py @@ -13,7 +13,7 @@ from lava_dispatcher.job import Job from lava_dispatcher.parser import JobParser from lava_dispatcher.utils.strings import substitute -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger @@ -31,7 +31,7 @@ def create_qemu_installer_job(self): return job -class TestIsoJob(StdoutTestCase): +class TestIsoJob(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = InstallerFactory() diff --git a/tests/lava_dispatcher/test_jlink.py b/tests/lava_dispatcher/test_jlink.py index f888531b97..199690ce80 100644 --- a/tests/lava_dispatcher/test_jlink.py +++ b/tests/lava_dispatcher/test_jlink.py @@ -6,7 +6,7 @@ from lava_common.exceptions import JobError -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class JLinkFactory(Factory): @@ -23,7 +23,7 @@ def create_k64f_job_with_power(self, filename): return self.create_job("frdm-k64f-power-01.jinja2", filename) -class TestJLinkAction(StdoutTestCase): +class TestJLinkAction(LavaDispatcherTestCase): def test_jlink_pipeline(self): factory = JLinkFactory() job = factory.create_k64f_job( diff --git a/tests/lava_dispatcher/test_kexec.py b/tests/lava_dispatcher/test_kexec.py index 9445b4374e..cffcc34cf5 100644 --- a/tests/lava_dispatcher/test_kexec.py +++ b/tests/lava_dispatcher/test_kexec.py @@ -11,11 +11,11 @@ from lava_dispatcher.actions.boot.kexec import BootKexecAction, KexecAction from lava_dispatcher.actions.test.shell import TestShellRetry from lava_dispatcher.shell import ExpectShellSession -from tests.lava_dispatcher.test_basic import StdoutTestCase +from tests.lava_dispatcher.test_basic import LavaDispatcherTestCase from tests.lava_dispatcher.test_uboot import UBootFactory -class TestKExec(StdoutTestCase): +class TestKExec(LavaDispatcherTestCase): @patch( "lava_dispatcher.actions.deploy.tftp.which", return_value="/usr/bin/in.tftpd" ) diff --git a/tests/lava_dispatcher/test_kvm.py b/tests/lava_dispatcher/test_kvm.py index d7d4e3f537..723a1bb297 100644 --- a/tests/lava_dispatcher/test_kvm.py +++ b/tests/lava_dispatcher/test_kvm.py @@ -20,13 +20,13 @@ from lava_dispatcher.parser import JobParser from lava_dispatcher.utils.filesystem import mkdtemp from lava_dispatcher.utils.messages import LinuxKernelMessages -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.lava_dispatcher.test_defs import allow_missing_path, check_missing_path from tests.lava_dispatcher.test_messages import FakeConnection from tests.utils import DummyLogger, infrastructure_error -class TestKVMSimulation(StdoutTestCase): +class TestKVMSimulation(LavaDispatcherTestCase): def test_kvm_simulation(self): """ Build a pipeline which simulates a KVM LAVA job @@ -118,7 +118,7 @@ def test_kvm_simulation(self): self.assertEqual(len(pipe.describe()), 4) -class TestKVMBasicDeploy(StdoutTestCase): +class TestKVMBasicDeploy(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() @@ -213,7 +213,7 @@ def test_testdefinitions(self): self.assertEqual(len(action.parameters["definitions"]), 2) -class TestKVMPortable(StdoutTestCase): +class TestKVMPortable(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -239,7 +239,7 @@ def test_validate(self): self.assertEqual([], action.errors) -class TestKVMQcow2Deploy(StdoutTestCase): +class TestKVMQcow2Deploy(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -260,7 +260,7 @@ def test_validate(self): self.assertEqual([], action.errors) -class TestKVMMultiTests(StdoutTestCase): +class TestKVMMultiTests(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -271,7 +271,7 @@ def test_pipeline(self): self.assertEqual(description_ref, self.job.pipeline.describe()) -class TestKVMDownloadLocalDeploy(StdoutTestCase): +class TestKVMDownloadLocalDeploy(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -282,7 +282,7 @@ def test_pipeline(self): self.assertEqual(description_ref, self.job.pipeline.describe()) -class TestKVMDeployOverlays(StdoutTestCase): +class TestKVMDeployOverlays(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -304,7 +304,7 @@ def prepare_test_connection(failure=False): return FakeConnection(logfile, message_list) -class TestKVMInlineTestDeploy(StdoutTestCase): +class TestKVMInlineTestDeploy(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() @@ -436,7 +436,7 @@ def test_pipeline(self): self.assertEqual(set(testdef), set(expected_testdef)) -class TestKvmConnection(StdoutTestCase): +class TestKvmConnection(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -482,7 +482,7 @@ def test_kvm_connection(self): self.assertEqual(call_qemu.session_class, QemuSession) -class TestAutoLogin(StdoutTestCase): +class TestAutoLogin(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -732,7 +732,7 @@ def test_autologin_login_incorrect(self): self.assertIn("2 retries failed for auto-login-action", autologinaction.errors) -class TestKvmGuest(StdoutTestCase): +class TestKvmGuest(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -751,7 +751,7 @@ def test_guest_size(self): ) -class TestKvmUefi(StdoutTestCase): +class TestKvmUefi(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -821,7 +821,7 @@ def test_uefi_path(self): ) -class TestQemuNFS(StdoutTestCase): +class TestQemuNFS(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() @@ -884,7 +884,7 @@ def test_qemu_nfs(self): self.assertIn("{NFSROOTFS}", args) -class TestMonitor(StdoutTestCase): +class TestMonitor(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = Factory() diff --git a/tests/lava_dispatcher/test_lavashell.py b/tests/lava_dispatcher/test_lavashell.py index ca2a91890f..2a3ea85d9f 100644 --- a/tests/lava_dispatcher/test_lavashell.py +++ b/tests/lava_dispatcher/test_lavashell.py @@ -18,11 +18,11 @@ from lava_dispatcher.parser import JobParser from lava_dispatcher.protocols.multinode import MultinodeProtocol from lava_dispatcher.protocols.vland import VlandProtocol -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger -class TestDefinitionHandlers(StdoutTestCase): +class TestDefinitionHandlers(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() @@ -83,7 +83,7 @@ def create_x86_job(self, filename, device, validate=True): return self.create_job(device, filename, validate=validate) -class TestMultiNodeOverlay(StdoutTestCase): +class TestMultiNodeOverlay(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = X86Factory() @@ -131,7 +131,7 @@ def test_action_namespaces(self): self.assertEqual(key_list, ["deploy", "boot", "test"]) # order is important -class TestShellResults(StdoutTestCase): +class TestShellResults(LavaDispatcherTestCase): class FakeJob(Job): pass diff --git a/tests/lava_dispatcher/test_lxc.py b/tests/lava_dispatcher/test_lxc.py index 502daa93a0..827f0dce16 100644 --- a/tests/lava_dispatcher/test_lxc.py +++ b/tests/lava_dispatcher/test_lxc.py @@ -12,7 +12,7 @@ from lava_dispatcher.actions.deploy.lxc import LxcCreateAction from lava_dispatcher.device import NewDevice from lava_dispatcher.parser import JobParser -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger, infrastructure_error @@ -38,7 +38,7 @@ def create_hikey_aep_job(self, filename): return job -class TestLxcDeploy(StdoutTestCase): +class TestLxcDeploy(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = LxcFactory() @@ -93,7 +93,7 @@ def test_testdefinitions(self): self.assertEqual(len(action.parameters["definitions"]), 2) -class TestLxcWithDevices(StdoutTestCase): +class TestLxcWithDevices(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = LxcFactory() diff --git a/tests/lava_dispatcher/test_menus.py b/tests/lava_dispatcher/test_menus.py index 36df32ce5a..2b5ba30a3a 100644 --- a/tests/lava_dispatcher/test_menus.py +++ b/tests/lava_dispatcher/test_menus.py @@ -14,11 +14,11 @@ from lava_dispatcher.menus.menus import SelectorMenu from lava_dispatcher.shell import ShellCommand, ShellSession from lava_dispatcher.utils.strings import substitute -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger -class TestSelectorMenu(StdoutTestCase): +class TestSelectorMenu(LavaDispatcherTestCase): def setUp(self): super().setUp() self.menu = SelectorMenu() @@ -67,7 +67,7 @@ def create_uefi_job(self, filename): return job -class TestUefi(StdoutTestCase): +class TestUefi(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = MenuFactory() diff --git a/tests/lava_dispatcher/test_messages.py b/tests/lava_dispatcher/test_messages.py index 0d7d841194..74a761fff2 100644 --- a/tests/lava_dispatcher/test_messages.py +++ b/tests/lava_dispatcher/test_messages.py @@ -12,7 +12,7 @@ from lava_common.exceptions import InfrastructureError, JobError from lava_dispatcher.action import Action from lava_dispatcher.utils.messages import LinuxKernelMessages -from tests.lava_dispatcher.test_basic import StdoutTestCase +from tests.lava_dispatcher.test_basic import LavaDispatcherTestCase class FakeConnection: @@ -47,7 +47,7 @@ def wait(self, max_end_time=None, max_searchwindowsize=False): return self.raw_connection.expect(self.prompt_str, timeout=self.faketimeout) -class TestBootMessages(StdoutTestCase): +class TestBootMessages(LavaDispatcherTestCase): def setUp(self): super().setUp() self.max_end_time = time.monotonic() + 30 diff --git a/tests/lava_dispatcher/test_monitor.py b/tests/lava_dispatcher/test_monitor.py index 81085f92e7..12b380e3db 100644 --- a/tests/lava_dispatcher/test_monitor.py +++ b/tests/lava_dispatcher/test_monitor.py @@ -6,7 +6,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later from lava_dispatcher.actions.boot import AutoLoginAction -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase def find_autologin(job): @@ -18,7 +18,7 @@ def find_autologin(job): return False -class TestMonitorPipeline(StdoutTestCase): +class TestMonitorPipeline(LavaDispatcherTestCase): def test_autologin_normal_kvm(self): factory = Factory() job = factory.create_kvm_job("sample_jobs/kvm.yaml") diff --git a/tests/lava_dispatcher/test_mps.py b/tests/lava_dispatcher/test_mps.py index 2a9611361b..29bfad63bb 100644 --- a/tests/lava_dispatcher/test_mps.py +++ b/tests/lava_dispatcher/test_mps.py @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class MpsFactory(Factory): @@ -12,7 +12,7 @@ def create_mps_job(self, filename): return self.create_job("mps2plus-01.jinja2", filename) -class TestMps(StdoutTestCase): +class TestMps(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = MpsFactory() diff --git a/tests/lava_dispatcher/test_multi.py b/tests/lava_dispatcher/test_multi.py index 7323d20f24..f5a81dcf85 100644 --- a/tests/lava_dispatcher/test_multi.py +++ b/tests/lava_dispatcher/test_multi.py @@ -14,12 +14,12 @@ from lava_dispatcher.device import NewDevice from lava_dispatcher.job import Job from lava_dispatcher.parser import JobParser -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.lava_dispatcher.test_uboot import UBootFactory from tests.utils import DummyLogger -class TestMultiDeploy(StdoutTestCase): +class TestMultiDeploy(LavaDispatcherTestCase): def setUp(self): super().setUp() self.parameters = {} @@ -140,7 +140,7 @@ def test_multi_deploy(self, which_mock): ) -class TestMultiDefinition(StdoutTestCase): +class TestMultiDefinition(LavaDispatcherTestCase): def setUp(self): super().setUp() data = yaml_safe_load(Factory().create_device("bbb-01.jinja2")[0]) @@ -192,7 +192,7 @@ def test_multidefinition(self): self.assertIn("Test definition names need to be unique.", runscript.errors) -class TestMultiUBoot(StdoutTestCase): +class TestMultiUBoot(LavaDispatcherTestCase): def setUp(self): super().setUp() factory = UBootFactory() diff --git a/tests/lava_dispatcher/test_multinode.py b/tests/lava_dispatcher/test_multinode.py index 373cd3e91f..89930b9dd6 100644 --- a/tests/lava_dispatcher/test_multinode.py +++ b/tests/lava_dispatcher/test_multinode.py @@ -19,12 +19,12 @@ from lava_dispatcher.actions.test.multinode import MultinodeTestAction from lava_dispatcher.protocols.multinode import MultinodeProtocol from tests.lava_dispatcher.fake_coordinator import TestCoordinator -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.lava_dispatcher.test_defs import allow_missing_path from tests.utils import DummyLogger -class TestMultinode(StdoutTestCase): +class TestMultinode(LavaDispatcherTestCase): def setUp(self): """ Attempt to setup a valid group with clients and test the protocol @@ -596,7 +596,7 @@ def test_protocol_variables(self): ) -class TestProtocol(StdoutTestCase): +class TestProtocol(LavaDispatcherTestCase): coord = None def setUp(self): @@ -746,7 +746,7 @@ def test_lava_send_too_long(self): self.protocol(msg) -class TestDelayedStart(StdoutTestCase): +class TestDelayedStart(LavaDispatcherTestCase): coord = None def setUp(self): diff --git a/tests/lava_dispatcher/test_musca.py b/tests/lava_dispatcher/test_musca.py index 8e27dddae5..d13d133173 100644 --- a/tests/lava_dispatcher/test_musca.py +++ b/tests/lava_dispatcher/test_musca.py @@ -12,7 +12,7 @@ CheckMuscaFlashAction, DeployMuscaAutomationAction, ) -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class MuscaFactory(Factory): @@ -20,7 +20,7 @@ def create_musca_job(self, filename): return self.create_job("musca-01.jinja2", filename) -class TestMusca(StdoutTestCase): +class TestMusca(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = MuscaFactory() diff --git a/tests/lava_dispatcher/test_n1sdp.py b/tests/lava_dispatcher/test_n1sdp.py index 66dd0d9618..a49c55fff3 100644 --- a/tests/lava_dispatcher/test_n1sdp.py +++ b/tests/lava_dispatcher/test_n1sdp.py @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class N1sdpFactory(Factory): @@ -12,7 +12,7 @@ def create_n1sdp_job(self, filename): # pylint: disable=no-self-use return self.create_job("n1sdp-01.jinja2", filename) -class TestN1sdp(StdoutTestCase): +class TestN1sdp(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = N1sdpFactory() diff --git a/tests/lava_dispatcher/test_openocd.py b/tests/lava_dispatcher/test_openocd.py index eca5557159..67cc070d2d 100644 --- a/tests/lava_dispatcher/test_openocd.py +++ b/tests/lava_dispatcher/test_openocd.py @@ -9,7 +9,7 @@ from lava_common.exceptions import InfrastructureError from lava_dispatcher.utils.shell import which -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import infrastructure_error @@ -33,7 +33,7 @@ def create_cc3230SF_job(self, filename): return self.create_job("cc3220SF-02.jinja2", filename) -class TestOpenOCDAction(StdoutTestCase): +class TestOpenOCDAction(LavaDispatcherTestCase): @unittest.skipIf(check_openocd(), "openocd not available") def test_openocd_pipeline(self): factory = OpenOCDFactory() diff --git a/tests/lava_dispatcher/test_power.py b/tests/lava_dispatcher/test_power.py index bb810a7792..e108d119cd 100644 --- a/tests/lava_dispatcher/test_power.py +++ b/tests/lava_dispatcher/test_power.py @@ -5,10 +5,10 @@ # SPDX-License-Identifier: GPL-2.0-or-later -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase -class TestPowerAction(StdoutTestCase): +class TestPowerAction(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() diff --git a/tests/lava_dispatcher/test_pyocd.py b/tests/lava_dispatcher/test_pyocd.py index 65be5137c9..9fb1f593a1 100644 --- a/tests/lava_dispatcher/test_pyocd.py +++ b/tests/lava_dispatcher/test_pyocd.py @@ -7,7 +7,7 @@ import unittest -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import infrastructure_error @@ -31,7 +31,7 @@ def create_k64f_job_with_power(self, filename): return self.create_job("frdm-k64f-power-01.jinja2", filename) -class TestPyocdAction(StdoutTestCase): +class TestPyocdAction(LavaDispatcherTestCase): def test_pyocd_pipeline(self): factory = PyocdFactory() job = factory.create_k64f_job( diff --git a/tests/lava_dispatcher/test_recovery.py b/tests/lava_dispatcher/test_recovery.py index 4287a1c293..6945be4fe0 100644 --- a/tests/lava_dispatcher/test_recovery.py +++ b/tests/lava_dispatcher/test_recovery.py @@ -12,7 +12,7 @@ from lava_dispatcher.device import NewDevice from lava_dispatcher.parser import JobParser from lava_dispatcher.utils.udev import allow_fs_label -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger, infrastructure_error_multi_paths @@ -96,7 +96,7 @@ def create_x15_bl_job(self, filename): return job -class TestRecoveryMode(StdoutTestCase): +class TestRecoveryMode(LavaDispatcherTestCase): def setUp(self): super().setUp() self.fastboot_factory = FastBootFactory() diff --git a/tests/lava_dispatcher/test_removable.py b/tests/lava_dispatcher/test_removable.py index 90e0620f29..d7590b4065 100644 --- a/tests/lava_dispatcher/test_removable.py +++ b/tests/lava_dispatcher/test_removable.py @@ -15,7 +15,7 @@ from lava_dispatcher.device import NewDevice from lava_dispatcher.parser import JobParser from lava_dispatcher.utils.strings import map_kernel_uboot, substitute -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger, infrastructure_error @@ -32,7 +32,7 @@ def create_job(self, template, filename): return job -class TestRemovable(StdoutTestCase): +class TestRemovable(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() diff --git a/tests/lava_dispatcher/test_retries.py b/tests/lava_dispatcher/test_retries.py index 61bfe85fe2..d42be8e2a7 100644 --- a/tests/lava_dispatcher/test_retries.py +++ b/tests/lava_dispatcher/test_retries.py @@ -13,11 +13,11 @@ from lava_dispatcher.logical import DiagnosticAction, RetryAction from lava_dispatcher.parser import JobParser from lava_dispatcher.power import FinalizeAction -from tests.lava_dispatcher.test_basic import StdoutTestCase +from tests.lava_dispatcher.test_basic import LavaDispatcherTestCase from tests.utils import DummyLogger -class TestAction(StdoutTestCase): +class TestAction(LavaDispatcherTestCase): class FakeJob(Job): def __init__(self, parameters): super().__init__(4212, parameters, None) @@ -338,7 +338,7 @@ def test_failure_retry_specified_interval(self): self.assertEqual(action.sleep, 2) -class TestTimeout(StdoutTestCase): +class TestTimeout(LavaDispatcherTestCase): class FakeJob(Job): def __init__(self, parameters): super().__init__(4212, parameters, None) diff --git a/tests/lava_dispatcher/test_test_shell.py b/tests/lava_dispatcher/test_test_shell.py index b785523142..73a3d4db04 100644 --- a/tests/lava_dispatcher/test_test_shell.py +++ b/tests/lava_dispatcher/test_test_shell.py @@ -10,7 +10,7 @@ from lava_common.exceptions import JobError, LAVATimeoutError, TestError from lava_common.yaml import yaml_safe_load -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.lava_dispatcher.test_multi import DummyLogger @@ -19,7 +19,7 @@ def __init__(self, match): self.match = match -class TestSkipTimeouts(StdoutTestCase): +class TestSkipTimeouts(LavaDispatcherTestCase): def setUp(self): super().setUp() self.testdef = os.path.join( @@ -69,7 +69,7 @@ def test_timeouterror(self): self.assertFalse(self.fatal_shell.timeout.can_skip(self.fatal_shell.parameters)) -class TestPatterns(StdoutTestCase): +class TestPatterns(LavaDispatcherTestCase): def setUp(self): super().setUp() self.testdef = os.path.join( diff --git a/tests/lava_dispatcher/test_uboot.py b/tests/lava_dispatcher/test_uboot.py index de48be29b8..26e892e6e3 100644 --- a/tests/lava_dispatcher/test_uboot.py +++ b/tests/lava_dispatcher/test_uboot.py @@ -26,7 +26,7 @@ from lava_dispatcher.utils import filesystem from lava_dispatcher.utils.network import dispatcher_ip from lava_dispatcher.utils.strings import substitute -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger, infrastructure_error @@ -50,7 +50,7 @@ def create_zcu102_job(self, filename): return self.create_job("zcu102.jinja2", filename) -class TestUbootAction(StdoutTestCase): +class TestUbootAction(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = UBootFactory() @@ -855,7 +855,7 @@ def test_imx8m(self): self.assertEqual("u-boot", bootloader.method) -class TestKernelConversion(StdoutTestCase): +class TestKernelConversion(LavaDispatcherTestCase): def setUp(self): data = yaml_safe_load(Factory().create_device("bbb-01.jinja2")[0]) self.device = NewDevice(data) @@ -1005,7 +1005,7 @@ def test_zimage_nobootz(self, which_mock): self.assertTrue(uboot_prepare.mkimage_conversion) -class TestOverlayCommands(StdoutTestCase): +class TestOverlayCommands(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = UBootFactory() diff --git a/tests/lava_dispatcher/test_uboot_dfu.py b/tests/lava_dispatcher/test_uboot_dfu.py index a23cb8a4f6..02ebe256ac 100644 --- a/tests/lava_dispatcher/test_uboot_dfu.py +++ b/tests/lava_dispatcher/test_uboot_dfu.py @@ -6,7 +6,7 @@ import unittest -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import infrastructure_error @@ -15,7 +15,7 @@ def create_rzn1d_job(self, filename): return self.create_job("rzn1d-01.jinja2", filename) -class TestUbootDFUAction(StdoutTestCase): +class TestUbootDFUAction(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = UBootDFUFactory() diff --git a/tests/lava_dispatcher/test_uboot_ums.py b/tests/lava_dispatcher/test_uboot_ums.py index 9376cb539a..4ad68a4272 100644 --- a/tests/lava_dispatcher/test_uboot_ums.py +++ b/tests/lava_dispatcher/test_uboot_ums.py @@ -6,7 +6,7 @@ import unittest -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import infrastructure_error @@ -21,7 +21,7 @@ def create_warp7_job(self, filename): return self.create_job("imx7s-warp-01.jinja2", filename) -class TestUbootUMSAction(StdoutTestCase): +class TestUbootUMSAction(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = UBootUMSFactory() diff --git a/tests/lava_dispatcher/test_uefi_shell.py b/tests/lava_dispatcher/test_uefi_shell.py index 5a4107ee88..0dcba02bab 100644 --- a/tests/lava_dispatcher/test_uefi_shell.py +++ b/tests/lava_dispatcher/test_uefi_shell.py @@ -5,10 +5,10 @@ # SPDX-License-Identifier: GPL-2.0-or-later -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase -class TestUefiShell(StdoutTestCase): +class TestUefiShell(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = Factory() diff --git a/tests/lava_dispatcher/test_user_commands.py b/tests/lava_dispatcher/test_user_commands.py index c685205641..ed52bf04ba 100644 --- a/tests/lava_dispatcher/test_user_commands.py +++ b/tests/lava_dispatcher/test_user_commands.py @@ -6,7 +6,7 @@ from unittest.mock import patch -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class UserCommandFactory(Factory): @@ -14,7 +14,7 @@ def create_b2260_job(self, filename): return self.create_job("b2260-01.jinja2", filename) -class TestUserCommand(StdoutTestCase): +class TestUserCommand(LavaDispatcherTestCase): @patch( "lava_dispatcher.actions.deploy.tftp.which", return_value="/usr/bin/in.tftpd" ) diff --git a/tests/lava_dispatcher/test_uuu.py b/tests/lava_dispatcher/test_uuu.py index b162aa7205..7dcdb504b9 100644 --- a/tests/lava_dispatcher/test_uuu.py +++ b/tests/lava_dispatcher/test_uuu.py @@ -16,7 +16,7 @@ ) from lava_dispatcher.utils.containers import DockerDriver, NullDriver from lava_dispatcher.utils.uuu import OptionalContainerUuuAction -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase class UUUBootFactory(Factory): # pylint: disable=too-few-public-methods @@ -47,7 +47,7 @@ def create_imx8dxlevk_with_bcu_board_id_command(self, filename): @patch( "lava_dispatcher.utils.uuu.OptionalContainerUuuAction.which", Mock("/bin/test_uuu") ) -class TestCheckSerialDownloadMode(StdoutTestCase): +class TestCheckSerialDownloadMode(LavaDispatcherTestCase): def setUp(self): super().setUp() self.factory = UUUBootFactory() @@ -196,7 +196,9 @@ def test_run_not_available(self): @patch( "lava_dispatcher.utils.uuu.OptionalContainerUuuAction.which", Mock("/bin/test_uuu") ) -class TestUUUbootAction(StdoutTestCase): # pylint: disable=too-many-public-methods +class TestUUUbootAction( + LavaDispatcherTestCase +): # pylint: disable=too-many-public-methods def setUp(self): super().setUp() self.factory = UUUBootFactory() diff --git a/tests/lava_dispatcher/test_vland.py b/tests/lava_dispatcher/test_vland.py index 97392ea61a..d7a05efee0 100644 --- a/tests/lava_dispatcher/test_vland.py +++ b/tests/lava_dispatcher/test_vland.py @@ -16,11 +16,11 @@ from lava_dispatcher.parser import JobParser from lava_dispatcher.protocols.multinode import MultinodeProtocol from lava_dispatcher.protocols.vland import VlandProtocol -from tests.lava_dispatcher.test_basic import Factory, StdoutTestCase +from tests.lava_dispatcher.test_basic import Factory, LavaDispatcherTestCase from tests.utils import DummyLogger -class TestVland(StdoutTestCase): +class TestVland(LavaDispatcherTestCase): def setUp(self): super().setUp() self.filename = os.path.join(