Skip to content

Instantly share code, notes, and snippets.

@kapil1024
Last active January 19, 2022 12:57
Show Gist options
  • Save kapil1024/621a6217dc5527ef0d1c496110d20066 to your computer and use it in GitHub Desktop.
Save kapil1024/621a6217dc5527ef0d1c496110d20066 to your computer and use it in GitHub Desktop.
How to use Redfish Service Validator

Basic steps:

Install python3 and pip3

sudo apt update -y
sudo apt install python3 python3-pip git unzip -y

Clone the repo

git clone git@github.com:DMTF/Redfish-Service-Validator.git redval
cd redval

Install required python packages (non-sudo, per user)

pip3 install -r requirements.txt
pip3 --version

Create necessary directory structure

mkdir logs SchemaFiles

Download necessary schema files (optional step)

cd SchemaFiles
wget https://www.dmtf.org/sites/default/files/standards/documents/DSP8010_2021.3.zip --no-check-certificate
mkdir DSP8010_2021.3
cd DSP8010_2021.3
unzip DSP8010_2021.3.zip

cd ..
mkdir metadata
cp -r DSP8010_2021.3/csdl/. metadata
cd ..

Run the tool using a config file

Update config file

cat <<"EOF" >config/myredval.ini
[Tool]
Version = 2
Copyright = Redfish DMTF (c) 2021
verbose =

[Host]
ip = https://127.0.0.1:2443
username = root
password = 0penBmc
description = MySystem
forceauth = True
authtype = Basic
token =

[Validator]
payload = tree /redfish/v1/Managers/bmc/HostInterfaces
logdir = ./logs
oemcheck = True
debugging = False
schema_directory = ./SchemaFiles/metadata
EOF

We can modify "payload" attribute under Validator section to test different redfish URLs:

  1. "payload = single /redfish/v1/Managers/bmc/HostInterfaces"
  2. "payload = "
  3. "payload = tree /redfish/v1/Systems"

Run the tool

python3 RedfishServiceValidator.py -c config/myredval.ini

Run the tool without config file

$ python3 Redfish-Service-Validator/RedfishServiceValidator.py --ip 127.0.0.1:2443 --forceauth -u root -p 0penBmc --logdir ./logs/ --payload tree /redfish/v1/Managers/bmc/HostInterfaces

Notes:

I am running openbmc (romulus machine) on qemu and redfish service can be accessed at address localhost:2443 from host system. More info at https://github.com/openbmc/docs/blob/master/development/dev-environment.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment