redfish-interop-validator 2.2.0__tar.gz → 2.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {redfish_interop_validator-2.2.0/redfish_interop_validator.egg-info → redfish_interop_validator-2.2.2}/PKG-INFO +1 -1
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/RedfishInteropValidator.py +1 -1
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/interop.py +69 -17
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/validateResource.py +4 -1
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2/redfish_interop_validator.egg-info}/PKG-INFO +1 -1
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/setup.py +1 -1
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/AUTHORS.md +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/LICENSE.md +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/README.md +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/RedfishLogo.py +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/__init__.py +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/config.py +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/profile.py +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/redfish.py +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/session.py +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/tohtml.py +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator/traverseInterop.py +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator.egg-info/SOURCES.txt +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator.egg-info/dependency_links.txt +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator.egg-info/entry_points.txt +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator.egg-info/requires.txt +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/redfish_interop_validator.egg-info/top_level.txt +0 -0
- {redfish_interop_validator-2.2.0 → redfish_interop_validator-2.2.2}/setup.cfg +0 -0
|
@@ -17,7 +17,7 @@ import redfish_interop_validator.traverseInterop as traverseInterop
|
|
|
17
17
|
from redfish_interop_validator.profile import getProfiles, checkProfileAgainstSchema, hashProfile
|
|
18
18
|
from redfish_interop_validator.validateResource import validateSingleURI, validateURITree
|
|
19
19
|
|
|
20
|
-
tool_version = '2.2.
|
|
20
|
+
tool_version = '2.2.2'
|
|
21
21
|
|
|
22
22
|
# Set up the custom debug levels
|
|
23
23
|
VERBOSE1 = logging.INFO - 1
|
|
@@ -247,6 +247,7 @@ def validateWriteRequirement(profile_entry, parent_object_payload, resource_head
|
|
|
247
247
|
return msgInterop('WriteRequirement', profile_entry, expected_str, 'Writable' if is_writeable else 'Not Writable',
|
|
248
248
|
testResultEnum.PASS if is_writeable else result_not_supported), True
|
|
249
249
|
|
|
250
|
+
|
|
250
251
|
def checkComparison(val, compareType, target):
|
|
251
252
|
"""
|
|
252
253
|
Validate a given comparison option, given a value and a target set
|
|
@@ -557,7 +558,8 @@ def validatePropertyRequirement(propResourceObj, profile_entry, rf_payload_tuple
|
|
|
557
558
|
# problem: if dne, skip?
|
|
558
559
|
|
|
559
560
|
# Read Requirement is default mandatory if not present
|
|
560
|
-
|
|
561
|
+
requirement_entry = profile_entry.get('ReadRequirement', 'Mandatory')
|
|
562
|
+
msg, requirement_success = validateRequirement(requirement_entry, redfish_value, parent_object_tuple=redfish_parent_payload)
|
|
561
563
|
msgs.append(msg)
|
|
562
564
|
msg.name = item_name + '.' + msg.name
|
|
563
565
|
|
|
@@ -582,7 +584,12 @@ def validatePropertyRequirement(propResourceObj, profile_entry, rf_payload_tuple
|
|
|
582
584
|
# Default to AnyOf
|
|
583
585
|
|
|
584
586
|
my_compare = profile_entry.get("Comparison", "AnyOf")
|
|
585
|
-
|
|
587
|
+
my_values = profile_entry.get("Values", [])
|
|
588
|
+
# If absent and not comparing for absence...
|
|
589
|
+
if redfish_value == REDFISH_ABSENT and my_compare not in ['Absent', 'Present']:
|
|
590
|
+
msg, success = msgInterop('Comparison', my_values, my_compare, REDFISH_ABSENT, testResultEnum.NOT_TESTED), True
|
|
591
|
+
else:
|
|
592
|
+
msg, success = checkComparison(redfish_value, my_compare, my_values)
|
|
586
593
|
msgs.append(msg)
|
|
587
594
|
msg.name = item_name + '.' + msg.name
|
|
588
595
|
|
|
@@ -620,51 +627,96 @@ def validateActionRequirement(profile_entry, rf_payload_tuple, actionname):
|
|
|
620
627
|
my_logger.verbose1('actionRequirement \n\tval: ' + str(rf_payload_item if not isinstance(
|
|
621
628
|
rf_payload_item, dict) else 'dict') + ' ' + str(profile_entry))
|
|
622
629
|
|
|
630
|
+
action_readrequirement = profile_entry.get('ReadRequirement', "Mandatory")
|
|
631
|
+
actioninfo_requirement = profile_entry.get('ActionInfo', "None")
|
|
632
|
+
|
|
623
633
|
if "ReadRequirement" in profile_entry:
|
|
624
634
|
# problem: if dne, skip
|
|
625
|
-
msg, success = validateRequirement(
|
|
635
|
+
msg, success = validateRequirement(action_readrequirement, rf_payload_item)
|
|
626
636
|
msgs.append(msg)
|
|
627
637
|
msg.name = actionname + '.' + msg.name
|
|
628
638
|
msg.success = testResultEnum.PASS if success else testResultEnum.FAIL
|
|
629
|
-
|
|
639
|
+
|
|
630
640
|
propDoesNotExist = (rf_payload_item == REDFISH_ABSENT)
|
|
631
641
|
if propDoesNotExist:
|
|
632
642
|
return msgs, counts
|
|
643
|
+
|
|
633
644
|
if "@Redfish.ActionInfo" in rf_payload_item:
|
|
634
645
|
vallink = rf_payload_item['@Redfish.ActionInfo']
|
|
635
646
|
success, rf_payload_action, code, elapsed, _ = callResourceURI(vallink)
|
|
636
647
|
if not success:
|
|
637
648
|
rf_payload_action = None
|
|
638
649
|
|
|
650
|
+
if 'ActionInfo' in profile_entry and actioninfo_requirement in ["None"]:
|
|
651
|
+
# Create message if None is explicitly listed in the profile
|
|
652
|
+
msg = msgInterop('ActionInfo', 'None', '-', '-', testResultEnum.OK)
|
|
653
|
+
msg.name = actionname + '.' + msg.name
|
|
654
|
+
msgs.append(msg)
|
|
655
|
+
|
|
656
|
+
if actioninfo_requirement not in ["None"]:
|
|
657
|
+
if propDoesNotExist:
|
|
658
|
+
# not tested if action isn't present
|
|
659
|
+
msg = msgInterop('ActionInfo', actioninfo_requirement, '-', '-', testResultEnum.NOT_TESTED)
|
|
660
|
+
|
|
661
|
+
elif actioninfo_requirement == "Mandatory":
|
|
662
|
+
if rf_payload_action is None:
|
|
663
|
+
if "@Redfish.ActionInfo" in rf_payload_item:
|
|
664
|
+
my_logger.error('Mandatory @Redfish.ActionInfo for {} listed on action but URI get was not successful'.format(actionname))
|
|
665
|
+
else:
|
|
666
|
+
my_logger.error('@Redfish.ActionInfo for {} not listed, but is Mandatory'.format(actionname))
|
|
667
|
+
msg = msgInterop('ActionInfo', actioninfo_requirement, '-', '-', testResultEnum.FAIL)
|
|
668
|
+
else:
|
|
669
|
+
msg = msgInterop('ActionInfo', actioninfo_requirement, '-', '-', testResultEnum.PASS)
|
|
670
|
+
|
|
671
|
+
elif actioninfo_requirement == "Recommended":
|
|
672
|
+
if rf_payload_action is None:
|
|
673
|
+
if "@Redfish.ActionInfo" in rf_payload_item:
|
|
674
|
+
my_logger.warn('Recommended @Redfish.ActionInfo for {} listed on action but URI get was not successful'.format(actionname))
|
|
675
|
+
msg = msgInterop('ActionInfo', actioninfo_requirement, '-', '-', testResultEnum.WARN)
|
|
676
|
+
else:
|
|
677
|
+
my_logger.info('Recommended @Redfish.ActionInfo for {} not listed'.format(actionname))
|
|
678
|
+
msg = msgInterop('ActionInfo', actioninfo_requirement, '-', '-', testResultEnum.PASS)
|
|
679
|
+
else:
|
|
680
|
+
msg = msgInterop('ActionInfo', actioninfo_requirement, '-', '-', testResultEnum.PASS)
|
|
681
|
+
|
|
682
|
+
else:
|
|
683
|
+
my_logger.warn('Term "ActionInfo" has unknown value {}'.format(actioninfo_requirement))
|
|
684
|
+
msg = msgInterop('ActionInfo', actioninfo_requirement, '-', '-', testResultEnum.WARN)
|
|
685
|
+
msg.name = actionname + '.' + msg.name
|
|
686
|
+
msgs.append(msg)
|
|
687
|
+
|
|
639
688
|
# problem: if dne, skip
|
|
640
689
|
if "Parameters" in profile_entry:
|
|
641
|
-
|
|
690
|
+
parameter_dictionary = profile_entry["Parameters"]
|
|
642
691
|
# problem: if dne, skip
|
|
643
692
|
# assume mandatory
|
|
644
|
-
for
|
|
645
|
-
item =
|
|
693
|
+
for param in parameter_dictionary:
|
|
694
|
+
item = parameter_dictionary[param]
|
|
695
|
+
# Get Allowable Values for parameter
|
|
646
696
|
values_array = None
|
|
697
|
+
# If our action info exists at all, prefer it
|
|
647
698
|
if rf_payload_action is not None:
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
if
|
|
651
|
-
values_array =
|
|
699
|
+
parameter_by_name = rf_payload_action['Parameters']
|
|
700
|
+
my_parameter = [x for x in parameter_by_name if x['Name'] == param]
|
|
701
|
+
if my_parameter:
|
|
702
|
+
values_array = my_parameter[0].get('AllowableValues')
|
|
703
|
+
# Otherwise check for AllowableValues as additional property
|
|
652
704
|
if values_array is None:
|
|
653
|
-
values_array = rf_payload_item.get(str(
|
|
705
|
+
values_array = rf_payload_item.get(str(param) + '@Redfish.AllowableValues', REDFISH_ABSENT)
|
|
654
706
|
if values_array == REDFISH_ABSENT:
|
|
655
|
-
my_logger.warning('\tNo such ActionInfo exists for this Action, and no AllowableValues exists. Cannot validate the following parameters: {}'.format(
|
|
707
|
+
my_logger.warning('\tNo such ActionInfo exists for this Action, and no AllowableValues exists. Cannot validate the following parameters: {}'.format(param))
|
|
656
708
|
msg = msgInterop('', item, '-', '-', testResultEnum.WARN)
|
|
657
|
-
msg.name = "{}.{}.{}".format(actionname,
|
|
709
|
+
msg.name = "{}.{}.{}".format(actionname, param, msg.name)
|
|
658
710
|
msgs.append(msg)
|
|
659
711
|
else:
|
|
660
712
|
msg, success = validateRequirement(item.get('ReadRequirement', "Mandatory"), values_array)
|
|
661
713
|
msgs.append(msg)
|
|
662
|
-
msg.name = "{}.{}.{}".format(actionname,
|
|
714
|
+
msg.name = "{}.{}.{}".format(actionname, param, msg.name)
|
|
663
715
|
if "ParameterValues" in item:
|
|
664
716
|
msg, success = validateSupportedValues(
|
|
665
717
|
item["ParameterValues"], values_array)
|
|
666
718
|
msgs.append(msg)
|
|
667
|
-
msg.name = "{}.{}.{}".format(actionname,
|
|
719
|
+
msg.name = "{}.{}.{}".format(actionname, param, msg.name)
|
|
668
720
|
if "RecommendedValues" in item:
|
|
669
721
|
msg, success = validateSupportedValues(
|
|
670
722
|
item["RecommendedValues"], values_array)
|
|
@@ -677,7 +729,7 @@ def validateActionRequirement(profile_entry, rf_payload_tuple, actionname):
|
|
|
677
729
|
msg.success = testResultEnum.PASS
|
|
678
730
|
|
|
679
731
|
msgs.append(msg)
|
|
680
|
-
msg.name = "{}.{}.{}".format(actionname,
|
|
732
|
+
msg.name = "{}.{}.{}".format(actionname, param, msg.name)
|
|
681
733
|
# consider requirement before anything else, what if action
|
|
682
734
|
# if the action doesn't exist, you can't check parameters
|
|
683
735
|
# if it doesn't exist, what should not be checked for action
|
|
@@ -192,6 +192,9 @@ def validateSingleURI(URI, profile, uriName='', expectedType=None, expectedSchem
|
|
|
192
192
|
|
|
193
193
|
for msg in results[uriName]['messages']:
|
|
194
194
|
msg.parent_results = results
|
|
195
|
+
if msg.success == interop.testResultEnum.NOT_TESTED:
|
|
196
|
+
counts['notTested'] += 1
|
|
197
|
+
|
|
195
198
|
|
|
196
199
|
return True, counts, results, (links, limited_links), resource_obj
|
|
197
200
|
|
|
@@ -346,7 +349,7 @@ def validateURITree(URI, profile, uriName, expectedType=None, expectedSchema=Non
|
|
|
346
349
|
resource_stats[SchemaType]['Exists'] = True
|
|
347
350
|
resource_stats[SchemaType]['URIsFound'].append(link.rstrip('/'))
|
|
348
351
|
resource_stats[SchemaType]['SubordinateTo'].add(tuple(reversed(subordinate_tree)))
|
|
349
|
-
resource_stats[SchemaType]['UseCasesFound'].union(usecases_found)
|
|
352
|
+
resource_stats[SchemaType]['UseCasesFound'] = resource_stats[SchemaType]['UseCasesFound'].union(usecases_found)
|
|
350
353
|
|
|
351
354
|
if refLinks is not currentLinks and len(newLinks) == 0 and len(refLinks) > 0:
|
|
352
355
|
currentLinks = refLinks
|
|
@@ -11,7 +11,7 @@ with open("README.md", "r", "utf-8") as f:
|
|
|
11
11
|
|
|
12
12
|
setup(
|
|
13
13
|
name="redfish_interop_validator",
|
|
14
|
-
version="2.2.
|
|
14
|
+
version="2.2.2",
|
|
15
15
|
description="Redfish Interop Validator",
|
|
16
16
|
long_description=long_description,
|
|
17
17
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|