redfish-interop-validator 2.2.2__tar.gz → 2.2.3__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.
Files changed (23) hide show
  1. {redfish_interop_validator-2.2.2/redfish_interop_validator.egg-info → redfish_interop_validator-2.2.3}/PKG-INFO +1 -1
  2. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/RedfishInteropValidator.py +1 -1
  3. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/interop.py +22 -7
  4. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3/redfish_interop_validator.egg-info}/PKG-INFO +1 -1
  5. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/setup.py +1 -1
  6. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/AUTHORS.md +0 -0
  7. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/LICENSE.md +0 -0
  8. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/README.md +0 -0
  9. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/RedfishLogo.py +0 -0
  10. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/__init__.py +0 -0
  11. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/config.py +0 -0
  12. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/profile.py +0 -0
  13. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/redfish.py +0 -0
  14. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/session.py +0 -0
  15. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/tohtml.py +0 -0
  16. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/traverseInterop.py +0 -0
  17. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator/validateResource.py +0 -0
  18. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator.egg-info/SOURCES.txt +0 -0
  19. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator.egg-info/dependency_links.txt +0 -0
  20. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator.egg-info/entry_points.txt +0 -0
  21. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator.egg-info/requires.txt +0 -0
  22. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/redfish_interop_validator.egg-info/top_level.txt +0 -0
  23. {redfish_interop_validator-2.2.2 → redfish_interop_validator-2.2.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: redfish_interop_validator
3
- Version: 2.2.2
3
+ Version: 2.2.3
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
@@ -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.2'
20
+ tool_version = '2.2.3'
21
21
 
22
22
  # Set up the custom debug levels
23
23
  VERBOSE1 = logging.INFO - 1
@@ -279,6 +279,7 @@ def checkComparison(val, compareType, target):
279
279
  else:
280
280
  continue
281
281
  paramPass = len(alltarget) == len(target)
282
+
282
283
  if compareType == "LinkToResource":
283
284
  if val == REDFISH_ABSENT:
284
285
  paramPass = False
@@ -300,7 +301,7 @@ def checkComparison(val, compareType, target):
300
301
  if compareType == "Present":
301
302
  paramPass = val != REDFISH_ABSENT
302
303
 
303
- if isinstance(target, list):
304
+ if isinstance(target, list) and val != REDFISH_ABSENT:
304
305
  if compareType == "Equal":
305
306
  paramPass = val in target
306
307
  elif compareType == "NotEqual":
@@ -317,6 +318,10 @@ def checkComparison(val, compareType, target):
317
318
  paramPass = val <= value
318
319
  if paramPass is False:
319
320
  break
321
+ elif compareType in ["Equal", "NotEqual", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual"]:
322
+ if not isinstance(target, list):
323
+ my_logger.warn('CompareType {} requires a list of values'.format(compareType))
324
+
320
325
  my_logger.debug('\tpass ' + str(paramPass))
321
326
  return msgInterop('Comparison', target, compareType, val, paramPass),\
322
327
  paramPass
@@ -776,17 +781,27 @@ def validateInteropResource(propResourceObj, interop_profile, rf_payload):
776
781
 
777
782
  if "UseCases" in interop_profile:
778
783
  for use_case in interop_profile['UseCases']:
779
- entry_title = use_case.get("UseCaseTitle", "NoName").replace(' ','_')
780
- my_logger.debug('UseCase {}'.format(entry_title))
784
+ entry_title = use_case.get("UseCaseTitle", "NoName").replace(' ', '_')
785
+ entry_type = use_case.get("UseCaseType", "Normal")
786
+ my_logger.debug('UseCase {} {}'.format(entry_title, entry_type))
781
787
 
782
788
  # Check if we have a valid UseCase
783
- if 'URIs' not in use_case and 'UseCaseKeyProperty' not in use_case:
789
+ if 'URIs' not in use_case and 'UseCaseKeyProperty' not in use_case and entry_type != 'AbsentResource':
784
790
  my_logger.error('UseCase does not have URIs or UseCaseKeyProperty...')
785
791
 
786
- if 'UseCaseKeyProperty' in use_case:
792
+ if entry_type == 'AbsentResource':
793
+ my_status = rf_payload.get('Status')
794
+ if my_status:
795
+ use_case_applies = my_status.get('State') == 'Absent'
796
+ else:
797
+ use_case_applies = False
798
+ if 'URIs' in use_case:
799
+ use_case_applies = use_case_applies and checkInteropURI(propResourceObj, use_case['URIs'])
800
+
801
+ elif 'UseCaseKeyProperty' in use_case:
787
802
  entry_key, entry_comparison, entry_values = use_case['UseCaseKeyProperty'], use_case['UseCaseComparison'], use_case['UseCaseKeyValues']
788
803
 
789
- _, use_case_applies = checkComparison(rf_payload.get(entry_key), entry_comparison, entry_values)
804
+ _, use_case_applies = checkComparison(rf_payload.get(entry_key, REDFISH_ABSENT), entry_comparison, entry_values)
790
805
 
791
806
  # Check if URI applies to this usecase as well
792
807
  if 'URIs' in use_case:
@@ -794,7 +809,7 @@ def validateInteropResource(propResourceObj, interop_profile, rf_payload):
794
809
 
795
810
  elif 'URIs' in use_case:
796
811
  use_case_applies = checkInteropURI(propResourceObj, use_case['URIs'])
797
-
812
+
798
813
  else:
799
814
  use_case_applies = False
800
815
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: redfish_interop_validator
3
- Version: 2.2.2
3
+ Version: 2.2.3
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
@@ -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.2",
14
+ version="2.2.3",
15
15
  description="Redfish Interop Validator",
16
16
  long_description=long_description,
17
17
  long_description_content_type="text/markdown",