ocp-diag-autoval-ssd is a collection of SSD tests using the ocp-diag-autoval test framework.
At a high level, the following steps are necessary to install, build, and use autoval
This installation steps are a work in progress. They will be improved/simplified in the future.
- Clone the following repos:
$ git clone https://github.com/opencomputeproject/ocp-diag-autoval.git
$ git clone https://github.com/opencomputeproject/ocp-diag-autoval-ssd.git
- Create a virtual environment:
$ python -m venv env
$ source ./env/bin/activate
$ pip install build
- Build and install
ocptv-autoval
$ cd ocp-diag-autoval
$ python -m build
$ pip install ./dist/ocptv_autoval-0.0.1.tar.gz
- Build and install
ocptv-autoval-ssd
$ cd ocp-diag-autoval-ssd
$ python -m build
$ pip install --no-deps ./dist/ocptv_autoval_ssd-0.0.1.tar.gz
There are two parts to environment setup:
- Creating and maintaining a repo to host RPMs and tools needed by autoval tests
- Creating a
site_settings.json
file.
Local repo hosting is required because many tests require specific RPMs in order to run (e.g. fio
, fio-synth
) and automatically download and install them at test setup time. We strongly recommend naming the repo autoval-tools (as it aligns with default configuration defined in site_settings.json
).
Before running tests for the first time, you'll need to create a site_settings.json
file.
Here is an example with some basic defaults.
{
"control_server_logdir": "/autoval/logs/",
"control_server_tmpdir": "/tmp/autoval/",
"dut_logdir": "/autoval/logs/",
"dut_tmpdir": "/tmp/autoval/",
"resultsdir": "/autoval/results/",
"ssh_key_path": ["/USERNAME/.ssh/id_rsa"], # Replace contents with a path to your public SSH key
"plugin_config_path" : "plugins/plugin_config.json",
"repository_dir": "/autoval/repository/",
"test_utils_plugin_config_path" : "plugins/test_utils_plugin_config.json",
"cleanup_dut_logdirs" : false,
"yum_repo": "autoval-tools"
}
See rpm_repo_hosting.md for detailed instructions on how to configure a DNF repo on the test server.
Before executing tests, you need to create a hosts.json
file.
The {-c|--config} CONFIG
autoval option is used to specify DUT configuration in well-formed JSON. This configuration contains the following information:
hostname
: IP address of the hostoob_addr
: IP address of the BMCusername
: Name of the host userpassword
: Password for the host useroob_username
: Name of the OOB useroob_password
: Password for the OOB user
Example:
{
"hosts": [
{
"hostname": "10::CD97:E10F:FE82:9A1C",
"username": "root",
"password": "password",
"oob_addr": "10::CD97:E10F:FE82:9A19",
"oob_username": "root",
"oob_password": "password"
}
]
}
Every test has its control parameters provided by the control.json
file located in the same directory as the test module.
boot_drive_physical_location
should be passed as a test control parameter using the following BDF format.
Format: <PCI domain>:<bus>:<device>.<function>
Example:
"boot_drive_physical_location": "0000:64:00.0"
Now that you have a hosts.json
file, you can run a test as follows.
$ export SITE_SETTINGS="path/to/site_settings.json"
$ python -m autoval.autoval_test_runner autoval_ssd.tests.nvme_cli.nvme_cli \
--config ./hosts.json \
--test_control ~/bin/ocp-diag-autoval-ssd/autoval_ssd/tests/nvme_cli/control.json