Git Product home page Git Product logo

redfish-reference-checker's People

Contributors

billdodd avatar mraineri avatar pwvancil avatar tomasg2012 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redfish-reference-checker's Issues

Disable insecure warning when explicit --nochkcert option given

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.

Add directory-level aliasing

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.

unable to parse $metdata and check all referenced schemas

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>

Incorrect parsed rootHost cause many failures when checking an url like https://10.10.10.10/redfish/v1/metadata/ServiceRoot_v1.xml

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:

python3 RedfishReferenceTool.py https://10.10.10.10/redfish/v1/metadata/ServiceRoot_v1.xml --nochkcert

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:

python3 RedfishReferenceTool.py https://10.10.10.10/redfish/v1/metadata/ServiceRoot_v1.xml --nochkcert

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.

Allow local copies and aliases for un-published schemas

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.

Log about verification results

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

Need local file check option

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.