def get_file_size(arrayId, fd): out = cli.send_request("wbt mfs_get_file_size --fd " + str(fd) + " --array " + TEST_SETUP_POS.get_arrayname(arrayId)) if json_parser.get_response_code(out) != 0: return -1 else: return json_parser.get_data_code(out)
def get_checkpoint_status(arrayId=0): out = cli.send_request("wbt get_journal_status --array " + TEST_SETUP_POS.get_arrayname(arrayId)) if json_parser.get_response_code(out) != 0: return -1 else: total_info = json_parser.get_data(out) return total_info["journalStatus"]["checkpointStatus"]["status"]
def flush_gcov(): out = cli.send_request("wbt flush_gcov") if json_parser.get_response_code(out) != 0: TEST_LOG.print_err("* Gcov flush failed, check WBT option") elif json_parser.get_data_code(out) != 0: TEST_LOG.print_info("* Gcov flush failed, check gcov option") else: TEST_LOG.print_info("* Flush gcov completed")
def get_log_buffer_size(arrayId=0): out = cli.send_request("wbt get_journal_status --array " + TEST_SETUP_POS.get_arrayname(arrayId)) if json_parser.get_response_code(out) != 0: return -1 else: total_info = json_parser.get_data(out) return total_info["journalStatus"]["logBufferStatus"][ "logBufferSizeInBytes"]
def dump_stripemap(dump_file): if TEST.dump_map == False: return out = cli.send_request("wbt read_stripemap --array " + TEST_SETUP_POS.get_arrayname(arrayId) + " --output " + dump_file) if json_parser.get_response_code(out) != 0: return -1
def dump_log_buffer(arrayId, fd, filesize, dumpfile): out = cli.send_request("wbt mfs_read_file --fd " + str(fd) + " --offset 0 --count " + str(filesize) + " --array " + TEST_SETUP_POS.get_arrayname(arrayId) + " --output " + dumpfile) if json_parser.get_response_code(out) != 0: return -1 return 0
def dump_vsamap(arrayId, volid, dump_file): if TEST.dump_map == False: return volname = TEST_SETUP_POS.get_volname(volid) out = cli.send_request("wbt read_vsamap --name " + volname + " --array " + TEST_SETUP_POS.get_arrayname(arrayId) + " --output " + dump_file) if json_parser.get_response_code(out) != 0: return -1
def get_fd(filename): filesInfo = "filesInfo.json" out = cli.send_request("wbt mfs_dump_files_list --output " + filesInfo) if json_parser.get_response_code(out) != 0: return -1 fd = -1 with open(filesInfo) as json_file: filesList = json_parser.get_value_from_json(json_file, "filesInfoList") for f in filesList: if f['fileName'] == filename: fd = f['fd'] return fd
def get_file_size(fd): out = cli.send_request("wbt mfs_get_file_size --fd " + str(fd)) if json_parser.get_response_code(out) != 0: return -1 else: return json_parser.get_data_code(out)