Example #1
0
def test_node_disk_module_actuator(agrs):
    check_sspl_ll_is_running()
    instance_id = "*"
    resource_type = "node:fru:disk"
    send_node_controller_message_request(UUID, "NDHW:%s" % resource_type,
                                         instance_id)
    ingressMsg = get_fru_response(resource_type, instance_id)

    assert (ingressMsg.get("sspl_ll_msg_header").get("uuid") == UUID)

    disk_actuator_msg = ingressMsg.get("actuator_response_type")
    assert (disk_actuator_msg is not None)
    assert (disk_actuator_msg.get("alert_type") is not None)
    assert (disk_actuator_msg.get("severity") is not None)
    assert (disk_actuator_msg.get("host_id") is not None)
    assert (disk_actuator_msg.get("info") is not None)
    assert (disk_actuator_msg.get("instance_id") == instance_id)

    disk_actuator_info = disk_actuator_msg.get("info")
    assert (disk_actuator_info.get("site_id") is not None)
    assert (disk_actuator_info.get("node_id") is not None)
    assert (disk_actuator_info.get("rack_id") is not None)
    assert (disk_actuator_info.get("resource_type") is not None)
    assert (disk_actuator_info.get("event_time") is not None)
    assert (disk_actuator_info.get("resource_id") is not None)

    disk_specific_infos = disk_actuator_msg.get("specific_info")
    assert (disk_specific_infos is not None)

    if disk_actuator_info.get("resource_id") == "*":
        for disk_specific_info in disk_specific_infos:
            assert (disk_specific_info is not None)
            if disk_specific_info.get("ERROR"):
                # Skip any validation on specific info if ERROR seen on FRU
                continue
            resource_id = disk_specific_info.get("resource_id", "")
            if disk_specific_info.get(resource_id):
                assert (disk_specific_info.get(resource_id).get("ERROR")
                        is not None)
                # Skip any validation on specific info if ERROR seen on sensor
                continue
            sensor_type = [
                k if k.startswith("Sensor Type") else None
                for k in disk_specific_info.keys()
            ][0]
            assert (sensor_type is not None)
            assert (disk_specific_info.get("resource_id") is not None)
            if "States Asserted" in disk_specific_info:
                assert (disk_specific_info.get("States Asserted") is not None)
    else:
        # Skip any validation if ERROR seen on the specifc FRU
        if not disk_specific_infos.get("ERROR"):
            sensor_type = [
                k if k.startswith("Sensor Type") else None
                for k in disk_specific_infos.keys()
            ][0]
            assert (sensor_type is not None)
            assert (disk_specific_infos.get("resource_id") is not None)
            if "States Asserted" in disk_specific_infos:
                assert (disk_specific_infos.get("States Asserted") is not None)
Example #2
0
def test_node_voltage_sensor(agrs):
    check_sspl_ll_is_running()
    instance_id = "*"
    resource_type = "node:sensor:voltage"
    send_node_controller_message_request(UUID, "NDHW:%s" % resource_type, instance_id)
    ingressMsg = get_fru_response(resource_type, instance_id)

    assert(ingressMsg.get("sspl_ll_msg_header").get("uuid") == UUID)
    sensor_msg = ingressMsg.get("actuator_response_type")
    assert(sensor_msg is not None)
    assert(sensor_msg.get("alert_type") is not None)
    assert(sensor_msg.get("severity") is not None)
    assert(sensor_msg.get("host_id") is not None)
    assert(sensor_msg.get("info") is not None)
    assert(sensor_msg.get("instance_id") == instance_id)

    volt_module_info = sensor_msg.get("info")
    assert(volt_module_info.get("site_id") is not None)
    assert(volt_module_info.get("node_id") is not None)
    assert(volt_module_info.get("rack_id") is not None)
    assert(volt_module_info.get("resource_type") is not None)
    assert(volt_module_info.get("event_time") is not None)
    assert(volt_module_info.get("resource_id") is not None)

    fru_specific_infos = sensor_msg.get("specific_info")
    assert(fru_specific_infos is not None)

    for fru_specific_info in fru_specific_infos:
        assert(fru_specific_info is not None)
        if fru_specific_info.get("ERROR"):
            # Skip any validation on specific info if ERROR seen on FRU
            continue
        assert(fru_specific_info.get("resource_id") is not None)
        resource_id = fru_specific_info.get("resource_id")
        if fru_specific_info.get(resource_id):
            assert(fru_specific_info.get(resource_id).get("ERROR") is not None)
            # Skip any validation on specific info if ERROR seen on sensor
            continue
        assert(fru_specific_info.get("sensor_number") is not None)
        assert(fru_specific_info.get("sensor_status") is not None)
        assert(fru_specific_info.get("entity_id_instance") is not None)
        assert(fru_specific_info.get("sensor_reading") is not None)
