def FIO_4G_SR_Storage_Down_Perf(): # pre_case, post_case, pre_loop and post_loop definition tc_logger.info("Defining pre_case, post_case, pre_loop and post_loop inside of test case") test_conf["ud_pre_case"] = ud_pre_case_string test_conf["ud_post_case"] = ud_post_case_string test_conf["ud_pre_loop"] = ud_pre_loop_string test_conf["ud_post_loop"] = ud_post_loop_string # loops configration test_conf["sub_jobs"] = _sub_jobs test_conf["file_size"] = _file_size[1] _loops = int(device.auto_calculate_loops()[1][0]) # main function set_up(level='case') func = tc_run_fio_by_loops.__wrapped__ func(iodepth=32, rw="read", block_size="512k", runtime=600, rewrite="false", loops=_loops) # performance result verification benchmark_item = get_benchmark_item(_get_perf_bm_filename(), ["FIO", "FIO_4G_Storage_Down_Perf"]) tc_logger.info("Benchmark is as below") tc_logger.info(str(benchmark_item)) result_file = os.path.join(test_conf["result_home"], "fio_rpt.csv") result = 0 # SeqRead verification values = get_column_from_csv(result_file, "Read (MB/s)") values = values[:-1] checkpoints = ["Sequential Read(MB/s)" + " - " + str(i+1) for i in range(len(values))] result = assert_values_meet_benchmark(values, benchmark_item["SR"], False, "dc.yaml", checkpoints, True) | result return result
def tc2_IOZone_basic_Rand_3times(): # pre_case, post_case, pre_loop and post_loop definition tc_logger.info( "Defining pre_case, post_case, pre_loop and post_loop inside of test case" ) test_conf["ud_pre_case"] = ud_pre_case_string test_conf["ud_post_case"] = ud_post_case_string test_conf["ud_pre_loop"] = ud_pre_loop_string test_conf["ud_post_loop"] = ud_post_loop_string # main function set_up(level='case') func = tc_run_iozone_by_loops.__wrapped__ func(threads=8, file_size="128m", block_size="4k", sequential=False, loops=3) # performance result verification benchmark_item = get_benchmark_item(_get_basic_perf_bm_filename(), ["IOZone", "basic"]) tc_logger.info("Benchmark is as below") tc_logger.info(str(benchmark_item)) result_file = os.path.join(test_conf["result_home"], "iozone_result.csv") result = 0 # Random Read verification checkpoints_prefix = "Random readers(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["RR"], False, "dc.yaml", checkpoints, True) | result # Random Reread verification checkpoints_prefix = "Random writers(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["RW"], False, "dc.yaml", checkpoints, True) | result # return result return result
def tc2_FIO_basic_RandRW73_3times(): # pre_case, post_case, pre_loop and post_loop definition tc_logger.info( "Defining pre_case, post_case, pre_loop and post_loop inside of test case" ) test_conf["ud_pre_case"] = ud_pre_case_string test_conf["ud_post_case"] = ud_post_case_string test_conf["ud_pre_loop"] = ud_pre_loop_string test_conf["ud_post_loop"] = ud_post_loop_string # main function set_up(level='case') func = tc_run_fio_by_loops.__wrapped__ func(iodepth=32, rw="randrw", rwmixread="70", block_size="4k", file_size="1g", runtime=600, loops=3) # performance result verification benchmark_item = get_benchmark_item(_get_basic_perf_bm_filename(), ["FIO", "basic_randrw73"]) tc_logger.info("Benchmark is as below") tc_logger.info(str(benchmark_item)) result_file = os.path.join(test_conf["result_home"], "fio_rpt.csv") result = 0 # Read verification values = get_column_from_csv(result_file, "Read (MB/s)") values = values[-1:] + values[:-1] checkpoints = [ "Random Read(MB/s)" + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, "Random Read(MB/s)" + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["RR"], False, "dc.yaml", checkpoints, True) | result # Read verification values = get_column_from_csv(result_file, "Write (MB/s)") values = values[-1:] + values[:-1] checkpoints = [ "Random Write(MB/s)" + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, "Random Write(MB/s)" + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["RW"], False, "dc.yaml", checkpoints, True) | result # return result return result
def stress_statistics_validation(statistics_file, statistics_column, benchmark_file, benchmark_group, checkpoint_prefix): statistics_results = get_column_from_csv(statistics_file, statistics_column) statistics_results.pop(2) statistics_results.pop(0) benchmark_group_content = get_benchmark_item(benchmark_file, benchmark_group) statistics_index = ["mean", "min", "percent_1", "percent_10", "percent_25", "percent_50", "percent_75", "percent_90", "percent_99", "max"] checkpoints = [checkpoint_prefix + " - " + x for x in statistics_index] validation_result = 0 for i in range(0, len(statistics_index)): result = [statistics_results[i]] benchmark_item = benchmark_group_content[statistics_index[i]] checkpoint = [checkpoints[i]] validation_result = assert_values_meet_benchmark(result, benchmark_item, False, "dc.yaml", checkpoint) | validation_result return validation_result
def FIO_4G_Restore_No_enough_SW_3times(): # pre_case, post_case, pre_loop and post_loop definition tc_logger.info( "Defining pre_case, post_case, pre_loop and post_loop inside of test case" ) test_conf["ud_pre_case"] = ud_pre_case_string test_conf["ud_post_case"] = ud_post_case_string test_conf["ud_pre_loop"] = ud_pre_loop_string test_conf["ud_post_loop"] = ud_post_loop_string # main function set_up(level='case') func = tc_run_fio_by_loops.__wrapped__ func(iodepth=32, sub_jobs=4, rw="write", rewrite="false", block_size="512k", file_size="1g", runtime=600, loops=3) # performance result verification benchmark_item = get_benchmark_item(_get_basic_perf_bm_filename(), ["FIO", "FIO_4G_Restore_No_enough"]) tc_logger.info("Benchmark is as below") tc_logger.info(str(benchmark_item)) result_file = os.path.join(test_conf["result_home"], "fio_rpt.csv") result = 0 # SeqWrite verification values = get_column_from_csv(result_file, "Write (MB/s)") values = values[-1:] + values[:-1] checkpoints = [ "Sequential Write(MB/s)" + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, "Sequential Write(MB/s)" + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["SW"], False, "dc.yaml", checkpoints, True) | result return result
def tc2_AB_default_3times(): # pre_case, post_case, pre_loop and post_loop definition tc_logger.info( "Defining pre_case, post_case, pre_loop and post_loop inside of test case" ) test_conf["ud_pre_case"] = ud_pre_case_string test_conf["ud_post_case"] = ud_post_case_string test_conf["ud_pre_loop"] = ud_pre_loop_string test_conf["ud_post_loop"] = ud_post_loop_string # main function set_up(level='case') # tc_run_micro_by_loops(loops=3) func = tc_run_micro_by_loops.__wrapped__ func(loops=3) # performance result verification benchmark_item = get_benchmark_item(_get_basic_perf_bm_filename(), ["AB", "default"]) tc_logger.info("Benchmark is as below") tc_logger.info(str(benchmark_item)) result_file = os.path.join(test_conf["result_home"], "androbench_result.csv") result = 0 # SR verification checkpoints_prefix = "Sequential Read(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["SR"], False, "dc.yaml", checkpoints, True) | result # SW verification checkpoints_prefix = "Sequential Write(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["SW"], False, "dc.yaml", checkpoints, True) | result # RR verification checkpoints_prefix = "Random Read(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["RR"], False, "dc.yaml", checkpoints, True) | result # RW verification checkpoints_prefix = "Random Write(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["RW"], False, "dc.yaml", checkpoints, True) | result # return result return result
def IOzone_Seq_4G_Restore_No_enough_3times(): # pre_case, post_case, pre_loop and post_loop definition tc_logger.info( "Defining pre_case, post_case, pre_loop and post_loop inside of test case" ) ud_pre_loop_string.extend([ "file_for_assistant_test:rw=write@bs=512k@size=4g@runtime=600@fio_fg=True", "wb_avail_buf_restore_loop_check_no_enough" ]) ud_post_loop_string.remove("wb_avail_buf_restore_loop_check_no_enough") test_conf["ud_pre_case"] = ud_pre_case_string test_conf["ud_post_case"] = ud_post_case_string test_conf["ud_pre_loop"] = ud_pre_loop_string test_conf["ud_post_loop"] = ud_post_loop_string # main function set_up(level='case') func = tc_run_iozone_by_loops.__wrapped__ func(threads=4, file_size="1024m", block_size="512k", sequential=True, loops=3) # performance result verification benchmark_item = get_benchmark_item( _get_basic_perf_bm_filename(), ["IOZone", "IOzone_Seq_4G_Restore_No_enough"]) tc_logger.info("Benchmark is as below") tc_logger.info(str(benchmark_item)) result_file = os.path.join(test_conf["result_home"], "iozone_result.csv") result = 0 # Initial Write verification checkpoints_prefix = "Initial Writers(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["SW_Initial"], False, "dc.yaml", checkpoints, True) | result # Rewrite verification checkpoints_prefix = "Rewriters(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark( values, benchmark_item["SW_Rewriters"], False, "dc.yaml", checkpoints, True) | result # Read verification checkpoints_prefix = "Readers(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark(values, benchmark_item["SR_Readers"], False, "dc.yaml", checkpoints, True) | result # Reread verification checkpoints_prefix = "Re-readers(MB/s)" values = get_column_from_csv(result_file, checkpoints_prefix) values = values[-1:] + values[:-1] checkpoints = [ checkpoints_prefix + " - " + str(i) for i in range(1, len(values)) ] checkpoints.insert(0, checkpoints_prefix + " - avg") result = assert_values_meet_benchmark( values, benchmark_item["SR_Re-readers"], False, "dc.yaml", checkpoints, True) | result return result