diff --git a/src/tests/ftest/container/fill_destroy_loop.py b/src/tests/ftest/container/fill_destroy_loop.py index ada553772b6..396ea20e41d 100644 --- a/src/tests/ftest/container/fill_destroy_loop.py +++ b/src/tests/ftest/container/fill_destroy_loop.py @@ -6,8 +6,7 @@ import os from apricot import TestWithServers -from avocado.core.exceptions import TestFail -from general_utils import bytes_to_human, human_to_bytes +from general_utils import DaosTestError, bytes_to_human, human_to_bytes from run_utils import run_remote @@ -96,7 +95,7 @@ def write_pool_until_nospace(self, test_loop): try: container.write_objects() - except TestFail as excep: + except DaosTestError as excep: if self.DER_NOSPACE in str(excep): self.log.info( "--%i.(4)DER_NOSPACE %s detected, pool is unable for an additional" diff --git a/src/tests/ftest/control/dmg_system_cleanup.py b/src/tests/ftest/control/dmg_system_cleanup.py index 9051dd28dab..9ce75df4821 100644 --- a/src/tests/ftest/control/dmg_system_cleanup.py +++ b/src/tests/ftest/control/dmg_system_cleanup.py @@ -6,7 +6,7 @@ from socket import gethostname from apricot import TestWithServers -from avocado.core.exceptions import TestFail +from general_utils import DaosTestError from pydaos.raw import DaosPool @@ -62,7 +62,7 @@ def test_dmg_system_cleanup_one_host(self): try: for idx in range(2): self.container[idx].write_objects() - except TestFail as error: + except DaosTestError as error: self.fail("Unable to write container #{}: {}\n".format(idx, error)) # Call dmg system cleanup on the host and create cleaned pool list. @@ -78,7 +78,7 @@ def test_dmg_system_cleanup_one_host(self): for idx in range(2): try: self.container[idx].write_objects() - except TestFail as error: + except DaosTestError as error: self.log.info("Unable to write container #%d: as expected %s\n", idx, error) else: self.fail("Wrote to container #{} when it should have failed".format(idx)) diff --git a/src/tests/ftest/pool/evict.py b/src/tests/ftest/pool/evict.py index 539d0e2a412..b9a8e2efa40 100644 --- a/src/tests/ftest/pool/evict.py +++ b/src/tests/ftest/pool/evict.py @@ -4,8 +4,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent """ from apricot import TestWithServers -from avocado.core.exceptions import TestFail from ClusterShell.NodeSet import NodeSet +from general_utils import DaosTestError from pydaos.raw import DaosApiError, c_uuid_to_str @@ -205,7 +205,7 @@ def test_pool_evict(self): if failure_expected: self.fail( "Pool {} was evicted, but write_objects worked!".format(index)) - except TestFail as error: + except DaosTestError as error: if failure_expected and "-1002" in str(error): msg = "Pool # {}: write_objects failed as expected.\n\t{}".format( index, error) diff --git a/src/tests/ftest/rebuild/container_create_race.py b/src/tests/ftest/rebuild/container_create_race.py index c98103dd00d..e9929113be3 100644 --- a/src/tests/ftest/rebuild/container_create_race.py +++ b/src/tests/ftest/rebuild/container_create_race.py @@ -3,7 +3,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent """ -from avocado.core.exceptions import TestFail +from general_utils import DaosTestError from ior_test_base import IorTestBase @@ -67,7 +67,7 @@ def access_container(self, index=-1): try: container.read_objects() container.close() - except TestFail as error: + except DaosTestError as error: self.log.error("=> Container %s read failed:", container, exc_info=error) status = False return status diff --git a/src/tests/ftest/util/container_rf_test_base.py b/src/tests/ftest/util/container_rf_test_base.py index 53fcbe79319..cf89ea6355c 100644 --- a/src/tests/ftest/util/container_rf_test_base.py +++ b/src/tests/ftest/util/container_rf_test_base.py @@ -132,7 +132,7 @@ def create_test_container_and_write_obj(self, negative_test=False): self.inputs.rank.value[0], self.inputs.object_class.value) else: try: - self.container.write_objects_wo_failon( + self.container.write_objects( self.inputs.rank.value[0], self.inputs.object_class.value) self.fail("#Container redundancy factor with an invalid " "object_class traffic passed, expecting Fail") diff --git a/src/tests/ftest/util/test_utils_container.py b/src/tests/ftest/util/test_utils_container.py index bc7902dec3a..3eedc1158d4 100644 --- a/src/tests/ftest/util/test_utils_container.py +++ b/src/tests/ftest/util/test_utils_container.py @@ -620,31 +620,6 @@ def check_container_info(self, ci_uuid=None, ci_nsnapshots=None, ci_nhandles=Non if key != "self" and val is not None] return self._check_info(checks) - def write_objects_wo_failon(self, rank=None, obj_class=None): - """Write objects to the container without fail_on DaosTestError, - for negative test on container write_objects. - - Args: - rank (int, optional): server rank. Defaults to None. - obj_class (int, optional): daos object class. Defaults to None. - - """ - self.open() - self.log.info( - "Writing %s object(s), with %s record(s) of %s bytes(s) each, in " - "container %s%s%s", - self.object_qty.value, self.record_qty.value, self.data_size.value, - str(self), " on rank {}".format(rank) if rank is not None else "", - " with object class {}".format(obj_class) - if obj_class is not None else "") - for _ in range(self.object_qty.value): - self.written_data.append(TestContainerData(self.debug.value)) - self.written_data[-1].write_object( - self, self.record_qty.value, self.akey_size.value, - self.dkey_size.value, self.data_size.value, rank, obj_class, - self.data_array_size.value) - - @fail_on(DaosTestError) def write_objects(self, rank=None, obj_class=None): """Write objects to the container. @@ -671,7 +646,6 @@ def write_objects(self, rank=None, obj_class=None): self.dkey_size.value, self.data_size.value, rank, obj_class, self.data_array_size.value) - @fail_on(DaosTestError) def read_objects(self, txn=None): """Read the objects from the container and verify they match. @@ -981,26 +955,6 @@ def get_prop(self, *args, **kwargs): return self.daos.container_get_prop( pool=self.pool.identifier, cont=self.identifier, *args, **kwargs) - def get_prop_values(self, *args, **kwargs): - """Get container property values by calling daos container get-prop. - - Args: - args (tuple, optional): positional arguments to DaosCommand.container_get_prop - kwargs (dict, optional): named arguments to DaosCommand.container_get_prop - - Returns: - list: a list of values matching the or specified property names. - - """ - values = [] - self.log.info("Getting property values for container %s", self) - data = self.get_prop(*args, **kwargs) - if data['status'] != 0: - return values - for entry in data['response']: - values.append(entry['value']) - return values - def verify_prop(self, expected_props): """Verify daos container get-prop returns expected values. diff --git a/src/tests/ftest/util/test_utils_pool.py b/src/tests/ftest/util/test_utils_pool.py index 2b4b14f427f..8e42ff73901 100644 --- a/src/tests/ftest/util/test_utils_pool.py +++ b/src/tests/ftest/util/test_utils_pool.py @@ -639,29 +639,6 @@ def get_prop(self, *args, **kwargs): """ return self.dmg.pool_get_prop(self.identifier, *args, **kwargs) - def get_prop_values(self, *args, **kwargs): - """Get pool property values from the dmg pool get-prop json output. - - Args: - args (tuple, optional): positional arguments to DmgCommand.pool_get_prop - kwargs (dict, optional): named arguments to DmgCommand.pool_get_prop - - Raises: - TestFailure: if there is an error running dmg pool get-prop - - Returns: - list: a list of values matching the or specified property names. - - """ - values = [] - self.log.info("Getting property values for %s", self) - data = self.get_prop(*args, **kwargs) - if data['status'] != 0: - return values - for entry in data['response']: - values.append(entry['value']) - return values - @fail_on(CommandFailure) def get_property(self, prop_name): """Get the pool property with the specified name.