コード例 #1
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
コード例 #2
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
コード例 #3
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
コード例 #4
0
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
コード例 #5
0
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
コード例 #6
0
def execute():
    MOUNT_VOL_BASIC_1.execute()
    fio_proc = fio.start_fio(0, 60)
    time.sleep(5)
    out = cli.unmount_array(ARRAYNAME)
    fio.stop_fio(fio_proc)
    return out
コード例 #7
0
def execute():
    clear_result()
    MOUNT_VOL_BASIC_1.execute()
    fio_proc = fio.start_fio(0, 60)
    time.sleep(2)
    out = cli.unmount_ibofos()
    fio.stop_fio(fio_proc)
    return out
コード例 #8
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
コード例 #9
0
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
コード例 #10
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"
コード例 #11
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
コード例 #12
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"
コード例 #13
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)
コード例 #14
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)
コード例 #15
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)
コード例 #16
0
def execute():
    DETACH_DEV_DATA.execute()
    fio_proc = fio.start_fio(0, 30)
    fio.wait_fio(fio_proc)