Skip to content

Commit

Permalink
Merge pull request #55 from DMTF/Query-Expand-Links-Fix
Browse files Browse the repository at this point in the history
Corrected expand links query parameter
  • Loading branch information
mraineri authored Oct 22, 2021
2 parents 3c743f0 + 00535ac commit be201bd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions query_parameters/query_parameters_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ def expand_test( redfish_obj, service_root, results ):
"""

expand_checks = [
{ "Term": "ExpandAll", "Query": { "$expand": "*" }, "Sub": True, "Links": True },
{ "Term": "NoLinks", "Query": { "$expand": "." }, "Sub": True, "Links": False },
{ "Term": "Links", "Query": { "$expand": "!" }, "Sub": False, "Links": True },
{ "Term": "ExpandAll", "Query": { "$expand": "*($levels=1)" }, "Sub": True, "Links": True },
{ "Term": "NoLinks", "Query": { "$expand": ".($levels=1)" }, "Sub": True, "Links": False },
{ "Term": "Links", "Query": { "$expand": "~($levels=1)" }, "Sub": False, "Links": True }
{ "Term": "ExpandAll", "Query": { "$expand": "*" }, "Sub": True, "Links": True, "Levels": False },
{ "Term": "NoLinks", "Query": { "$expand": "." }, "Sub": True, "Links": False, "Levels": False },
{ "Term": "Links", "Query": { "$expand": "~" }, "Sub": False, "Links": True, "Levels": False },
{ "Term": "ExpandAll", "Query": { "$expand": "*($levels=1)" }, "Sub": True, "Links": True, "Levels": True },
{ "Term": "NoLinks", "Query": { "$expand": ".($levels=1)" }, "Sub": True, "Links": False, "Levels": True },
{ "Term": "Links", "Query": { "$expand": "~($levels=1)" }, "Sub": False, "Links": True, "Levels": True }
]

# Go through each of the different expand types
Expand All @@ -208,6 +208,10 @@ def expand_test( redfish_obj, service_root, results ):
results.update_test_results( "Expand Check", 0, "{} not supported.".format( check["Term"] ), skipped = True )
continue

if not service_root.dict["ProtocolFeaturesSupported"]["ExpandQuery"].get( "Levels", False ) and check["Levels"]:
results.update_test_results( "Expand Check", 0, "Levels not supported on $expand".format( check["Term"] ), skipped = True )
continue

# Perform the query on service root
print( "Performing $expand={} on {}".format( check["Query"]["$expand"], check_uri ) )
expand_response = redfish_obj.get( check_uri, args = check["Query"] )
Expand Down

0 comments on commit be201bd

Please sign in to comment.