Example #3
0
def test_node_fan_module_actuator(agrs):
    check_sspl_ll_is_running()
    instance_id = "*"
    resource_type = "node:fru:fan"
    send_node_controller_message_request(UUID, "NDHW:%s" % resource_type,
                                         instance_id)
    ingressMsg = get_fru_response(resource_type, instance_id)

    assert (ingressMsg.get("sspl_ll_msg_header").get("uuid") == UUID)

    fan_module_actuator_msg = ingressMsg.get("actuator_response_type")
    assert (fan_module_actuator_msg is not None)
    assert (fan_module_actuator_msg.get("alert_type") is not None)
    assert (fan_module_actuator_msg.get("severity") is not None)
    assert (fan_module_actuator_msg.get("host_id") is not None)
    assert (fan_module_actuator_msg.get("info") is not None)
    assert (fan_module_actuator_msg.get("instance_id") == instance_id)

    fan_module_info = fan_module_actuator_msg.get("info")
    assert (fan_module_info.get("site_id") is not None)
    assert (fan_module_info.get("node_id") is not None)
    assert (fan_module_info.get("rack_id") is not None)
    assert (fan_module_info.get("resource_type") is not None)
    assert (fan_module_info.get("event_time") is not None)
    assert (fan_module_info.get("resource_id") is not None)

    fan_specific_infos = fan_module_actuator_msg.get("specific_info")
    assert (fan_specific_infos is not None)

    if fan_module_info.get("resource_id") == "*":
        for fan_specific_info in fan_specific_infos:
            assert (fan_specific_info is not None)
            if fan_specific_info.get("ERROR"):
                # Skip any validation on specific info if ERROR seen on FRU
                continue
            resource_id = fan_specific_info.get("resource_id", "")
            if fan_specific_info.get(resource_id):
                assert (fan_specific_info.get(resource_id).get("ERROR")
                        is not None)
                # Skip any validation on specific info if ERROR seen on sensor
                continue
            if "Fan Fail" in resource_id or "Fan Redundancy" in resource_id:
                sensor_type = [
                    k if k.startswith("Sensor Type") else None
                    for k in fan_specific_info.keys()
                ][0]
                assert (sensor_type is not None)
                assert (fan_specific_info.get("resource_id") is not None)
                assert (fan_specific_info.get("States Asserted") is not None)
            else:
                assert (fan_specific_info.get("resource_id") is not None)
                sensor_type = [
                    k if k.startswith("Sensor Type") else None
                    for k in fan_specific_info.keys()
                ][0]
                assert (sensor_type is not None)
                assert (fan_specific_info.get("Sensor Reading") is not None)
                assert (fan_specific_info.get("Status") is not None)
                assert (fan_specific_info.get("Lower Non_Recoverable")
                        is not None)
                assert (fan_specific_info.get("Lower Critical") is not None)
                assert (fan_specific_info.get("Lower Non_Critical")
                        is not None)
                assert (fan_specific_info.get("Upper Non_Critical")
                        is not None)
                assert (fan_specific_info.get("Upper Critical") is not None)
                assert (fan_specific_info.get("Upper Non_Recoverable")
                        is not None)
                assert (fan_specific_info.get("Positive Hysteresis")
                        is not None)
                assert (fan_specific_info.get("Negative Hysteresis")
                        is not None)
                assert (fan_specific_info.get("Assertion Events") is not None)
                assert (fan_specific_info.get("Assertions Enabled")
                        is not None)
                assert (fan_specific_info.get("Deassertions Enabled")
                        is not None)
    else:
        # Skip any validation if ERROR seen on the specifc FRU
        if not fan_specific_infos.get("ERROR"):
            sensor_type = [
                k if k.startswith("Sensor Type") else None
                for k in fan_specific_infos.keys()
            ][0]
            assert (sensor_type is not None)
            assert (fan_specific_infos.get("Sensor Reading") is not None)
            assert (fan_specific_infos.get("Status") is not None)
            assert (fan_specific_infos.get("Lower Non_Recoverable")
                    is not None)
            assert (fan_specific_infos.get("Lower Critical") is not None)
            assert (fan_specific_infos.get("Lower Non_Critical") is not None)
            assert (fan_specific_infos.get("Upper Non_Critical") is not None)
            assert (fan_specific_infos.get("Upper Critical") is not None)
            assert (fan_specific_infos.get("Upper Non_Recoverable")
                    is not None)
            assert (fan_specific_infos.get("Positive Hysteresis") is not None)
            assert (fan_specific_infos.get("Negative Hysteresis") is not None)
            assert (fan_specific_infos.get("Assertion Events") is not None)
            assert (fan_specific_infos.get("Assertions Enabled") is not None)
            assert (fan_specific_infos.get("Deassertions Enabled") is not None)
            assert (fan_specific_infos.get("resource_id") is not None)