Example #1
0
def check_result(detail):
    state = json_parser.get_state(detail)
    capacity = json_parser.get_capacity(detail)
    used = json_parser.get_used(detail)

    if state == "NORMAL" and capacity != 0 and used == 0:
        return "pass"
    return "fail"
def check_result():
    out = cli.array_info(ARRAYNAME)
    state = json_parser.get_state(out)
    if state == "NORMAL":
        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
Example #3
0
def set_result():
    out = cli.array_info(ARRAYNAME)
    code = json_parser.get_response_code(out)
    result = "fail"
    if code == 0:
        state = json_parser.get_state(out)
        capacity = json_parser.get_capacity(out)
        used = json_parser.get_used(out)
        if state == "NORMAL" and capacity != 0 and used != 0 and used <= capacity:
            result = "pass"
    with open(__file__ + ".result", "w") as result_file:
        result_file.write(result + " (" + str(code) + ")" + "\n" + out)
Example #4
0
def get_state():
    out = cli.array_info(ARRAYNAME)
    state = json_parser.get_state(out)
    return state
Example #5
0
def check_result():
    out = cli.array_info(ARRAYNAME)
    state = json_parser.get_state(out)
    if state == "NORMAL":
        return "pass", out
    return "fail", out