Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested enhancements and fixes #122

Closed
kcli opened this issue Jun 20, 2018 · 2 comments
Closed

Suggested enhancements and fixes #122

kcli opened this issue Jun 20, 2018 · 2 comments

Comments

@kcli
Copy link
Contributor

kcli commented Jun 20, 2018

Hi,

While running this tools, we discovered some enhancements and fixes. Attached is the file containing the changes we made. Please review and comment.
diff.log

Here are some of the explanations about the changes:

  1. Enhancement - ssl.PROTOCOL_TLS is hardcoded based on the version of Python. For our implementation, we need to use PROTOCOL_TLSv1_2 instead of PROTOCOL_TLSv1. Is it possible this can be configure in properties.json?
    diff --git a/rf_utility.py b/rf_utility.py
    index e4df442..fc65981 100644
    --- a/rf_utility.py
    +++ b/rf_utility.py
    @@ -124,7 +124,7 @@ def Connect_Server_NoSSL(sut_prop, host_ip_addr) :
    elif (Python3 == True) :
    #if 3.4.2
    if (sys.version_info.major == 3 and sys.version_info.minor == 4 and sys.version_info.micro <= 3) :
  •        cont=ssl.SSLContext(ssl.PROTOCOL_TLSv1)
    
  •        cont=ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
           cont.verify_mode = ssl.CERT_NONE
           try:
               svr_conn = HTTPSConnection(host=host_ip_addr, context=cont)
    
  1. Enhancement - We have a password rule that is different from the password used in this test. Is it possible this can be configurable?
    diff --git a/rfs_test/TEST_protocol_details.py b/rfs_test/TEST_protocol_details.py
    index 8eb449e..c1bfefc 100644
    --- a/rfs_test/TEST_protocol_details.py
    +++ b/rfs_test/TEST_protocol_details.py
    @@ -368,7 +368,7 @@ def Assertion_6_1_8_3(self, log) :
    account_url = json_payload['@odata.id']
    patch_key = 'RoleId'
    patch_value = 'Operator'
  •                    rq_body = {'UserName': user_name, 'Password': '12345' , 'RoleId' : patch_value}
    
  •                    rq_body = {'UserName': user_name, 'Password': '12345678' , 'RoleId' : patch_value}
                       rq_headers['Content-Type'] = rf_utility.content_type['json']
                       json_payload_, headers_, status_ = self.http_PATCH(account_url, rq_headers, rq_body, authorization)
                       assertion_status_ = self.response_status_check(account_url, status_, log, request_type = 'PATCH')
    
  1. Fix - Missing argument (schema_fle) in log.assertion_log
    @@ -1646,7 +1646,7 @@ def Assertion_6_4_24(self, log) :
    #check if resource remain unchanged, else FAIL. The object might have changed by another source changing the etag, so, in this case, checking value of property makes more sense than etags
    if (json_payload[prop] == 'PatchName'):
    assertion_status = log.FAIL
  •                                                        log.assertion_log('line', "~ PATCH on Property %s of resource %s is a Read-only property according to its schema document %s, which might have been updated unexpectedly" % (prop, relative_uris[relative_uri]) )
    
  •                                                        log.assertion_log('line', "~ PATCH on Property %s of resource %s is a Read-only property according to its schema document %s, which might have been updated unexpectedly" % (prop, relative_uris[relative_uri], schema_file) )
    

@@ -5078,7 +5098,7 @@ def Assertion_6_4_24_xml(self, log) :
#check if resource remain unchanged, else FAIL. The object might have changed by another source changing the etag, so, in this case, checking value of property makes more sense than etags
if (json_payload[property.Name] == 'PatchName'):
assertion_status = log.FAIL

  •                                                                log.assertion_log('line', "~ PATCH on Property %s of resource %s is a Read-only property according to its schema document %s, which might have been updated unexpectedly" % (prop, relative_uris[relative_uri]) )                                                                                         
    
  •                                                                log.assertion_log('line', "~ PATCH on Property %s of resource %s is a Read-only property according to its schema document %s, which might have been updated unexpectedly" % (prop, relative_uris[relative_uri], schema_file) )                                                                                         
    

    log.assertion_log(assertion_status, None)
    return (assertion_status)

  1. Fix
  • Assertion_6_4_25: Header needed to update for each URI.
  • Assertion_6_4_31: Determine target the same way as in Assertion_6_4_32.
  • Assertion_6_5_18: If there is no json payload, the test always failed. Moved the check after checking if there is any json payload.

Thanks,

KC

@kcli
Copy link
Contributor Author

kcli commented Jun 28, 2018

Linda asked me create a branch and push the code for review. But it seems that I don't have the access right to create a branch or fork. Please advise what is the correct procedure to push the code for review.

Thanks.

@kcli
Copy link
Contributor Author

kcli commented Jul 2, 2018

I have created a fork (https://github.com/kcli/Redfish-Service-Conformance-Check) and pushed the changes there for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant