tests: add support for test generation #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Usage
python run_tests.py [OPTIONS]
-/--test: opcode of test
-s/--suite: test suite
-e/--endpoint: endpoint type (ioctl devname | mctp nid eid)
-v/--verify-rsp: check expected rsp payloads?
-r/--rc: expected rc
-d/-mctpd: mctpd compile flag (openbmc | codeconstruct)
run_tests.py will generate, compile and run specified tests.
python generate_tests.py
has same usage as run_tests but will only generate test files and will not compile or run5 test cases are currently defined in 2 suites:
Tests:
This was tested by starting a QEMU VM, cloning this branch on it, and running "run_tests.py" with different options (generating a suite or all tests, w/ioctl or mctp, etc.)
The VM topology:
Output from generating single test case:
Output from running Generic Commands suite:
This output is expected because the identify and set rsp msg limit are prohibited on the mailbox.
Output from running all tests
This output is expected, because the commands are sent through the MCTP EP, so Identify (0001h), Set Rsp Msg Limit (0004h) and Get DC Region Config (5601h) all pass but the 2 Feature Commands are not part of the MCTP CCI, so they fail.
For an example test file generated: the file generated from
python3 tests/run_tests.py -t 5601 -e mctp 1 9 --verify-rsp
is as follows: