Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-6865 tests: Providing debug info (#4902) #5288

Merged
merged 2 commits into from
Apr 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions src/client/pydaos/raw/daos_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import os
import inspect
import sys
import time
import enum

from . import daos_cref
Expand Down Expand Up @@ -616,28 +617,43 @@ def __del__(self):
"handle: {1}".format(ret, self.obj_handle))
self.obj_handle = None

def create(self, rank=None, objcls=None):
def __str__(self):
"""Get the string representation of this class."""
# pylint: disable=no-else-return
if self.c_oid:
# Return the object ID if defined
return "{}.{}".format(self.c_oid.hi, self.c_oid.lo)
else:
return self.__repr__()

def create(self, rank=None, objcls=None, seed=None):
"""Create a DAOS object by generating an oid.

Args:
rank (int, optional): server rank. Defaults to None.
objcls (object, optional): the DAOS class for this object specified
as either one of the DAOS object class enumerations or an
enumeration name or value. Defaults to DaosObjClass.OC_RP_XSF.
seed (ctypes.c_uint, optional): seed for the dts_oid_gen function.
Defaults to None which will use seconds since epoch as the seed.

Raises:
DaosApiError: if the object class is invalid

"""
func = self.context.get_function('generate-oid')

# Convert the object class into an valid object class enumeration value
if objcls is None:
obj_cls_int = DaosObjClass.OC_RP_XSF.value
else:
obj_cls_int = get_object_class(objcls).value

func = self.context.get_function('oid_gen')
if seed is None:
seed = ctypes.c_uint(int(time.time()))
self.c_oid = daos_cref.DaosObjId()
self.c_oid.hi = func(seed)

func = self.context.get_function('generate-oid')
ret = func(self.container.coh, ctypes.byref(self.c_oid), 0, obj_cls_int,
0, 0)
if ret != 0:
Expand Down Expand Up @@ -2210,7 +2226,8 @@ def __init__(self, path):
'set-pool-attr': self.libdaos.daos_pool_set_attr,
'stop-service': self.libdaos.daos_pool_stop_svc,
'test-event': self.libdaos.daos_event_test,
'update-obj': self.libdaos.daos_obj_update}
'update-obj': self.libdaos.daos_obj_update,
'oid_gen': self.libtest.dts_oid_gen}

def get_function(self, function):
"""Call a function through the API."""
Expand Down
4 changes: 1 addition & 3 deletions src/tests/ftest/pool/rebuild_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class RebuildTests(TestWithServers):
:avocado: recursive
"""

CANCEL_FOR_TICKET = [["DAOS-6865", "object_qty", 20]]

def run_rebuild_test(self, pool_quantity):
"""Run the rebuild test for the specified number of pools.
Args:
Expand Down Expand Up @@ -130,7 +128,7 @@ def test_simple_rebuild(self):
"""
self.run_rebuild_test(1)

@skipForTicket("DAOS-7050")
@skipForTicket("DAOS-7050, DAOS-7134")
def test_multipool_rebuild(self):
"""JIRA ID: DAOS-XXXX (Rebuild-002).
Test Description:
Expand Down
1 change: 1 addition & 0 deletions src/tests/ftest/pool/rebuild_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ container:
record_qty: 1
ten_records:
record_qty: 10
debug: True
testparams:
ranks: !mux
rank1:
Expand Down
4 changes: 4 additions & 0 deletions src/tests/ftest/util/rebuild_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ def execute_rebuild_test(self, create_container=True):
# Confirm rebuild completes
self.pool.wait_for_rebuild(False, 1)

# Refresh local pool and container
self.pool.check_pool_info()
self.container.check_container_info()

# Verify the excluded rank is no longer used with the objects
self.verify_rank_has_no_objects()

Expand Down
8 changes: 4 additions & 4 deletions src/tests/ftest/util/test_utils_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class TestContainer(TestDaosApiBase):
"""A class for functional testing of DaosContainer objects."""

def __init__(self, pool, cb_handler=None, daos_command=None):
"""Create a TeestContainer object.
"""Create a TestContainer object.

Args:
pool (TestPool): the test pool in which to create the container
Expand Down Expand Up @@ -358,7 +358,7 @@ def create(self, uuid=None, con_in=None, acl_file=None):
self._log_method("daos.container_create", kwargs)
uuid = self.daos.get_output("container_create", **kwargs)[0]

# Populte the empty DaosContainer object with the properties of the
# Populate the empty DaosContainer object with the properties of the
# container created with daos container create.
self.container.uuid = str_to_c_uuid(uuid)
self.container.attached = 1
Expand Down Expand Up @@ -698,7 +698,7 @@ def get_target_rank_lists(self, message=""):
for data in self.written_data:
try:
data.obj.get_layout()
# Convert the list of longs into a list of ints
# Convert the list of longs into a list of integers
target_rank_lists.append(
[int(rank) for rank in data.obj.tgt_rank_list])
except DaosApiError as error:
Expand Down Expand Up @@ -782,7 +782,7 @@ def punch_objects(self, indices):
for record in self.written_data[index].records:
record["punched"] = True

# Retutrn the number of punched objects
# Return the number of punched objects
return count

def punch_records(self, indices, punch_dkey=True):
Expand Down