Exemplo n.º 1
0
def execute():
    clear_result()
    MOUNT_VOL_BASIC_1.execute()
    fio_proc = fio.start_fio(0, 20)
    fio.wait_fio(fio_proc)
    ibofos_util.pci_detach(DETACH_TARGET_DEV)
    time.sleep(0.1)

    fio_proc = fio.start_fio(0, 20)
    fio.wait_fio(fio_proc)

    rebuild_started = False
    wait_threshold = 60
    for i in range(0, wait_threshold):
        out = cli.get_ibofos_info()
        if out.find("REBUILDING") >= 0:
            print("rebuilding started")
            rebuild_started = True
            break
        time.sleep(1)

    if rebuild_started == True:
        fio_proc2 = fio.start_fio(0, 120)
        while True:
            out = cli.get_ibofos_info()
            if out.find("REBUILDING") == -1:
                print("rebuilding done")
                fio.wait_fio(fio_proc2)
                break
Exemplo n.º 2
0
def execute():
    clear_result()
    MOUNT_ARRAY_BASIC_1.execute()
    cli.create_volume("vol1", str(SIZE_20GB), "", "", "")
    cli.create_volume("vol2", str(SIZE_20GB), "", "", "")
    cli.create_volume("vol3", str(SIZE_20GB), "", "", "")
    cli.create_volume("vol4", str(SIZE_20GB), "", "", "")
    cli.create_volume("vol5", str(SIZE_20GB), "", "", "")
    cli.mount_volume("vol1", "", "")
    cli.mount_volume("vol2", "", "")
    cli.mount_volume("vol3", "", "")
    cli.mount_volume("vol4", "", "")
    cli.mount_volume("vol5", "", "")
    print ("five volumes are mounted")
    
    time.sleep(1)
    fio_proc = fio.start_fio(0, 20)
    time.sleep(5)

    ibofos_util.pci_detach(DETACH_TARGET_DEV_1)
    print ("first device has been detached")
    time.sleep(1)

    ibofos_util.pci_detach(DETACH_TARGET_DEV_2)
    print ("second device has been detached")
    time.sleep(1)

    out = cli.get_ibofos_info()
    print ("info : " + out)
    fio.stop_fio(fio_proc)
    return out
def execute():
    clear_result()
    DETACH_DEV_DATA.execute()
    fio_proc = fio.start_fio(0, 60)
    fio.wait_fio(fio_proc)
    out = cli.get_ibofos_info()
    return out
Exemplo n.º 4
0
def set_result(expected):
    detail = cli.get_ibofos_info()
    data = json.loads(detail)
    used = data['Response']['result']['data']['used']
    result = "fail"
    if used != 0 and used == expected:
        result = "pass"
    with open(__file__ + ".result", "w") as result_file:
        result_file.write(result + " (0)" + "\n" + detail)
Exemplo n.º 5
0
def execute():
    clear_result()
    MOUNT_VOL_BASIC_1.execute()
    cli.unmount_ibofos()
    cli.delete_array("")
    cli.create_array("uram0", DATA, SPARE, "", "")
    cli.mount_ibofos()
    out = cli.get_ibofos_info()

    return out
Exemplo n.º 6
0
def set_result(detail):
    out = detail
    code = json_parser.get_response_code(detail)
    result = test_result.expect_true(code)
    if result == "pass":
        out = cli.get_ibofos_info()
        result = check_result(out)
    
    with open(__file__ + ".result", "w") as result_file:
        result_file.write(result + " (" + str(code) + ")" + "\n" + out)
Exemplo n.º 7
0
def execute():
    clear_result()
    DETACH_DEV_DATA_DURING_IO.execute()
    fio_proc = fio.start_fio(0, 60)
    time.sleep(1)
    ibofos_util.pci_detach(DETACH_ANOTHER_TARGET_DEV)
    time.sleep(1)
    out = cli.get_ibofos_info()
    fio.wait_fio(fio_proc)
    return out
Exemplo n.º 8
0
def execute():
    clear_result()
    MOUNT_VOL_BASIC_1.execute()
    out = cli.get_ibofos_info()
    print(out)
    data = json.loads(out)
    used = data['Response']['result']['data']['used']
    cli.unmount_ibofos()
    cli.mount_ibofos()
    return used
