def setup(): global CONTAINER_LIST, OM, SCM, DATANODES Blockade.blockade_destroy() CONTAINER_LIST = ClusterUtils.cluster_setup(FILE, SCALE) exit_code, output = Blockade.blockade_status() assert exit_code == 0, "blockade status command failed with output=[%s]" % \ output OM, SCM, _, DATANODES = \ ClusterUtils.find_om_scm_client_datanodes(CONTAINER_LIST) exit_code, output = ClusterUtils.run_freon(FILE, 1, 1, 1, 10240, "RATIS", "THREE") assert exit_code == 0, "freon run failed with output=[%s]" % output
def make_flaky(cls, flaky_node, container_list): # make the network flaky om, scm, _, datanodes = \ ClusterUtils.find_om_scm_client_datanodes(container_list) node_dict = { "all": "--all", "scm": scm[0], "om": om[0], "datanode": random.choice(datanodes) }[flaky_node] logger.info("flaky node: %s", node_dict) output = call(["blockade", "flaky", node_dict]) assert output == 0, "flaky command failed with exit code=[%s]" % output
def setup(): global CONTAINER_LIST, OM, SCM, DATANODES, CLIENT, ORIG_CHECKSUM, \ TEST_VOLUME_NAME, TEST_BUCKET_NAME epoch_time = int(time.time()) TEST_VOLUME_NAME = "%s%s" % ("volume", epoch_time) TEST_BUCKET_NAME = "%s%s" % ("bucket", epoch_time) Blockade.blockade_destroy() CONTAINER_LIST = ClusterUtils.cluster_setup(FILE, SCALE) exit_code, output = Blockade.blockade_status() assert exit_code == 0, "blockade status command failed with output=[%s]" % \ output OM, SCM, CLIENT, DATANODES = \ ClusterUtils.find_om_scm_client_datanodes(CONTAINER_LIST) exit_code, output = ClusterUtils.run_freon(FILE, 1, 1, 1, 10240, "RATIS", "THREE", "ozone_client") assert exit_code == 0, "freon run failed with output=[%s]" % output ClusterUtils.create_volume(FILE, TEST_VOLUME_NAME) ClusterUtils.create_bucket(FILE, TEST_BUCKET_NAME, TEST_VOLUME_NAME) ORIG_CHECKSUM = ClusterUtils.find_checksum(FILE, "/etc/passwd")