Redfish-Service-Validator icon indicating copy to clipboard operation
Redfish-Service-Validator copied to clipboard

ActionInfo passes even if there is an error

Open FighterNan opened this issue 3 years ago • 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
        }
    ]
}

FighterNan avatar Jun 02 '22 20:06 FighterNan

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...

jautor avatar Jun 02 '22 22:06 jautor

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

FighterNan avatar Jun 02 '22 22:06 FighterNan

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...

jautor avatar Jun 03 '22 19:06 jautor

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.

mraineri avatar Jun 15 '22 14:06 mraineri