Exemplo n.º 9
0
def execute():
    clear_result()
    MOUNT_ARRAY_BASIC_1.execute()
    out = cli.get_ibofos_info()
    data = json.loads(out)
    capacity = data['Response']['info']['capacity']
    print("capa: " + str(capacity))
    size = capacity + ibofos_constant.SIZE_1GB
    out = cli.create_volume("vol1", str(size), "", "", "")
    return out
def execute():
    clear_result()
    MOUNT_VOL_NO_SPARE.execute()
    fio_proc = fio.start_fio(0, 30)
    time.sleep(1)
    ibofos_util.pci_detach(DETACH_TARGET_DEV)
    time.sleep(1)
    out = cli.get_ibofos_info()
    fio.wait_fio(fio_proc)
    return out
Exemplo n.º 11
0
def check_result():
    out = cli.get_ibofos_info()
    data = json.loads(out)
    if data['Response']['info']['situation'] == "NORMAL":
        list = cli.array_info("")
        data = json.loads(list)
        for item in data['Response']['result']['data']['devicelist']:
            if item['name'] == DETACH_TARGET_DEV :
                return "fail", list
        return "pass", out
    return "fail", out
Exemplo n.º 12
0
def set_result():
    detail = cli.get_ibofos_info()
    code = json_parser.get_response_code(detail)
    if code == 0:
        result, out = check_result()
    else:
        result = "fail"
        out = detail

    with open(__file__ + ".result", "w") as result_file:
        result_file.write(result + " (" + str(code) + ")" + "\n" + out)
Exemplo n.º 13
0
def execute():
    clear_result()
    DETACH_DEV_DATA_DEGRADED_IO.execute()
    out = cli.add_device(NEW_SPARE, "")
    rebuild_started = False
    while True:
        out = cli.get_ibofos_info()
        if out.find("REBUILDING") == -1 and rebuild_started == True:
            print ("rebuilding done")
            break
        elif rebuild_started == False and out.find("REBUILDING") >= 0:
            print ("rebuilding started")
            rebuild_started = True
        time.sleep(1)
Exemplo n.º 14
0
def set_result():
    result = "fail"
    timeout = 60

    for i in range(timeout):
        out = cli.get_ibofos_info()
        data = json.loads(out)
        print("situation: " + data['Response']['info']['situation'])

        if data['Response']['info']['situation'] == "REBUILDING":
            result = "pass"
            break
        else:
            time.sleep(1)
            print("waiting for rebuild starting : " + str(i) + "sec")

    with open(__file__ + ".result", "w") as result_file:
        result_file.write(result + "\n" + out)
Exemplo n.º 15
0
def execute():
    clear_result()
    MOUNT_VOL_BASIC_1.execute()
    fio_proc = fio.start_fio(0, 60)
    fio.wait_fio(fio_proc)
    ibofos_util.pci_detach(DETACH_TARGET_DEV)
    time.sleep(0.1)

    rebuild_started = False
    while True:
        out = cli.get_ibofos_info()
        if out.find("REBUILDING") == -1 and rebuild_started == True:
            print("rebuilding done")
            break
        elif rebuild_started == False and out.find("REBUILDING") >= 0:
            print("rebuilding started")
            rebuild_started = True
        time.sleep(1)
Exemplo n.º 16
0
def execute():
    clear_result()
    ibofos.start_ibofos()
    out = cli.get_ibofos_info()
    return out
Exemplo n.º 17
0
def check_result():
    out = cli.get_ibofos_info()
    data = json.loads(out)
    if data['Response']['info']['state'] == "STOP":
        return "pass"
    return "fail"
def set_result():
    out = cli.get_ibofos_info()
    code = json_parser.get_response_code(out)
    result = check_result(out)
    with open(__file__ + ".result", "w") as result_file:
        result_file.write(result + " (" + str(code) + ")" + "\n" + out)
Exemplo n.º 19
0
def get_situation():
    out = cli.get_ibofos_info()
    data = json.loads(out)
    situ = data['Response']['info']['situation']
    return situ
Exemplo n.º 20
0
def get_state():
    out = cli.get_ibofos_info()
    data = json.loads(out)
    state = data['Response']['info']['state']
    return state
Exemplo n.º 21
0
def execute():
    clear_result()
    CREATE_VOL_BASIC_1.execute()
    out = cli.get_ibofos_info()
    return out