From f29cc34706d2d4a73af58001f2e2c3ddcdf3b82c Mon Sep 17 00:00:00 2001 From: Dalton Bohning Date: Mon, 22 Jan 2024 23:42:30 +0000 Subject: [PATCH] DAOS-15002 test: use default pool svc for rebuild tests When possible, use the system default of svc_rf * 2 + 1 for rebuild tests instead of hardcoding to inappropriate values. Otherwise, update some tests with svnc: 5 to account for killing a rank. Test-tag: RbldCascadingFailures RbldDeleteObjects RbldReadArrayTest RbldContRfTest RbldWidelyStriped RbldWithIOR EcodOfflineRebuildSingle EcodOnlineMultFail EcodOfflineRebuild EcodOfflineRebuildSingle EcodOnlineRebuild EcodDisabledRebuildSingle EcodDisabledRebuild ServerRankFailure ContRfEnforce Test-repeat: 1 Skip-unit-tests: true Skip-fault-injection-test: true Required-githooks: true Signed-off-by: Dalton Bohning --- src/tests/ftest/container/rf_enforcement.py | 8 ++--- .../ftest/deployment/server_rank_failure.yaml | 3 -- .../ftest/erasurecode/multiple_failure.yaml | 2 -- .../ftest/erasurecode/offline_rebuild.yaml | 2 -- .../erasurecode/offline_rebuild_single.yaml | 2 -- .../ftest/erasurecode/online_rebuild.yaml | 2 -- .../erasurecode/online_rebuild_single.yaml | 2 -- .../ftest/erasurecode/rebuild_disabled.yaml | 2 -- .../erasurecode/rebuild_disabled_single.yaml | 2 -- .../ftest/rebuild/cascading_failures.yaml | 4 +-- src/tests/ftest/rebuild/container_rf.py | 3 +- src/tests/ftest/rebuild/container_rf.yaml | 7 ++-- src/tests/ftest/rebuild/delete_objects.yaml | 2 -- src/tests/ftest/rebuild/read_array.yaml | 4 +-- src/tests/ftest/rebuild/widely_striped.yaml | 5 ++- src/tests/ftest/rebuild/with_ior.yaml | 3 +- .../ftest/util/container_rf_test_base.py | 33 +++++-------------- src/tests/ftest/util/test_utils_pool.py | 2 +- 18 files changed, 22 insertions(+), 66 deletions(-) diff --git a/src/tests/ftest/container/rf_enforcement.py b/src/tests/ftest/container/rf_enforcement.py index dcacf091398..aafb24bd841 100644 --- a/src/tests/ftest/container/rf_enforcement.py +++ b/src/tests/ftest/container/rf_enforcement.py @@ -40,9 +40,7 @@ def test_container_redundancy_factor_oclass_enforcement(self): :avocado: tags=all,full_regression :avocado: tags=vm - :avocado: tags=container - :avocado: tags=container_rf,cont_rf_oclass_enforcement - :avocado: tags=test_container_redundancy_factor_oclass_enforcement + :avocado: tags=container,container_rf,cont_rf_oclass_enforcement + :avocado: tags=ContRfEnforce,test_container_redundancy_factor_oclass_enforcement """ - self.mode = "cont_rf_enforcement" - self.execute_cont_rf_test() + self.execute_cont_rf_test(mode="cont_rf_enforcement") diff --git a/src/tests/ftest/deployment/server_rank_failure.yaml b/src/tests/ftest/deployment/server_rank_failure.yaml index 5d422648eed..2f897404598 100644 --- a/src/tests/ftest/deployment/server_rank_failure.yaml +++ b/src/tests/ftest/deployment/server_rank_failure.yaml @@ -36,12 +36,9 @@ server_config: pool_size_ratio_80: size: 80% - control_method: dmg rebuild_timeout: 960 - svcn: 5 pool_size_value: size: 500G - control_method: dmg rebuild_timeout: 240 container: diff --git a/src/tests/ftest/erasurecode/multiple_failure.yaml b/src/tests/ftest/erasurecode/multiple_failure.yaml index 73ceb3bfdc0..78f132474b5 100644 --- a/src/tests/ftest/erasurecode/multiple_failure.yaml +++ b/src/tests/ftest/erasurecode/multiple_failure.yaml @@ -25,8 +25,6 @@ server_config: storage: auto pool: size: 93% - svcn: 5 - control_method: dmg container: type: POSIX control_method: daos diff --git a/src/tests/ftest/erasurecode/offline_rebuild.yaml b/src/tests/ftest/erasurecode/offline_rebuild.yaml index ebd4904ce2c..7d1a6e7aa08 100644 --- a/src/tests/ftest/erasurecode/offline_rebuild.yaml +++ b/src/tests/ftest/erasurecode/offline_rebuild.yaml @@ -32,8 +32,6 @@ server_config: storage: auto pool: size: 93% - svcn: 1 - control_method: dmg container: type: POSIX control_method: daos diff --git a/src/tests/ftest/erasurecode/offline_rebuild_single.yaml b/src/tests/ftest/erasurecode/offline_rebuild_single.yaml index 5c32aaa29ac..8b7fba9ae09 100644 --- a/src/tests/ftest/erasurecode/offline_rebuild_single.yaml +++ b/src/tests/ftest/erasurecode/offline_rebuild_single.yaml @@ -30,8 +30,6 @@ server_config: storage: auto pool: size: 93% - svcn: 1 - control_method: dmg pool_query_timeout: 30 container: type: POSIX diff --git a/src/tests/ftest/erasurecode/online_rebuild.yaml b/src/tests/ftest/erasurecode/online_rebuild.yaml index fbfa7493447..f5ea4768df7 100644 --- a/src/tests/ftest/erasurecode/online_rebuild.yaml +++ b/src/tests/ftest/erasurecode/online_rebuild.yaml @@ -31,8 +31,6 @@ server_config: storage: auto pool: size: 93% - svcn: 1 - control_method: dmg container: type: POSIX control_method: daos diff --git a/src/tests/ftest/erasurecode/online_rebuild_single.yaml b/src/tests/ftest/erasurecode/online_rebuild_single.yaml index 8b0b3f4baf0..7284a1f7134 100644 --- a/src/tests/ftest/erasurecode/online_rebuild_single.yaml +++ b/src/tests/ftest/erasurecode/online_rebuild_single.yaml @@ -30,8 +30,6 @@ server_config: storage: auto pool: size: 93% - svcn: 5 - control_method: dmg pool_query_timeout: 30 properties: rd_fac:2 container: diff --git a/src/tests/ftest/erasurecode/rebuild_disabled.yaml b/src/tests/ftest/erasurecode/rebuild_disabled.yaml index 55939c0b425..e970e043972 100644 --- a/src/tests/ftest/erasurecode/rebuild_disabled.yaml +++ b/src/tests/ftest/erasurecode/rebuild_disabled.yaml @@ -32,8 +32,6 @@ server_config: storage: auto pool: size: 93% - svcn: 1 - control_method: dmg pool_query_timeout: 30 container: type: POSIX diff --git a/src/tests/ftest/erasurecode/rebuild_disabled_single.yaml b/src/tests/ftest/erasurecode/rebuild_disabled_single.yaml index 8a2294753bc..b4154fcc369 100644 --- a/src/tests/ftest/erasurecode/rebuild_disabled_single.yaml +++ b/src/tests/ftest/erasurecode/rebuild_disabled_single.yaml @@ -32,8 +32,6 @@ server_config: storage: auto pool: size: 93% - svcn: 1 - control_method: dmg pool_query_timeout: 30 container: type: POSIX diff --git a/src/tests/ftest/rebuild/cascading_failures.yaml b/src/tests/ftest/rebuild/cascading_failures.yaml index 8b9b272b4bd..c5fbb7e28cd 100644 --- a/src/tests/ftest/rebuild/cascading_failures.yaml +++ b/src/tests/ftest/rebuild/cascading_failures.yaml @@ -15,9 +15,7 @@ server_config: scm_mount: /mnt/daos system_ram_reserved: 1 pool: - scm_size: 1073741824 - svcn: 2 - control_method: dmg + size: 1G pool_query_timeout: 30 properties: rd_fac:2 container: diff --git a/src/tests/ftest/rebuild/container_rf.py b/src/tests/ftest/rebuild/container_rf.py index 51037212556..c0daa01f6be 100644 --- a/src/tests/ftest/rebuild/container_rf.py +++ b/src/tests/ftest/rebuild/container_rf.py @@ -39,5 +39,4 @@ def test_rebuild_with_container_rf(self): :avocado: tags=container,rebuild,container_rf :avocado: tags=RbldContRfTest,test_rebuild_with_container_rf """ - self.mode = "cont_rf_with_rebuild" - self.execute_cont_rf_test() + self.execute_cont_rf_test(mode="cont_rf_with_rebuild") diff --git a/src/tests/ftest/rebuild/container_rf.yaml b/src/tests/ftest/rebuild/container_rf.yaml index eb436baa2d3..f1333dbbadc 100644 --- a/src/tests/ftest/rebuild/container_rf.yaml +++ b/src/tests/ftest/rebuild/container_rf.yaml @@ -1,5 +1,5 @@ hosts: - test_servers: 6 + test_servers: 7 test_clients: 1 timeout: 480 server_config: @@ -15,9 +15,8 @@ server_config: scm_mount: /mnt/daos system_ram_reserved: 1 pool: - scm_size: 1073741824 - svcn: 3 - control_method: dmg + size: 1G + svcn: 7 # To match number of servers pool_query_timeout: 30 container: control_method: daos diff --git a/src/tests/ftest/rebuild/delete_objects.yaml b/src/tests/ftest/rebuild/delete_objects.yaml index bb99fe48d70..e80a2aec9c4 100644 --- a/src/tests/ftest/rebuild/delete_objects.yaml +++ b/src/tests/ftest/rebuild/delete_objects.yaml @@ -16,9 +16,7 @@ server_config: system_ram_reserved: 1 pool: scm_size: 1073741824 - svcn: 2 debug: true - control_method: dmg pool_query_timeout: 30 properties: rd_fac:2 container: diff --git a/src/tests/ftest/rebuild/read_array.yaml b/src/tests/ftest/rebuild/read_array.yaml index 6bb9e559a17..b7a64dfc3e2 100644 --- a/src/tests/ftest/rebuild/read_array.yaml +++ b/src/tests/ftest/rebuild/read_array.yaml @@ -19,9 +19,7 @@ server_config: scm_mount: /mnt/daos system_ram_reserved: 1 pool: - scm_size: 1073741824 - svcn: 2 - control_method: dmg + size: 1G pool_query_timeout: 30 properties: rd_fac:2 container: diff --git a/src/tests/ftest/rebuild/widely_striped.yaml b/src/tests/ftest/rebuild/widely_striped.yaml index fdeb6090d11..40853a14b20 100644 --- a/src/tests/ftest/rebuild/widely_striped.yaml +++ b/src/tests/ftest/rebuild/widely_striped.yaml @@ -18,15 +18,14 @@ testparams: pool: scm_size: 10G nvme_size: 60G - svcn: 5 - control_method: dmg rebuild_timeout: 240 pool_query_timeout: 60 + properties: rd_fac:2 container: type: POSIX control_method: daos oclass: RP_3G1 - properties: "rd_fac:2" + properties: rd_fac:2 mdtest: api: DFS client_processes: diff --git a/src/tests/ftest/rebuild/with_ior.yaml b/src/tests/ftest/rebuild/with_ior.yaml index d58b65f9ea0..44e02c61397 100644 --- a/src/tests/ftest/rebuild/with_ior.yaml +++ b/src/tests/ftest/rebuild/with_ior.yaml @@ -29,8 +29,7 @@ server_config: pool: scm_size: 6G - svcn: 3 - control_method: dmg + properties: rd_fac:1 pool_query_timeout: 30 container: diff --git a/src/tests/ftest/util/container_rf_test_base.py b/src/tests/ftest/util/container_rf_test_base.py index cf89ea6355c..37dbc8a397f 100644 --- a/src/tests/ftest/util/container_rf_test_base.py +++ b/src/tests/ftest/util/container_rf_test_base.py @@ -1,11 +1,10 @@ """ - (C) Copyright 2019-2023 Intel Corporation. + (C) Copyright 2019-2024 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import re -from daos_utils import DaosCommand from general_utils import DaosTestError from rebuild_test_base import RebuildTestBase @@ -15,21 +14,6 @@ class ContRedundancyFactor(RebuildTestBase): :avocado: recursive """ - - def __init__(self, *args, **kwargs): - """Initialize a CascadingFailures object.""" - super().__init__(*args, **kwargs) - self.mode = None - self.daos_cmd = None - - def create_test_container(self): - """Create a container and write objects.""" - self.log.info( - "==>(1)Create pool and container with redundant factor," - " start background IO object write") - self.container.create() - self.container.write_objects(self.inputs.rank.value[0], self.inputs.object_class.value) - def verify_rank_has_objects(self): """Verify the first rank to be excluded has at least one object.""" rank_list = self.container.get_target_rank_lists(" before rebuild") @@ -61,8 +45,7 @@ def verify_cont_rf_healthstatus(self, expected_rf, expected_health): actual_rf = None actual_health = None - cont_props = self.daos_cmd.container_get_prop( - pool=self.pool.uuid, cont=self.container.uuid, properties=["rd_fac", "status"]) + cont_props = self.container.get_prop(properties=["rd_fac", "status"]) for cont_prop in cont_props["response"]: if cont_prop["name"] == "rd_fac": actual_rf = cont_prop["value"] @@ -144,19 +127,20 @@ def create_test_container_and_write_obj(self, negative_test=False): self.fail("#Negative test, container redundancy factor " "test failed, return error RC: -1003 not found") - def execute_cont_rf_test(self, create_container=True): + def execute_cont_rf_test(self, create_container=True, mode=None): """Execute the rebuild test steps for container rd_fac test. Args: create_container (bool, optional): should the test create a container. Defaults to True. + mode (str): either "cont_rf_with_rebuild" or "cont_rf_enforcement" """ # Get the test params and var self.setup_test_pool() - self.daos_cmd = DaosCommand(self.bin) if create_container: self.setup_test_container() oclass = self.inputs.object_class.value + # Negative testing pertains to RF enforcement when creating objects - not rebuild negative_test = True rd_fac = ''.join(self.container.properties.value.split(":")) rf_match = re.search(r"rd_fac([0-9]+)", rd_fac) @@ -171,7 +155,8 @@ def execute_cont_rf_test(self, create_container=True): self.create_test_pool() # Create a container and write objects self.create_test_container_and_write_obj(negative_test) - if self.mode == "cont_rf_with_rebuild": + + if mode == "cont_rf_with_rebuild": num_of_ranks = len(self.inputs.rank.value) if num_of_ranks > rf_num: expect_cont_status = "UNCLEAN" @@ -196,7 +181,7 @@ def execute_cont_rf_test(self, create_container=True): self.log.info("==>(7)Check for container data if the container is healthy.") self.verify_container_data() self.log.info("Test passed") - elif self.mode == "cont_rf_enforcement": + elif mode == "cont_rf_enforcement": self.log.info("Container rd_fac test passed") else: - self.fail("#Unsupported container_rf test mode") + self.fail(f"Unsupported container_rf test mode: {mode}") diff --git a/src/tests/ftest/util/test_utils_pool.py b/src/tests/ftest/util/test_utils_pool.py index 421c988a0ea..1d273e802eb 100644 --- a/src/tests/ftest/util/test_utils_pool.py +++ b/src/tests/ftest/util/test_utils_pool.py @@ -354,7 +354,7 @@ def create(self): self.pool = TestPool(self.context, DmgCommand(self.bin)) If it wants to use --nsvc option, it needs to set the value to - svcn.value. Otherwise, 1 is used. If it wants to use --group, it needs + svcn.value. If it wants to use --group, it needs to set groupname.value. If it wants to use --user, it needs to set username.value. If it wants to add other options, directly set it to self.dmg.action_command. Refer dmg_utils.py pool_create method for