Skip to content

Commit a0a470b

Browse files
committed
Updated project to be able to push to PyPI
Signed-off-by: Mike Raineri <[email protected]>
1 parent f277f97 commit a0a470b

18 files changed

+456
-371
lines changed

.github/workflows/release.yml

+28-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ jobs:
5353
echo 'EOF' >> $GITHUB_ENV
5454
- name: Update version numbers
5555
run: |
56-
sed -i -E 's/tool_version = .+/tool_version = '\'${{github.event.inputs.version}}\''/' RedfishInteropValidator.py
56+
sed -i -E 's/ version=.+,/ version="'${{github.event.inputs.version}}'",/' setup.py
57+
sed -i -E 's/tool_version = .+/tool_version = '\'${{github.event.inputs.version}}\''/' redfish_interop_validator/RedfishInteropValidator.py
5758
- name: Update the changelog
5859
run: |
5960
ex CHANGELOG.md <<eof
@@ -66,11 +67,35 @@ jobs:
6667
run: |
6768
git config user.name "GitHub Release Workflow"
6869
git config user.email "<>"
69-
git add CHANGELOG.md RedfishInteropValidator.py
70+
git add CHANGELOG.md setup.py redfish_interop_validator/RedfishInteropValidator.py
7071
git commit -s -m "${{github.event.inputs.version}} versioning"
7172
git push origin master
7273
- name: Make the release
74+
id: create_release
75+
uses: actions/create-release@v1
7376
env:
7477
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
78+
with:
79+
tag_name: ${{github.event.inputs.version}}
80+
release_name: ${{github.event.inputs.version}}
81+
body: |
82+
Changes since last release:
83+
84+
${{env.CHANGES}}
85+
draft: false
86+
prerelease: false
87+
- name: Set up Python
88+
uses: actions/setup-python@v2
89+
with:
90+
python-version: '3.x'
91+
- name: Install dependencies
92+
run: |
93+
python -m pip install --upgrade pip
94+
pip install setuptools wheel twine
95+
- name: Build and publish to pypi
96+
env:
97+
TWINE_USERNAME: ${{secrets.PYPI_USERNAME}}
98+
TWINE_PASSWORD: ${{secrets.PYPI_PASSWORD}}
7599
run: |
76-
gh release create ${{github.event.inputs.version}} -t ${{github.event.inputs.version}} -n "Changes since last release:"$'\n\n'"$CHANGES"
100+
python setup.py sdist bdist_wheel
101+
twine upload dist/*

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
__pycache__/
2+
build/
3+
dist/
24
logs/
35
*.pyc
6+
*.spec
7+
*.egg-info/

README.md

+54-39
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,38 @@ The Redfish Interop Validator is a python3 tool that will validate a service bas
1010

1111
This tool is designed to accept a profile conformant to the schematics specified by the DMTF Redfish Profile schema, and run against any valid Redfish service for a given device. It is not biased to any specific hardware, only dependent on the current Redfish specification.
1212

13-
## Pre-requisites
13+
## Installation
1414

15-
The Redfish Interop Validator is based on Python 3 and the client system is required to have the Python framework installed before the tool can be installed and executed on the system. Additionally, the following packages are required to be installed and accessible from the python environment:
16-
* requests - https://github.com/kennethreitz/requests (Documentation is available at http://docs.python-requests.org/)
17-
* jsonschema
15+
From PyPI:
1816

19-
If you wish to convert your logs:
20-
* beautifulsoup4 - https://pypi.python.org/pypi/beautifulsoup4/ (must be >= 4.6.0)
17+
pip install redfish_interop_validator
2118

22-
You may install the prerequisites by running:
19+
From GitHub:
2320

24-
`pip3 install -r requirements.txt`
21+
git clone https://github.com/DMTF/Redfish-Interop-Validator.git
22+
cd Redfish-Interop-Validator
23+
python setup.py sdist
24+
pip install dist/redfish_interop_validator-x.x.x.tar.gz
2525

26-
If you have a previous beautifulsoup4 installation, please use the following command:
26+
## Requirements
2727

28-
`pip3 install beautifulsoup4 --upgrade`
28+
External modules:
2929

30-
There is no dependency based on Windows or Linux OS. The result logs are generated in HTML format and an appropriate browser (Chrome, Firefox, IE, etc.) is required to view the logs on the client system.
30+
* beautifulsoup4 - https://pypi.python.org/pypi/beautifulsoup4
31+
* requests - https://github.com/kennethreitz/requests (Documentation is available at http://docs.python-requests.org/)
32+
* lxml - https://pypi.python.org/pypi/lxml
33+
* jsonschema - https://pypi.org/project/jsonschema
3134

32-
## Installation
35+
You may install the prerequisites by running:
36+
37+
pip3 install -r requirements.txt
3338

34-
Place the RedfishInteropValidator.py tool into the desired tool root directory. Create the following subdirectories in the tool root directory: "config" and "logs". Place the example config.ini file in the "config" directory.
39+
If you have a previous beautifulsoup4 installation, use the following command:
40+
41+
pip3 install beautifulsoup4 --upgrade
42+
43+
There is no dependency based on Windows or Linux OS.
44+
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.
3545

3646
## Execution Steps
3747

@@ -41,40 +51,44 @@ Modify the config\example.ini file to enter the system details under below secti
4151

4252
### [Tool]
4353

44-
Variable | Type | Definition
45-
-- |-- |--
46-
Version | string | Internal config version (optional)
47-
Copyright | string | _DMTF_ copyright (optional)
48-
verbose | int | level of verbosity (0-3)
54+
| Variable | Type | Definition |
55+
| :--- | :--- | :--- |
56+
| Version | string | Internal config version (optional) |
57+
| Copyright | string | _DMTF_ copyright (optional) |
58+
| verbose | int | level of verbosity (0-3) |
4959

5060
### [Interop]
51-
Variable | Type | Definition
52-
-- |-- |--
53-
Profile | string | name of the testing profile (mandatory)
54-
Schema | string | name of json schema to test profile against
61+
62+
| Variable | Type | Definition |
63+
| :--- | :--- | :--- |
64+
| Profile | string | name of the testing profile (mandatory) |
65+
| Schema | string | name of json schema to test profile against |
5566

5667
### [Host]
57-
Variable | Type | Definition
58-
-- |-- |--
59-
ip | string | Host of testing system, formatted as https:// ip : port (can use http as well)
60-
username | string | Username for Basic authentication
61-
password | string | Password for Basic authentication (removed from logs)
62-
description| string | Description of system being tested (optional)
63-
forceauth | boolean | Force authentication even on http servers
64-
authtype | string | Authorization type (Basic | Session | Token | None)
65-
token | string | Token string for Token authentication
68+
69+
| Variable | Type | Definition |
70+
| :--- | :--- | :--- |
71+
| ip | string | Host of testing system, formatted as https:// ip : port (can use http as well) |
72+
| username | string | Username for Basic authentication |
73+
| password | string | Password for Basic authentication (removed from logs) |
74+
| description | string | Description of system being tested (optional) |
75+
| forceauth | boolean | Force authentication even on http servers |
76+
| authtype | string | Authorization type (Basic | Session | Token | None) |
77+
| token | string | Token string for Token authentication |
6678

6779
### [Validator]
68-
Variable | Type | Definition
69-
-- |-- |--
70-
payload | string | Option to test a specific payload or resource tree (see below)
71-
logdir | string | Place to save logs and run configs
72-
oemcheck | boolean | Whether to check Oem items on service
73-
online_profiles | boolean | Whether to download online profiles
74-
debugging | boolean | Whether to print debug to log
75-
required_profiles_dir | string | Option to set the root folder of required profiles
80+
81+
| Variable | Type | Definition |
82+
| :--- | :--- | :--- |
83+
| payload | string | Option to test a specific payload or resource tree (see below) |
84+
| logdir | string | Place to save logs and run configs |
85+
| oemcheck | boolean | Whether to check Oem items on service |
86+
| online_profiles | boolean | Whether to download online profiles |
87+
| debugging | boolean | Whether to print debug to log |
88+
| required_profiles_dir | string | Option to set the root folder of required profiles |
7689

7790
### Payload options
91+
7892
The payload option takes two parameters as "option uri"
7993

8094
(Single, SingleFile, Tree, TreeFile)
@@ -99,6 +113,7 @@ To convert a previous HTML log into a csv file, use the following command:
99113
* 3. Step 2 repeats till all the URIs and resources are covered.
100114

101115
Upon validation of a resource, the following types of tests may occur:
116+
102117
* **Unlike** the Service Validator, the program will not necessarily list and warn problematic Resources, it will expect those problems to be found with the Service Validator and are ignored in the process here.
103118
* When a Resource is found, check if this resource exists in the Profile provided, otherwise ignore it and move on to the next available resources via its Links.
104119
* With the Resource initiated, begin to validate itself and the Properties that exist in the Profile given to the program with the following possible tests:

0 commit comments

Comments
 (0)