openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
156 stars 131 forks source link

DMTF: Redfish Conformance-Check ---> Assertion: 6.4.24 #69

Closed maximyep closed 1 year ago

maximyep commented 5 years ago

Description: 6.4.24 If a property in the request can never be updated, such as when a property is read only, a status code of 200 shall be returned along with a representation of the resource containing an annotation specifying the non-updatable property. In this success case, other properties may be updated in the resource.

Steps to reproduce:

curl -X PATCH -k -H 'Authorization: Basic cm9vdDowcGVuQm1j' -i 'https://192.168.122.52/redfish/v1/Registries/Base' --data '{'\''Id'\'': '\''PatchName'\''}'

Actual: 200 Ok
Expected: 405 + "Method Not Allowed"
Payload returns: nothing. In python(debug): value is b''; assertion is thrown: expected byte, not str

List of the BAD links:

Or: Download https://github.com/DMTF/Redfish-Service-Conformance-Check Update the properties.json with:

  "RedfishServiceCheckTool_SUTConfiguration": {
    "SUTs": [
        {
        "Password": "0penBmc",
        "LoginName": "root",
        "AllowAction_LogServiceClearLog": "yes",
        "DnsName": "192.168.122.52:443",
        "DisplayName": "Bmc",
        "RedfishVersion": "v1",
        "NumUrisToCache": "25",
    "UseHttp": "no"
      }

Update the rfs_test/TEST_protocol_details.py with needed test to run

 def run(self, log):
     assertion_status = Assertion_6_4_24(self, log)
     exit(0)

Start a test: python3 sample_run.py

edtanous commented 5 years ago

Please test this commit and see if it resolves your issue: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/19652

maximyep commented 5 years ago

Checked with own black-build (with fix):

  1. If we are talking about:

    >>>    /redfish/v1/Registries/Base
    >>>    /redfish/v1/Registries/OpenBMC

    The behavior is changed: "Method Not Allowed" is correctly returned. Fix accepted (only this two was originally mentioned)

  2. If we are talking about full - run: errors are present. Please take a look into logs: full.execution.log.black.build.txt

Python code: python-6-4-24-sample-code.txt

edtanous commented 5 years ago

The behavior you mentioned seems to be resolved, so I think this can be closed once that commit is merged. If we're tracking the overall conformance suite, we should track it for this bug.

https://github.com/openbmc/bmcweb/issues/65

maximyep commented 5 years ago

Agree