redfish-interop-validator 2.2.8__tar.gz → 2.3.0__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.8/redfish_interop_validator.egg-info → redfish_interop_validator-2.3.0}/PKG-INFO +3 -2
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/RedfishInteropValidator.py +1 -1
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/interop.py +48 -25
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/profile.py +1 -1
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/validateResource.py +4 -4
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0/redfish_interop_validator.egg-info}/PKG-INFO +3 -2
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/setup.py +1 -1
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/AUTHORS.md +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/LICENSE.md +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/README.md +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/RedfishLogo.py +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/__init__.py +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/config.py +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/redfish.py +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/session.py +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/tohtml.py +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator/traverseInterop.py +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator.egg-info/SOURCES.txt +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator.egg-info/dependency_links.txt +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator.egg-info/entry_points.txt +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator.egg-info/requires.txt +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/redfish_interop_validator.egg-info/top_level.txt +0 -0
- {redfish_interop_validator-2.2.8 → redfish_interop_validator-2.3.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: redfish_interop_validator
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Redfish Interop Validator
|
|
5
5
|
Home-page: https://github.com/DMTF/Redfish-Interop-Validator
|
|
6
6
|
Author: DMTF, https://www.dmtf.org/standards/feedback
|
|
@@ -24,6 +24,7 @@ Dynamic: description-content-type
|
|
|
24
24
|
Dynamic: home-page
|
|
25
25
|
Dynamic: keywords
|
|
26
26
|
Dynamic: license
|
|
27
|
+
Dynamic: license-file
|
|
27
28
|
Dynamic: requires-dist
|
|
28
29
|
Dynamic: summary
|
|
29
30
|
|
|
@@ -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.
|
|
20
|
+
tool_version = '2.3.0'
|
|
21
21
|
|
|
22
22
|
# Set up the custom debug levels
|
|
23
23
|
VERBOSE1 = logging.INFO - 1
|
|
@@ -106,14 +106,50 @@ def validateComparisonAnyOfAllOf(profile_entry, property_path="Unspecified"):
|
|
|
106
106
|
return all_msgs
|
|
107
107
|
|
|
108
108
|
|
|
109
|
+
def validateRequirementResource(profile_entry, rf_payload_item=None, parent_object_tuple=None):
|
|
110
|
+
"""
|
|
111
|
+
Validates Requirement profile_entry for Resources
|
|
112
|
+
|
|
113
|
+
Has different resolutions than when validating at a per Property level
|
|
114
|
+
"""
|
|
115
|
+
resource_exists = (rf_payload_item != REDFISH_ABSENT)
|
|
116
|
+
my_logger.debug('Testing Resource ReadRequirement \n\texpected:' + str(profile_entry) + ', exists: ' + str(resource_exists))
|
|
117
|
+
|
|
118
|
+
original_profile_entry = profile_entry
|
|
119
|
+
|
|
120
|
+
if profile_entry == "IfPopulated":
|
|
121
|
+
profile_entry = "Recommended"
|
|
122
|
+
|
|
123
|
+
paramPass = profile_entry != "Mandatory" or \
|
|
124
|
+
profile_entry == "Mandatory" and resource_exists
|
|
125
|
+
|
|
126
|
+
if profile_entry == "IfImplemented":
|
|
127
|
+
if not resource_exists:
|
|
128
|
+
paramPass = testResultEnum.NA
|
|
129
|
+
else:
|
|
130
|
+
my_logger.debug('\tItem cannot be tested for Implementation')
|
|
131
|
+
|
|
132
|
+
if profile_entry == "Recommended" and not resource_exists:
|
|
133
|
+
my_logger.info('\tItem is recommended but does not exist')
|
|
134
|
+
if config['WarnRecommended']:
|
|
135
|
+
my_logger.warning('\tItem is recommended but does not exist, escalating to WARN')
|
|
136
|
+
paramPass = testResultEnum.WARN
|
|
137
|
+
else:
|
|
138
|
+
paramPass = testResultEnum.NA
|
|
139
|
+
|
|
140
|
+
my_logger.debug('\tpass ' + str(paramPass))
|
|
141
|
+
return msgInterop('ReadRequirement', original_profile_entry, 'Must Exist' if profile_entry == "Mandatory" else 'Any', 'Exists' if resource_exists else 'DNE', paramPass),\
|
|
142
|
+
paramPass
|
|
143
|
+
|
|
144
|
+
|
|
109
145
|
def validateRequirement(profile_entry, rf_payload_item=None, conditional=False, parent_object_tuple=None):
|
|
110
146
|
"""
|
|
111
147
|
Validates Requirement profile_entry
|
|
112
148
|
|
|
113
149
|
By default, only the first parameter is necessary and will always Pass if none given
|
|
114
150
|
"""
|
|
115
|
-
|
|
116
|
-
my_logger.debug('Testing ReadRequirement \n\texpected:' + str(profile_entry) + ', exists: ' + str(
|
|
151
|
+
prop_exists = (rf_payload_item != REDFISH_ABSENT)
|
|
152
|
+
my_logger.debug('Testing ReadRequirement \n\texpected:' + str(profile_entry) + ', exists: ' + str(prop_exists))
|
|
117
153
|
# If we're not mandatory, pass automatically, else fail
|
|
118
154
|
# However, we have other entries "IfImplemented" and "Conditional"
|
|
119
155
|
# note: Mandatory is default!! if present in the profile. Make sure this is made sure.
|
|
@@ -133,16 +169,16 @@ def validateRequirement(profile_entry, rf_payload_item=None, conditional=False,
|
|
|
133
169
|
if profile_entry == "Conditional" and conditional:
|
|
134
170
|
profile_entry = "Mandatory"
|
|
135
171
|
|
|
136
|
-
paramPass =
|
|
137
|
-
profile_entry == "Mandatory" and
|
|
172
|
+
paramPass = profile_entry != "Mandatory" or \
|
|
173
|
+
profile_entry == "Mandatory" and prop_exists
|
|
138
174
|
|
|
139
175
|
if profile_entry == "IfImplemented":
|
|
140
|
-
if
|
|
176
|
+
if not prop_exists:
|
|
141
177
|
paramPass = testResultEnum.NA
|
|
142
178
|
else:
|
|
143
179
|
my_logger.debug('\tItem cannot be tested for Implementation')
|
|
144
180
|
|
|
145
|
-
if profile_entry == "Recommended" and
|
|
181
|
+
if profile_entry == "Recommended" and not prop_exists:
|
|
146
182
|
my_logger.info('\tItem is recommended but does not exist')
|
|
147
183
|
if config['WarnRecommended']:
|
|
148
184
|
my_logger.warning('\tItem is recommended but does not exist, escalating to WARN')
|
|
@@ -151,7 +187,7 @@ def validateRequirement(profile_entry, rf_payload_item=None, conditional=False,
|
|
|
151
187
|
paramPass = testResultEnum.NA
|
|
152
188
|
|
|
153
189
|
my_logger.debug('\tpass ' + str(paramPass))
|
|
154
|
-
return msgInterop('ReadRequirement', original_profile_entry, 'Must Exist' if profile_entry == "Mandatory" else 'Any', 'Exists' if
|
|
190
|
+
return msgInterop('ReadRequirement', original_profile_entry, 'Must Exist' if profile_entry == "Mandatory" else 'Any', 'Exists' if prop_exists else 'DNE', paramPass),\
|
|
155
191
|
paramPass
|
|
156
192
|
|
|
157
193
|
|
|
@@ -327,19 +363,6 @@ def checkComparison(val, compareType, target):
|
|
|
327
363
|
paramPass
|
|
328
364
|
|
|
329
365
|
|
|
330
|
-
def validateMembers(members, profile_entry, annotation):
|
|
331
|
-
"""
|
|
332
|
-
Validate an profile_entry of Members and its count annotation
|
|
333
|
-
"""
|
|
334
|
-
my_logger.debug('Testing members \n\t' + str((members, profile_entry, annotation)))
|
|
335
|
-
if not validateRequirement('Mandatory', members):
|
|
336
|
-
return False
|
|
337
|
-
if "MinCount" in profile_entry:
|
|
338
|
-
mincount, mincountpass = validateMinCount(members, profile_entry["MinCount"], annotation)
|
|
339
|
-
mincount.name = 'MembersMinCount'
|
|
340
|
-
return mincount, mincountpass
|
|
341
|
-
|
|
342
|
-
|
|
343
366
|
def validateMinVersion(version, profile_entry):
|
|
344
367
|
"""
|
|
345
368
|
Checks for the minimum version of a resource's type
|
|
@@ -741,18 +764,18 @@ def validateActionRequirement(profile_entry, rf_payload_tuple, actionname):
|
|
|
741
764
|
return msgs, counts
|
|
742
765
|
|
|
743
766
|
|
|
744
|
-
URI_ID_REGEX = '\{[A-Za-z0-9]
|
|
767
|
+
URI_ID_REGEX = '\{[A-Za-z0-9]+\}'
|
|
745
768
|
|
|
746
|
-
VALID_ID_REGEX = '
|
|
769
|
+
VALID_ID_REGEX = '[A-Za-z0-9.!#$&-;=?\[\]_~]+'
|
|
747
770
|
|
|
748
771
|
|
|
749
772
|
def compareRedfishURI(expected_uris, uri):
|
|
750
773
|
success = False
|
|
751
774
|
# If we have our URIs
|
|
752
775
|
if expected_uris is not None:
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
success = re.fullmatch(
|
|
776
|
+
regex_pattern = "^{}$".format("|".join(expected_uris))
|
|
777
|
+
regex_pattern = re.sub(URI_ID_REGEX, VALID_ID_REGEX, regex_pattern)
|
|
778
|
+
success = re.fullmatch(regex_pattern, uri) is not None
|
|
756
779
|
else:
|
|
757
780
|
success = True
|
|
758
781
|
return success
|
|
@@ -176,7 +176,7 @@ def getProfiles(profile, directories, chain=None, online=False):
|
|
|
176
176
|
required_by_resource.extend(inner_reqs)
|
|
177
177
|
|
|
178
178
|
# Process all RequiredResourceProfile by modifying profiles
|
|
179
|
-
profile_resources = profile.get('Resources')
|
|
179
|
+
profile_resources = profile.get('Resources', {})
|
|
180
180
|
|
|
181
181
|
for resource_name, resource in profile_resources.items():
|
|
182
182
|
# Modify just the resource or its UseCases. Should not have concurrent UseCases and RequiredResourceProfile in Resource
|
|
@@ -263,7 +263,7 @@ def validateURITree(URI, profile, uriName, expectedType=None, expectedSchema=Non
|
|
|
263
263
|
validateSuccess, counts, results, links, resource_obj = \
|
|
264
264
|
validateSingleURI(URI, profile, uriName, expectedType, expectedSchema, expectedJson)
|
|
265
265
|
|
|
266
|
-
links, limited_links = links
|
|
266
|
+
links, limited_links = links if links else ({}, {})
|
|
267
267
|
for skipped_link in limited_links:
|
|
268
268
|
allLinks.add(limited_links[skipped_link])
|
|
269
269
|
|
|
@@ -396,7 +396,7 @@ def validateURITree(URI, profile, uriName, expectedType=None, expectedSchema=Non
|
|
|
396
396
|
|
|
397
397
|
my_logger.info('Validating UseCase {} of {} ReadRequirement'.format(entry_title, resource_type))
|
|
398
398
|
|
|
399
|
-
my_msg, _ = interop.
|
|
399
|
+
my_msg, _ = interop.validateRequirementResource(expected_requirement, 'Exists' if does_resource_exist else REDFISH_ABSENT)
|
|
400
400
|
my_msg.name = 'UseCase.{}.{}'.format(entry_title, my_msg.name)
|
|
401
401
|
if uris_applied:
|
|
402
402
|
my_msg.expected = "{} at {}".format(my_msg.expected, ", ".join(uris_applied))
|
|
@@ -425,7 +425,7 @@ def validateURITree(URI, profile, uriName, expectedType=None, expectedSchema=Non
|
|
|
425
425
|
expected_requirement = condition.get("ReadRequirement")
|
|
426
426
|
if expected_requirement:
|
|
427
427
|
my_logger.info('Validating {} Conditional ReadRequirement'.format(resource_type))
|
|
428
|
-
my_msg, _ = interop.
|
|
428
|
+
my_msg, _ = interop.validateRequirementResource(expected_requirement, 'Exists' if does_resource_exist else REDFISH_ABSENT)
|
|
429
429
|
my_msg.name = '{}.Conditional.{}'.format(resource_type, my_msg.name)
|
|
430
430
|
if uris_applied:
|
|
431
431
|
my_msg.expected = "{} at {}".format(my_msg.expected, ", ".join(uris_applied))
|
|
@@ -444,7 +444,7 @@ def validateURITree(URI, profile, uriName, expectedType=None, expectedSchema=Non
|
|
|
444
444
|
does_resource_exist = resource_exists
|
|
445
445
|
|
|
446
446
|
my_logger.info('Validating {} ReadRequirement'.format(resource_type))
|
|
447
|
-
my_msg, _ = interop.
|
|
447
|
+
my_msg, _ = interop.validateRequirementResource(expected_requirement, 'Exists' if does_resource_exist else REDFISH_ABSENT)
|
|
448
448
|
my_msg.name = '{}.{}'.format(resource_type, my_msg.name)
|
|
449
449
|
if uris_applied:
|
|
450
450
|
my_msg.expected = "{} at {}".format(my_msg.expected, ", ".join(uris_applied))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: redfish_interop_validator
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Redfish Interop Validator
|
|
5
5
|
Home-page: https://github.com/DMTF/Redfish-Interop-Validator
|
|
6
6
|
Author: DMTF, https://www.dmtf.org/standards/feedback
|
|
@@ -24,6 +24,7 @@ Dynamic: description-content-type
|
|
|
24
24
|
Dynamic: home-page
|
|
25
25
|
Dynamic: keywords
|
|
26
26
|
Dynamic: license
|
|
27
|
+
Dynamic: license-file
|
|
27
28
|
Dynamic: requires-dist
|
|
28
29
|
Dynamic: summary
|
|
29
30
|
|
|
@@ -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.
|
|
14
|
+
version="2.3.0",
|
|
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
|