From 4b39811c43a10f87c444c3084d7d6095b807b674 Mon Sep 17 00:00:00 2001 From: Slawomir Jankowski Date: Wed, 12 Aug 2020 15:39:03 +0200 Subject: [PATCH] Add 'os_dependent' marker to tests Signed-off-by: Slawomir Jankowski --- .../tests/data_integrity/test_data_integrity_12h.py | 1 + .../tests/data_integrity/test_data_integrity_5d.py | 2 ++ test/functional/tests/incremental_load/test_udev.py | 4 ++++ .../functional/tests/initialize/test_initialize_runlevel.py | 1 + test/functional/tests/initialize/test_initialize_status.py | 3 +++ .../functional/tests/initialize/test_startup_init_config.py | 1 + test/functional/tests/io_class/test_io_class_directory.py | 3 +++ test/functional/tests/io_class/test_io_class_file.py | 1 + test/functional/tests/io_class/test_io_classification.py | 6 ++++++ .../tests/lazy_writes/test_lazy_writes_signals.py | 3 +++ test/functional/tests/misc/test_device_capabilities.py | 1 + test/functional/tests/stress/test_kedr.py | 2 ++ test/functional/tests/stress/test_stress_shutdown.py | 1 + test/functional/tests/trim/test_trim.py | 1 + 14 files changed, 30 insertions(+) diff --git a/test/functional/tests/data_integrity/test_data_integrity_12h.py b/test/functional/tests/data_integrity/test_data_integrity_12h.py index 2cbd57f..ddaef70 100644 --- a/test/functional/tests/data_integrity/test_data_integrity_12h.py +++ b/test/functional/tests/data_integrity/test_data_integrity_12h.py @@ -23,6 +23,7 @@ stop_size = int(Size(128, Unit.KibiByte)) runtime = datetime.timedelta(hours=12) / (stop_size / 512) +@pytest.mark.os_dependent @pytest.mark.parametrize("cache_mode", [CacheMode.WT, CacheMode.WB]) @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) diff --git a/test/functional/tests/data_integrity/test_data_integrity_5d.py b/test/functional/tests/data_integrity/test_data_integrity_5d.py index 00aa238..617d853 100644 --- a/test/functional/tests/data_integrity/test_data_integrity_5d.py +++ b/test/functional/tests/data_integrity/test_data_integrity_5d.py @@ -33,6 +33,7 @@ def shuffled_fs_list(n): return random.sample(list(itertools.islice(itertools.cycle(Filesystem), n)), n) +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core1", DiskTypeLowerThan("cache")) @pytest.mark.require_disk("core2", DiskTypeLowerThan("cache")) @@ -121,6 +122,7 @@ def test_data_integrity_5d_dss(filesystems): f"Cache mode: {mode} Filesystem: {fs}") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core1", DiskTypeLowerThan("cache")) @pytest.mark.require_disk("core2", DiskTypeLowerThan("cache")) diff --git a/test/functional/tests/incremental_load/test_udev.py b/test/functional/tests/incremental_load/test_udev.py index 89500db..45082d5 100644 --- a/test/functional/tests/incremental_load/test_udev.py +++ b/test/functional/tests/incremental_load/test_udev.py @@ -14,6 +14,7 @@ from storage_devices.disk import DiskTypeSet, DiskTypeLowerThan, DiskType from test_utils.size import Size, Unit +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) def test_udev_core_partition(): @@ -54,6 +55,7 @@ def test_udev_core_partition(): check_if_dev_in_core_pool(dev) +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeSet([DiskType.hdd, DiskType.hdd4k, DiskType.sata])) def test_udev_core(): @@ -97,6 +99,7 @@ def test_udev_core(): TestRun.fail(f"Core status is {core.get_status()} instead of active.") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.parametrizex("cache_mode", CacheMode) def test_udev_cache_load(cache_mode): @@ -140,6 +143,7 @@ def test_udev_cache_load(cache_mode): TestRun.LOGGER.info("Cache is correctly loaded.") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeSet([DiskType.sata, DiskType.hdd])) def test_neg_udev_cache_load(): diff --git a/test/functional/tests/initialize/test_initialize_runlevel.py b/test/functional/tests/initialize/test_initialize_runlevel.py index 3f9cf88..a230a22 100644 --- a/test/functional/tests/initialize/test_initialize_runlevel.py +++ b/test/functional/tests/initialize/test_initialize_runlevel.py @@ -22,6 +22,7 @@ from test_utils.size import Size, Unit mount_point = "/mnt/test" +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("runlevel", [Runlevel.runlevel5, Runlevel.runlevel3]) diff --git a/test/functional/tests/initialize/test_initialize_status.py b/test/functional/tests/initialize/test_initialize_status.py index 4a766b6..09fbbf3 100644 --- a/test/functional/tests/initialize/test_initialize_status.py +++ b/test/functional/tests/initialize/test_initialize_status.py @@ -3,12 +3,15 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear # +import pytest + from api.cas import cas_module, casctl from api.cas.cas_module import CasModule from core.test_run import TestRun from test_utils import os_utils +@pytest.mark.os_dependent def test_init_status(): """ title: CAS management device status diff --git a/test/functional/tests/initialize/test_startup_init_config.py b/test/functional/tests/initialize/test_startup_init_config.py index e404187..698ab4a 100644 --- a/test/functional/tests/initialize/test_startup_init_config.py +++ b/test/functional/tests/initialize/test_startup_init_config.py @@ -22,6 +22,7 @@ mountpoint = "/mnt" filepath = f"{mountpoint}/file" +@pytest.mark.os_dependent @pytest.mark.remote_only @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) diff --git a/test/functional/tests/io_class/test_io_class_directory.py b/test/functional/tests/io_class/test_io_class_directory.py index 4007994..b917255 100644 --- a/test/functional/tests/io_class/test_io_class_directory.py +++ b/test/functional/tests/io_class/test_io_class_directory.py @@ -18,6 +18,7 @@ from test_utils.os_utils import drop_caches, DropCachesMode, sync, Udev from .io_class_common import * +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) @@ -109,6 +110,7 @@ def test_ioclass_directory_depth(filesystem): f"Expected: {base_occupancy + test_file_2.size}, actual: {new_occupancy}" +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) @@ -281,6 +283,7 @@ def test_ioclass_directory_dir_operations(filesystem): directory=dir_1, with_delay=True) +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) diff --git a/test/functional/tests/io_class/test_io_class_file.py b/test/functional/tests/io_class/test_io_class_file.py index 1b3d3b2..75e6b73 100644 --- a/test/functional/tests/io_class/test_io_class_file.py +++ b/test/functional/tests/io_class/test_io_class_file.py @@ -303,6 +303,7 @@ def test_ioclass_file_offset(): TestRun.LOGGER.error(f"Inappropriately cached offset: {file_offset}") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) diff --git a/test/functional/tests/io_class/test_io_classification.py b/test/functional/tests/io_class/test_io_classification.py index f72ae62..134ca6b 100644 --- a/test/functional/tests/io_class/test_io_classification.py +++ b/test/functional/tests/io_class/test_io_classification.py @@ -159,6 +159,7 @@ def test_ioclass_request_size(): TestRun.fail("Dirty data present!") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", list(Filesystem) + [False]) @@ -244,6 +245,7 @@ def test_ioclass_direct(filesystem): f"Expected: {base_occupancy + io_size}, actual: {new_occupancy}") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) @@ -334,6 +336,7 @@ def test_ioclass_metadata(filesystem): TestRun.fail("No requests to metadata while deleting directory with files!") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) @@ -473,6 +476,7 @@ def test_ioclass_id_as_condition(filesystem): f"Expected: {base_occupancy + ioclass_file_size}, actual: {new_occupancy}") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) @@ -521,6 +525,7 @@ def test_ioclass_conditions_or(filesystem): f"Expected: {base_occupancy + file_size}, actual: {new_occupancy}") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) @@ -570,6 +575,7 @@ def test_ioclass_conditions_and(filesystem): f"Expected: {base_occupancy}, actual: {new_occupancy}") +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) diff --git a/test/functional/tests/lazy_writes/test_lazy_writes_signals.py b/test/functional/tests/lazy_writes/test_lazy_writes_signals.py index 2f0670c..d386531 100644 --- a/test/functional/tests/lazy_writes/test_lazy_writes_signals.py +++ b/test/functional/tests/lazy_writes/test_lazy_writes_signals.py @@ -24,6 +24,7 @@ mount_point = "/mnt/cas" syslog_path = "/var/log/messages" +@pytest.mark.os_dependent @pytest.mark.require_plugin("scsi_debug_fua_signals", dev_size_mb="4096", opts="1") @pytest.mark.parametrizex("cache_mode", CacheMode.with_traits(CacheModeTrait.LazyWrites)) @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @@ -121,6 +122,7 @@ def test_flush_signal_core(cache_mode): cache.stop() +@pytest.mark.os_dependent @pytest.mark.require_plugin("scsi_debug_fua_signals", dev_size_mb="2048", opts="1") @pytest.mark.parametrizex("cache_mode", CacheMode.with_traits(CacheModeTrait.LazyWrites)) @pytest.mark.require_disk("core", DiskTypeSet([DiskType.hdd, DiskType.hdd4k, DiskType.sata])) @@ -218,6 +220,7 @@ def test_flush_signal_cache(cache_mode): cache.stop() +@pytest.mark.os_dependent @pytest.mark.require_plugin("scsi_debug_fua_signals", dev_size_mb="2048", opts="1") @pytest.mark.parametrizex("cache_mode", CacheMode.with_traits(CacheModeTrait.LazyWrites)) @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) diff --git a/test/functional/tests/misc/test_device_capabilities.py b/test/functional/tests/misc/test_device_capabilities.py index b627b50..a8d6c67 100644 --- a/test/functional/tests/misc/test_device_capabilities.py +++ b/test/functional/tests/misc/test_device_capabilities.py @@ -15,6 +15,7 @@ from test_utils.output import CmdException from test_utils.size import Size, Unit +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.require_plugin("scsi_debug") diff --git a/test/functional/tests/stress/test_kedr.py b/test/functional/tests/stress/test_kedr.py index 24feede..f3eab3b 100644 --- a/test/functional/tests/stress/test_kedr.py +++ b/test/functional/tests/stress/test_kedr.py @@ -149,6 +149,7 @@ def test_kedr_start_cache(module, unload_modules, install_kedr): Kedr.stop() +@pytest.mark.os_dependent @pytest.mark.parametrize("module", cas_module.CasModule) @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @@ -213,6 +214,7 @@ def test_kedr_basic_io_raw(module, unload_modules, install_kedr): Kedr.stop() +@pytest.mark.os_dependent @pytest.mark.parametrize("module", cas_module.CasModule) @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) diff --git a/test/functional/tests/stress/test_stress_shutdown.py b/test/functional/tests/stress/test_stress_shutdown.py index ac0bd43..9530a4b 100644 --- a/test/functional/tests/stress/test_stress_shutdown.py +++ b/test/functional/tests/stress/test_stress_shutdown.py @@ -19,6 +19,7 @@ cores_number = 2 iterations_per_config = 5 +@pytest.mark.os_dependent @pytest.mark.parametrizex("cache_mode", CacheMode.with_traits(CacheModeTrait.LazyWrites)) @pytest.mark.parametrizex("cleaning_policy", CleaningPolicy) @pytest.mark.parametrizex("cache_line_size", CacheLineSize) diff --git a/test/functional/tests/trim/test_trim.py b/test/functional/tests/trim/test_trim.py index b9f6447..3b3db30 100644 --- a/test/functional/tests/trim/test_trim.py +++ b/test/functional/tests/trim/test_trim.py @@ -16,6 +16,7 @@ from test_tools.fio.fio_param import ReadWrite, IoEngine from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan +@pytest.mark.os_dependent @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) def test_trim_start_discard(): """