diff --git a/casadm/cas_main.c b/casadm/cas_main.c index 1e361bd5d..116b6c0ab 100644 --- a/casadm/cas_main.c +++ b/casadm/cas_main.c @@ -1,6 +1,5 @@ /* * Copyright(c) 2012-2022 Intel Corporation -* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -2420,7 +2419,7 @@ static cli_command cas_commands[] = { .options = standby_params_options, .command_handle_opts = standby_handle_option, .handle = standby_handle, - .flags = (CLI_COMMAND_BLOCKED | CLI_SU_REQUIRED), + .flags = CLI_SU_REQUIRED, .help = standby_help, }, { diff --git a/modules/cas_cache/layer_cache_management.c b/modules/cas_cache/layer_cache_management.c index 7c11d3a8f..7966a9052 100644 --- a/modules/cas_cache/layer_cache_management.c +++ b/modules/cas_cache/layer_cache_management.c @@ -1926,15 +1926,6 @@ int cache_mngt_create_cache_cfg(struct ocf_mngt_cache_config *cfg, char cache_name[OCF_CACHE_NAME_SIZE]; uint16_t cache_id; - switch (cmd->init_cache) { - case CACHE_INIT_STANDBY_NEW: - case CACHE_INIT_STANDBY_LOAD: - printk(KERN_ERR "Standby mode is not supported!\n"); - return -ENOTSUP; - default: - break; - } - if (!cmd) return -OCF_ERR_INVAL; @@ -2704,16 +2695,7 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg, int result = 0, rollback_result = 0; ocf_cache_mode_t cache_mode_meta; ocf_cache_line_size_t cache_line_size_meta; - - switch (cmd->init_cache) { - case CACHE_INIT_STANDBY_NEW: - case CACHE_INIT_STANDBY_LOAD: ocf_volume_destroy(attach_cfg->device.volume); - printk(KERN_ERR "Standby mode is not supported!\n"); - return -ENOTSUP; - default: - break; - } if (!try_module_get(THIS_MODULE)) { ocf_volume_destroy(attach_cfg->device.volume); diff --git a/modules/cas_cache/service_ui_ioctl.c b/modules/cas_cache/service_ui_ioctl.c index 567decc6c..4a51a75a3 100644 --- a/modules/cas_cache/service_ui_ioctl.c +++ b/modules/cas_cache/service_ui_ioctl.c @@ -1,6 +1,5 @@ /* * Copyright(c) 2012-2022 Intel Corporation -* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -424,8 +423,6 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd, case KCAS_IOCTL_STANDBY_DETACH: { struct kcas_standby_detach *cmd_info; - return -ENOTSUP; - GET_CMD_INFO(cmd_info, arg); retval = cache_mngt_standby_detach(cmd_info); @@ -436,8 +433,6 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd, struct kcas_standby_activate *cmd_info; struct ocf_mngt_cache_standby_activate_config cfg; - return -ENOTSUP; - GET_CMD_INFO(cmd_info, arg); retval = cache_mngt_create_cache_standby_activate_cfg(&cfg, diff --git a/test/functional/api/cas/cli_help_messages.py b/test/functional/api/cas/cli_help_messages.py index 2e4ed6716..e14a8de6f 100644 --- a/test/functional/api/cas/cli_help_messages.py +++ b/test/functional/api/cas/cli_help_messages.py @@ -1,6 +1,5 @@ # # Copyright(c) 2020-2022 Intel Corporation -# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -26,6 +25,7 @@ r"-C --io-class Manage IO classes", r"-V --version Print CAS version", r"-H --help Print help", + r"--standby Manage failover standby", r"--zero-metadata Clear metadata from caching device", r"For detailed help on the above commands use --help after the command\.", r"e\.g\.", @@ -281,7 +281,30 @@ standby_help = [ - r"The command is not supported", + r"Usage: casadm --standby \{--init|--load|--detach|--activate\}", + r"Manage failover standby", + r"Initialize cache in standby mode:", + r"Usage: casadm --standby --init --cache-id \ --cache-line-size \ " + r"--cache-device \ \[option...\]", + r"Options that are valid with --init are:", + r"-i --cache-id \ Identifier of cache instance \<1-16384\>", + r"-x --cache-line-size \ Set cache line size in kibibytes: \{4,8,16,32,64\}" + r"\[KiB\] \(default: 4\)", + r"-d --cache-device \ Caching device to be used", + r"-f --force Force the initialization of cache instance", + r"Load cache in standby mode:", + r"Usage: casadm --standby --load --cache-device \", + r"Options that are valid with --load are:", + r"-d --cache-device \ Caching device to be used", + r"Detach cache device in standby mode:", + r"Usage: casadm --standby --detach --cache-id \", + r"Options that are valid with --detach are:", + r" -i --cache-id \ Identifier of cache instance \<1-16384\>", + r"Activate standby cache:", + r"Usage: casadm --standby --activate --cache-id \ --cache-device \", + r"Options that are valid with --activate are:", + r"-i --cache-id \ Identifier of cache instance \<1-16384\>", + r"-d --cache-device \ Caching device to be used" ] zero_metadata_help = [ diff --git a/test/functional/tests/cli/test_cli_standby.py b/test/functional/tests/cli/test_cli_standby.py index 5d0bd3876..71dc6ffcb 100644 --- a/test/functional/tests/cli/test_cli_standby.py +++ b/test/functional/tests/cli/test_cli_standby.py @@ -1,6 +1,5 @@ # # Copyright(c) 2019-2022 Intel Corporation -# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -38,7 +37,6 @@ @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) def test_standby_neg_cli_params(): """ @@ -108,7 +106,6 @@ def test_standby_neg_cli_params(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) def test_activate_neg_cli_params(): """ @@ -189,7 +186,6 @@ def test_activate_neg_cli_params(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) def test_standby_neg_cli_management(): """ @@ -266,7 +262,6 @@ def test_standby_neg_cli_management(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) def test_start_neg_cli_flags(): """ @@ -321,7 +316,6 @@ def test_start_neg_cli_flags(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) def test_activate_without_detach(): """ @@ -385,7 +379,6 @@ def test_activate_without_detach(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("active_cache", DiskTypeSet([DiskType.nand, DiskType.optane])) @pytest.mark.require_disk("standby_cache", DiskTypeSet([DiskType.nand, DiskType.optane])) def test_activate_neg_cache_line_size(): @@ -477,7 +470,6 @@ def test_activate_neg_cache_line_size(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) def test_standby_init_with_preexisting_metadata(): @@ -536,7 +528,6 @@ def test_standby_init_with_preexisting_metadata(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("filesystem", Filesystem) @@ -588,7 +579,6 @@ def test_standby_init_with_preexisting_filesystem(filesystem): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("caches", DiskTypeSet([DiskType.nand, DiskType.optane])) @pytest.mark.require_disk("core", DiskTypeLowerThan("caches")) def test_standby_activate_with_corepool(): @@ -647,7 +637,6 @@ def test_standby_activate_with_corepool(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.parametrizex("cache_line_size", CacheLineSize) def test_standby_start_stop(cache_line_size): diff --git a/test/functional/tests/failover_standby/test_failover_multihost.py b/test/functional/tests/failover_standby/test_failover_multihost.py index 9973425d0..fd01db53b 100644 --- a/test/functional/tests/failover_standby/test_failover_multihost.py +++ b/test/functional/tests/failover_standby/test_failover_multihost.py @@ -1,6 +1,5 @@ # # Copyright(c) 2022 Intel Corporation -# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -43,7 +42,6 @@ test_file_path = f"{mountpoint}/test_file" -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("metadata_dev", DiskTypeSet([DiskType.nand])) @pytest.mark.require_disk("core_dev", DiskTypeSet([DiskType.hdd])) @pytest.mark.require_disk("raid_dev1", DiskTypeSet([DiskType.optane])) @@ -228,7 +226,6 @@ def test_functional_activate_twice_round_trip(filesystem): TestRun.LOGGER.end_group() -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("metadata_dev", DiskTypeSet([DiskType.nand])) @pytest.mark.require_disk("core_dev", DiskTypeSet([DiskType.hdd])) @pytest.mark.require_disk("raid_dev1", DiskTypeSet([DiskType.optane])) diff --git a/test/functional/tests/fault_injection/test_fault_injection_standby.py b/test/functional/tests/fault_injection/test_fault_injection_standby.py index 80d075365..53bf942d3 100644 --- a/test/functional/tests/fault_injection/test_fault_injection_standby.py +++ b/test/functional/tests/fault_injection/test_fault_injection_standby.py @@ -1,6 +1,5 @@ # # Copyright(c) 2019-2022 Intel Corporation -# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -29,7 +28,6 @@ @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) def test_activate_corrupted(): @@ -87,7 +85,6 @@ def test_activate_corrupted(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) def test_load_corrupted(): diff --git a/test/functional/tests/fault_injection/test_fault_injection_standby_core.py b/test/functional/tests/fault_injection/test_fault_injection_standby_core.py index 726918f30..de74bf375 100644 --- a/test/functional/tests/fault_injection/test_fault_injection_standby_core.py +++ b/test/functional/tests/fault_injection/test_fault_injection_standby_core.py @@ -1,6 +1,5 @@ # # Copyright(c) 2019-2022 Intel Corporation -# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -28,7 +27,6 @@ @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) def test_activate_neg_cache_id(): """ @@ -100,7 +98,6 @@ def test_activate_neg_cache_id(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) def test_activate_incomplete_cache(): @@ -222,7 +219,6 @@ def test_activate_incomplete_cache(): @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) def test_activate_neg_core_size(): diff --git a/test/functional/tests/fault_injection/test_standby_activate_different_cache_path.py b/test/functional/tests/fault_injection/test_standby_activate_different_cache_path.py index 5608c83e1..ba3321758 100644 --- a/test/functional/tests/fault_injection/test_standby_activate_different_cache_path.py +++ b/test/functional/tests/fault_injection/test_standby_activate_different_cache_path.py @@ -1,6 +1,5 @@ # # Copyright(c) 2022 Intel Corporation -# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -20,7 +19,6 @@ @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) @pytest.mark.parametrizex("cache_line_size", CacheLineSize) diff --git a/test/functional/tests/fault_injection/test_standby_activate_the_same_cache_path.py b/test/functional/tests/fault_injection/test_standby_activate_the_same_cache_path.py index adb71a035..35adad4f9 100644 --- a/test/functional/tests/fault_injection/test_standby_activate_the_same_cache_path.py +++ b/test/functional/tests/fault_injection/test_standby_activate_the_same_cache_path.py @@ -1,6 +1,5 @@ # # Copyright(c) 2022 Intel Corporation -# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -15,7 +14,6 @@ @pytest.mark.CI -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane])) @pytest.mark.require_disk("core", DiskTypeLowerThan("cache")) def test_standby_activate_the_same_cache_path(): diff --git a/test/functional/tests/initialize/test_startup_init_config.py b/test/functional/tests/initialize/test_startup_init_config.py index 34c18015b..4557c387d 100644 --- a/test/functional/tests/initialize/test_startup_init_config.py +++ b/test/functional/tests/initialize/test_startup_init_config.py @@ -1,6 +1,5 @@ # # Copyright(c) 2019-2022 Intel Corporation -# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -385,7 +384,6 @@ def test_cas_startup_negative_missing_cache(): @pytest.mark.os_dependent -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("core", DiskTypeSet([DiskType.hdd])) @pytest.mark.require_plugin("power_control") @@ -491,7 +489,6 @@ def test_failover_config_startup(): @pytest.mark.os_dependent -@pytest.mark.skip(reason="Standby mode is not supported") @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) def test_failover_config_startup_negative(): """