dmtf / redfish-reference-checker Goto Github PK
View Code? Open in Web Editor NEWRedfishReferenceTool.py is a python3 tool that checks for valid reference URLs in CSDL xml files.
License: Other
RedfishReferenceTool.py is a python3 tool that checks for valid reference URLs in CSDL xml files.
License: Other
For the case of running against a system that uses a self-signed cert, several tools have an option (like --nochkcert
) to disable the certificate validation. But when you use that option, you will see the following warning displayed:
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised.
If you've explicitly used the --nochkcert
option, the warning is just an annoyance. Suggest we disable that warning during arg processing if --nochkcert
is specified.
Code to do this:
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
...
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
...
Applies to some other tools as well, including Redfish-Service-Validator, Redfish-Interop-Validator and Redfish-Usecase-Checkers/one_time_boot.
Idea came from Paul Vancil who did this in Redfish tool.
For performing pre-release checks, the references included in the files are likely to reference numerous files (which may also be un-published). Add a directory-level wildcard or other solution to providing an alias to an entire repository. Creating an alias file for 80+ files is an unnecessary burden on the user.
When I run the tool against a $metadata URI, I get the following error:
PS C:\DevTools> python .\RedfishReferenceTool.py https://10.243.12.46/redfish/v1/$metadata --nochkcert
https://10.243.12.46
https://10.243.12.46/redfish/v1/
No Schema Found for given destination
The $metadata file is a valid XML metadata and has many Reference sections like this:
<?xml version="1.0" encoding="UTF-8"?>
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:Reference Uri="/redfish/v1/metadata/ServiceRoot_v1.xml">
<edmx:Include Namespace="ServiceRoot" />
<edmx:Include Namespace="ServiceRoot.v1_1_0"/>
</edmx:Reference>
<edmx:Reference Uri="/redfish/v1/metadata/AccountService_v1.xml">
<edmx:Include Namespace="AccountService" />
<edmx:Include Namespace="AccountService.v1_0_2"/>
</edmx:Reference>
....
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Service">
<EntityContainer Name="Service" Extends="ServiceRoot.v1_1_1.ServiceContainer"/>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
When I run this tool to test an url, many failures are shown for incorrect parsed rootHost redfish.
Correct rootHost should be https://10.10.10.10, but rootHost is mis-recoganized as https://redfish
Running result:
Redfish Reference Checker 1.0.0
https:/
https://10.10.10.10/redfish/v1/metadata/ServiceRoot_v1.xml
http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Core.V1.xml
http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Capabilities.V1.xml
/redfish/v1/metadata/Resource_v1.xml
Something went wrong: HTTPSConnectionPool(host='redfish', port=443): Max retries exceeded with url: /v1/metadata/Resource_v1.xml (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fd547f99cc0>: Failed to establish a new connection: [Errno 111] Connection refused',))
False None
Something is wrong: No Valid Schema Found #36
......
I have tried to change L153 in "RedfishReferenceTool.py" script as below, finally it works.
Before modification:
rootHost = rootURL.rsplit('/', rootURL.count('/') - 1)[0]
After modification:
rootHost = rootURL.rsplit('/', rootURL.count('/') - 2)[0]
Running result after modification:
Redfish Reference Checker 1.0.0
https://10.10.10.10
https://10.10.10.10/redfish/v1/metadata/ServiceRoot_v1.xml
http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Core.V1.xml
http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Capabilities.V1.xml
/redfish/v1/metadata/Resource_v1.xml
/redfish/v1/metadata/RedfishExtensions_v1.xml
......
Can you help to check it? Thanks.
In order to validate references to online repositories (e.g. the DMTF's Redfish repository), the schemas must be published/available in order for the URI references to resolve. But this creates a catch-22 if you're attempting to validate a set of schema files before publication.
Allow an alias file to re-direct certain URIs to another location, or most likely, a local copy.
There are multiple references to --nocert in the README file, when it should be --nochkcert
Hi,
Is there any opportunity for this verification tool to add the function of generating a results report? For example results.json or html file.
Thanks,
Felix
As one of the primary uses of the Checker is to ensure links are valid before publication, the tool needs an option to check local file(s) in addition to URL sources.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.