Package: redfish-service-validator
Copyright 2017-2022 DMTF.  All rights reserved.Redfish Service ValidatorAboutThe Redfish Service Validator is a Python3 tool for checking conformance of any "device" with a Redfish interface against Redfish CSDL schema.
The tool is designed to be device-agnostic and is driven based on the Redfish specifications and schema intended to be supported by the device.InstallationFrom PyPI:pip install redfish_service_validatorFrom GitHub:git clone https://github.com/DMTF/Redfish-Service-Validator.git
cd Redfish-Service-Validator
python setup.py sdist
pip install dist/redfish_service_validator-x.x.x.tar.gzRequirementsExternal modules:beautifulsoup4  -https://pypi.python.org/pypi/beautifulsoup4requests  -https://github.com/kennethreitz/requests(Documentation is available athttp://docs.python-requests.org/)lxml -https://pypi.python.org/pypi/lxmlYou may install the prerequisites by running:pip3 install -r requirements.txtIf you have a previous beautifulsoup4 installation, use the following command:pip3 install beautifulsoup4 --upgradeThere is no dependency based on Windows or Linux OS.
The result logs are generated in HTML format and an appropriate browser, such as Chrome, Firefox, or Edge, is required to view the logs on the client system.UsageExample usage without providing a configuration file:rf_service_validator -u root -p root -r https://192.168.1.1Example usage with a configuration file:rf_service_validator -c config/example.iniThe following sections describe the arguments and configuration file options.
The fileconfig/example.inican be used as a template configuration file.
At a minimum, theip,username, andpasswordoptions must be modified.[Tool]VariableCLI ArgumentTypeDefinitionverbose-vintegerVerbosity of tool in stdout[Host]VariableCLI ArgumentTypeDefinitionip-rstringThe address of the Redfish service (with scheme); example: 'https://123.45.6.7:8000'username-ustringThe username for authenticationpassword-pstringThe password for authenticationdescription--descriptionstringThe description of the system for identifying logs; if none is given, a value is produced from information in the service rootforceauth--forceauthbooleanForce authentication on unsecure connectionsauthtype--authtypestringAuthorization type; 'None', 'Basic', 'Session', or 'Token'token--tokenstringToken when 'authtype' is 'Token'ext_http_proxy--ext_http_proxystringURL of the HTTP proxy for accessing external sitesext_https_proxy--ext_https_proxystringURL of the HTTPS proxy for accessing external sitesserv_http_proxy--serv_http_proxystringURL of the HTTP proxy for accessing the serviceserv_https_proxy--serv_https_proxystringURL of the HTTPS proxy for accessing the service[Validator]VariableCLI ArgumentTypeDefinitionpayload--payloadstringThe mode to validate payloads ('Tree', 'Single', 'SingleFile', or 'TreeFile') followed by resource/filepath; see belowlogdir--logdirstringThe directory for generated report files; default: 'logs'oemcheck--nooemcheckbooleanWhether to check OEM items on serviceuricheck--uricheckbooleanAllow URI checking on services below RedfishVersion 1.6.0debugging--debuggingbooleanOutput debug statements to text log, otherwise it only uses INFOschema_directory--schema_directorystringDirectory for local schema filesmockup--mockupstringEnables insertion of local mockup resources to replace missing, incomplete, or incorrect implementations retrieved from the service that may hinder full validation coveragecollectionlimit--collectionlimitstringSets a limit to links gathered from collections by type, e.g.ComputerSystem 20limits ComputerSystemCollection to 20 linksPayload OptionThepayloadoption takes two parameters as strings.The first parameter specifies how to test the payload URI given, which can be 'Single', 'SingleFile', 'Tree', or 'TreeFile'.
'Single' and 'SingleFile' will test and give a report on a single resource.
'Tree' and 'TreeFile' will test and give a report on the resource and every link from that resource.The second parameter specifies a URI of the target payload to test or a filename of a local file to test.For example,--payload Single /redfish/v1/AccountServicewill perform validation of the URI/redfish/v1/AccountServiceand no other resources.Execution FlowThe Redfish Service Validator starts by querying the service root resource from the target service and collections information about the service.Collects all CSDL from the service.For each resource found, it performs the following:Reads all the URIs referenced in the resource.Reads the schema file related to the particular resource and builds a model of expected properties.Tests each property in the resource against the model built from the schema.Step 2 repeats until all resources are covered.When validating a resource, the following types of tests may occur for each property:Verify@odataproperties against known patterns, such as@odata.id.Check if the property is defined in the resource's schema.Check if the value of the property matches the expected type, such as integer, string, boolean, array, or object.Check if the property is mandatory.Check if the property is allowed to benull.For string properties with a regular expression, check if the value passes the regular expression.For enumerations, check if the value is within the enumeration list.For numeric properties with defined ranges, check if the value is within the specified range.For object properties, check the properties inside the object againt the object's schema definition.For links, check that the URI referenced matches the expected resource type.CSDL syntax errors will cause testing to halt and move on to other resources.
The OData CSDL Validator (https://github.com/DMTF/Redfish-Tools/tree/main/odata-csdl-validator) can be used to identify schema errors prior to testing.Conformance Logs - Summary and Detailed Conformance ReportThe Redfish Service Validator generates an HTML report under the 'logs' folder and is named as 'ConformanceHtmlLog_MM_DD_YYYY_HHMMSS.html', along with a text and config file.
The report gives the detailed view of the individual properties checked, with pass, fail, skip, or warning status for each resource checked for conformance.Additionally, there is a verbose text log file that may be referenced to diagnose tool or schema problems when the HTML log is insufficient.The Test StatusThe test result for each GET operation will be reported as follows:PASS: If the operation is successful and returns a success code, such as200 OK.FAIL: If the operation failed for reasons mentioned in GET method execution, or some configuration.SKIP: If the property or method being checked is not mandatory is not supported by the service.LimitationsThe Redfish Service Validator only performs GET operations on the service.
Below are certain items that are not in scope for the tool.Other HTTP methods, such as PATCH, are not covered.Query parameters, such as $top and $skip, are not covered.Multiple services are not tested simultaneously.Building a Standalone Windows ExecutableThe module pyinstaller is used to package the environment as a standlone executable file; this can be installed with the following command:pip3 install pyinstallerFrom a Windows system, the following command can be used to build a Windows executable file namedRedfishServiceValidator.exe, which will be found in dist folder:pyinstaller -F -w -i redfish.ico -n RedfishServiceValidator.exe RedfishServiceValidatorGui.pyRelease ProcessGo to the "Actions" pageSelect the "Release and Publish" workflowClick "Run workflow"Fill out the formClick "Run workflow"