def start_rebuild(self, ranks, daos_log): """Kill/Stop the specific server ranks using this pool. Args: ranks (list): a list of daos server ranks (int) to kill daos_log (DaosLog): object for logging messages Returns: bool: True if the server ranks have been killed/stopped and the ranks have been excluded from the pool; False otherwise. """ status = False msg = "Killing DAOS ranks {} from server group {}".format( ranks, self.name.value) self.log.info(msg) daos_log.info(msg) if self.control_method.value == self.USE_DMG and self.dmg: # Stop desired ranks using dmg self.dmg.system_stop(ranks=convert_list(value=ranks)) status = True elif self.control_method.value == self.USE_DMG: self.log.error("Error: Undefined dmg command") else: self.log.error("Error: Unsupported control_method: %s", self.control_method.value) return status
def test_macsio(self): """JIRA ID: DAOS-3658. Test Description: Purpose of this test is to check basic functionality for DAOS, MPICH, HDF5, and MACSio. Use case: Six clients and two servers. :avocado: tags=all,daily_regression :avocado: tags=hw,large :avocado: tags=io,DAOS_5610,dfuse :avocado: tags=macsio """ # Create a pool self.add_pool() self.pool.display_pool_daos_space() # Create a container self.add_container(self.pool) # Run macsio self.log.info("Running MACSio") status = self.macsio.check_results( self.run_macsio(self.pool.uuid, convert_list(self.pool.svc_ranks), self.container.uuid), self.hostlist_clients) if status: self.log.info("Test passed")
def test_macsio_daos_vol(self): """JIRA ID: DAOS-4983. Test Description: Purpose of this test is to check basic functionality for DAOS, MPICH, HDF5, and MACSio with DAOS VOL connector. Use case: Six clients and two servers. :avocado: tags=all,daily_regression :avocado: tags=hw,large :avocado: tags=io,macsio_daos_vol :avocado: tags=DAOS_5610 """ plugin_path = self.params.get("plugin_path") # Create a pool self.add_pool() self.pool.display_pool_daos_space() # Create a container self.add_container(self.pool) # Create dfuse mount point self.start_dfuse(self.hostlist_clients, self.pool, self.container) # VOL needs to run from a file system that supports xattr. Currently # nfs does not have this attribute so it was recommended to create and # use a dfuse dir and run vol tests from there. self.job_manager.working_dir.value = self.dfuse.mount_dir.value # Run macsio self.log.info("Running MACSio with DAOS VOL connector") status = self.macsio.check_results( self.run_macsio( self.pool.uuid, convert_list(self.pool.svc_ranks), self.container.uuid, plugin_path), self.hostlist_clients) if status: self.log.info("Test passed")
def stop_ranks(self, ranks, daos_log, force=False): """Kill/Stop the specific server ranks using this pool. Args: ranks (list): a list of daos server ranks (int) to kill daos_log (DaosLog): object for logging messages force (bool, optional): whether to use --force option to dmg system stop. Defaults to False. Raises: avocado.core.exceptions.TestFail: if there is an issue stopping the server ranks. """ msg = "Stopping DAOS ranks {} from server group {}".format( ranks, self.get_config_value("name")) self.log.info(msg) daos_log.info(msg) # Stop desired ranks using dmg self.dmg.system_stop(ranks=convert_list(value=ranks), force=force) # Update the expected status of the stopped/excluded ranks self.update_expected_states(ranks, ["stopped", "excluded"])
def test_object_query(self): """ JIRA ID: DAOS-4694 Test Description: Test daos object query. :avocado: tags=all,container,hw,small,full_regression,daos_object_query """ daos_cmd = DaosCommand(self.bin) errors = [] # Create a pool and a container. self.add_pool() self.add_container(self.pool) self.pool.connect() self.container.open(pool_handle=self.pool.pool.handle.value) # Prepare to write object. self.container.data_size.update(100) # Write 1 object. self.container.object_qty.update(1) # Record quantity is the number of times we write the object. self.container.record_qty.update(1) # These determine the size of the keys. Use the frequently used values. self.container.akey_size.update(4) self.container.dkey_size.update(4) # Object class defines the number of replicas, groups, etc. # 202: OC_S4, 214: OC_SX, 220: OC_RP_2G1, 221: OC_PR_2G2 # Other classes and more details are in src/include/daos_obj_class.h obj_classes = [202, 214, 220, 221] expected_replica_ones = { 200: (0, 1), 202: (0, 2), 214: (0, 8), 220: (1, 1), 221: (2, 2) } for obj_class in obj_classes: # Write object. self.container.write_objects(obj_class=obj_class) # Verify oid values. # written_data is a list of TestContainerData, which has DaosObj as # member. This is what we need to obtain oid values. obj = self.container.written_data[-1].obj obj.close() expected_oid_hi = obj.c_oid.hi expected_oid_lo = obj.c_oid.lo self.log.info("oid.hi = %s", expected_oid_hi) self.log.info("oid.lo = %s", expected_oid_lo) oid_concat = "{}.{}".format(expected_oid_hi, expected_oid_lo) kwargs = { "pool": self.pool.uuid, "svc": convert_list(self.pool.svc_ranks), "cont": self.container.uuid, "oid": oid_concat } # Call dmg object query. query_output = daos_cmd.object_query(**kwargs) actual_oid_hi = query_output["oid"][0] actual_oid_lo = query_output["oid"][1] if str(expected_oid_hi) != actual_oid_hi: errors.append( "Unexpected oid.hi! OC = {}; Expected = {}; "\ "Actual = {}".format( obj_class, expected_oid_hi, actual_oid_hi)) if str(expected_oid_lo) != actual_oid_lo: errors.append( "Unexpected oid.lo! OC = {}; Expected = {}; "\ "Actual = {}".format( obj_class, expected_oid_lo, actual_oid_lo)) # Verify replica nums and grp_nr. # For grp_nr, check to see if grp 0 -> grp_nr - 1 exists. e.g., if # grp_nr is 4, we expect to see grp: 0, grp: 1, grp: 2, grp: 3. expected_grps = set( [nr for nr in range(int(query_output["grp_nr"]))]) # For replica nums, check the total number of 1s on the left and # right because the sequence seems to be arbitrary. left = 0 right = 0 obj_groups = query_output["layout"] for obj_group in obj_groups: # Test grp_nr. if int(obj_group["grp"]) not in expected_grps: errors.append( "Unexpected grp sequence! OC = {}; {} is not in "\ "{}".format(obj_class, obj_group["grp"], expected_grps)) else: expected_grps.remove(int(obj_group["grp"])) # Accumulate replica 1s. replica_tuples = obj_group["replica"] for replica_tuple in replica_tuples: left += int(replica_tuple[0]) right += int(replica_tuple[1]) # Test replica's left and right 1 counts are expected. actual_replica_ones = (left, right) if expected_replica_ones[obj_class] != actual_replica_ones: errors.append( "Unexpected replica values! OC = {}; Expected = {}; "\ "Actual = {}".format( obj_class, expected_replica_ones[obj_class], actual_replica_ones)) # Check that we have seen all values in 0 -> grp_nr - 1. if expected_grps: errors.append( "There is grp_nr we haven't seen! OC = {}; {}".format( obj_class, expected_grps)) if errors: self.log.info("--- Error List ---") for error in errors: self.log.info(error) self.fail("Error found!")