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
예제 #2
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
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
예제 #4
0
def execute():
    MOUNT_VOL_BASIC_1.execute()
    fio_proc = fio.start_fio(0, 60)
    fio.wait_fio(fio_proc)
    api.detach_ssd(DETACH_TARGET_DEV)

    if api.wait_situation(ARRAYNAME, "REBUILDING") is True:
        api.detach_ssd(SECOND_DETACH_TARGET_DEV)
        timeout = 80000  #80s
        if api.wait_situation(ARRAYNAME, "DEGRADED", timeout) is True:
            return "pass"
    return "fail"
예제 #5
0
def execute():
    MOUNT_VOL_BASIC_1.execute()
    fio_proc = fio.start_fio(0, 200)
    time.sleep(10)
    pos_util.pci_detach_and_attach(DETACH_TARGET_DEV)
    detach_dev_timeout = 80
    time.sleep(detach_dev_timeout)
    print(cli.list_device())
    spare_dev_newly_attached = "unvme-ns-4"
    result = cli.add_device(spare_dev_newly_attached, ARRAYNAME)
    code = json_parser.get_response_code(result)
    if code == 0:
        print("device added successfully")
        rebuild_trigger_timeout = 100
        rebuild_started = False
        for i in range(rebuild_trigger_timeout):
            out = cli.array_info(ARRAYNAME)
            situ = json_parser.get_situation(out)
            if situ.find("REBUILD") >= 0:
                print("rebuilding started")
                rebuild_duration = 5
                time.sleep(rebuild_duration)
                rebuild_started = True
                break
            time.sleep(1)

        if rebuild_started == False:
            fio.stop_fio(fio_proc)
            return False

        pos_util.pci_detach_and_attach(MOUNT_VOL_BASIC_1.SPARE)
        #waiting for rebuild stopped
        print("Waiting for rebuild stopped")
        rebuild_stop_delay = 60
        time.sleep(rebuild_stop_delay)

        rebuild_started = False
        while True:
            out = cli.array_info(ARRAYNAME)
            situ = json_parser.get_situation(out)
            if situ.find("REBUILD") == -1 and rebuild_started == True:
                print("2nd rebuilding done")
                fio.wait_fio(fio_proc)
                return True
            elif rebuild_started == False and situ.find("REBUILD") >= 0:
                print("2nd rebuilding started")
                rebuild_started = True
            time.sleep(1)
    else:
        print("device added failure")
        fio.stop_fio(fio_proc)
        return False
예제 #6
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)
예제 #7
0
def execute():
    MOUNT_VOL_BASIC_1.execute()
    fio_proc = fio.start_fio(0, 120)
    time.sleep(10)
    pos_util.pci_detach(DETACH_TARGET_DEV)
    time.sleep(0.1)
    rebuild_started = False
    while True:
        out = cli.array_info(ARRAYNAME)
        situ = json_parser.get_situation(out)
        if situ.find("REBUILD") == -1 and rebuild_started == True:
            print("rebuilding done")
            fio.wait_fio(fio_proc)
            break
        elif rebuild_started == False and situ.find("REBUILD") >= 0:
            print("rebuilding started")
            rebuild_started = True
        time.sleep(1)
예제 #8
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
예제 #9
0
def execute():
    MOUNT_VOL_BASIC_1.execute()
    fio_proc = fio.start_fio(0, 20)
    fio.wait_fio(fio_proc)
    pos_util.pci_detach(DETACH_TARGET_DEV)
    time.sleep(5)
    
    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.array_info(ARRAYNAME)
        situ = json_parser.get_situation(out)
        if situ.find("REBUILD") >= 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.array_info(ARRAYNAME)
            situ = json_parser.get_situation(out)
            if situ.find("REBUILD") == -1:
                print ("rebuilding done")
                fio.wait_fio(fio_proc2)
                break
예제 #10
0
def execute():
    MOUNT_VOL_BASIC_1.execute()
    fio_proc = fio.start_fio(0, 60)
    fio.wait_fio(fio_proc)
    pos_util.pci_detach(DETACH_TARGET_DEV)
    time.sleep(0.1)

    while True:
        out = cli.array_info(ARRAYNAME)
        situ = json_parser.get_situation(out)
        if situ.find("REBUILD") >= 0:
            print("rebuilding started")
            pos_util.pci_detach_and_attach(SECOND_DETACH_TARGET_DEV)
            break
        time.sleep(1)

    timeout = 80
    for i in range(timeout):
        out = cli.array_info(ARRAYNAME)
        situ = json_parser.get_situation(out)
        if situ.find("REBUILD") < 0:
            break
        time.sleep(1)
예제 #11
0
def execute():
    MOUNT_VOL_NO_SPARE.execute()
    fio_proc = fio.start_fio(0, 30)
    fio.wait_fio(fio_proc)
    fio_proc = fio.start_fio(0, 30)
    api.detach_ssd_and_attach(DETACH_TARGET_DEV)
    code = -1
    while code != 0:
            out = cli.add_device(FIRST_SPARE, ARRAYNAME)
            code = json_parser.get_response_code(out)
            print ("add spare response: " + str(code))
    print("spare added")
    cli.add_device(SECOND_SPARE, ARRAYNAME)

    if api.wait_situation(ARRAYNAME, "REBUILDING") is True:
        print("1st rebuilding")
        api.detach_ssd(FIRST_SPARE)
        timeout = 80000 #80s
        if api.wait_situation(ARRAYNAME, "DEGRADED", timeout) is True:
            print("1st rebuilding stopped")
            if api.wait_situation(ARRAYNAME, "REBUILDING", timeout) is True:
                print("2nd rebuilding")
                return "pass"
    return "fail"
def execute():
    DETACH_DEV_DATA.execute()
    fio_proc = fio.start_fio(0, 30)
    fio.wait_fio(fio_proc)
        data = json.loads(out)
        for item in data['Response']['result']['data']['devicelist']:
            if item['name'] == DETACH_TARGET_DEV:
                return "fail", out
        return "pass", out
    return "fail", out


def set_result():
    result, out = check_result()
    code = json_parser.get_response_code(out)

    with open(__file__ + ".result", "w") as result_file:
        result_file.write(result + " (" + str(code) + ")" + "\n" + out)


def execute():
    MOUNT_VOL_NO_SPARE.execute()
    fio_proc = fio.start_fio(0, 30)
    time.sleep(1)
    pos_util.pci_detach(DETACH_TARGET_DEV)
    time.sleep(1)
    return fio_proc


if __name__ == "__main__":
    fio_proc = execute()
    fio.wait_fio(fio_proc)
    set_result()
    pos.kill_pos()
    pos_util.pci_rescan()