DMTF/Redfish-Service-Validator

ActionInfo passes even if there is an error

FighterNan opened this issue · 4 comments

Version

8fa8b03 (HEAD -> master, origin/master, origin/HEAD) 2.1.6 versioning

The following two payloads both PASS.

# this is wrong, Parameters shall be an array of objects
{
    "@odata.id": "/redfish/v1/Chassis/fake_chassis/ResetActionInfo",
    "@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
    "Id": "ResetActionInfo",
    "Name": "Reset Action Info",
    "Parameters": {
        "AllowableValues": [
            "PowerCycle"
        ],
        "DataType": "String",
        "Name": "ResetType",
        "Required": true
    }
}

{
    "@odata.id": "/redfish/v1/Chassis/fake_chassis/ResetActionInfo",
    "@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
    "Id": "ResetActionInfo",
    "Name": "Reset Action Info",
    "Parameters": [
        {
            "AllowableValues": [
                "PowerCycle"
            ],
            "DataType": "String",
            "Name": "ResetType",
            "Required": true
        }
    ]
}

Do you get an actual "pass" report for the ActionInfo resource, or is it not present? The tool may be skipping ActionInfo resources (I seem to recall this but haven't looked yet). If that's the case, it's probably time for it to actually check those...

Yes, I confirm they both get green "PASS" sign.

Thanks. We will need to take a look at this, but clearly a bug. I'm concerned as to how this got through the type checking since this is an array of objects vs. a single object. I'll want to make sure that isn't a data type class-level miss...

This is not specific for ActionInfo. Any property that is defined as an array of objects will hit this issue.

I've been peeling some things apart and notice off behavior with propRealType, isCollection = prop.Type.getBaseType() found at line 418 in validateRedfish.py. Depending on the structure of the property in the live payload, it takes different code paths, which I would not expect; I would expect it to behave entirely based on schema definitions and not be affected by payloads from the service.