This patch adds the System level testing framework & the initial set of tests for Marconi.This will allow developers to run the system tests (regression suite for Marconi system level tests), against local Marconi server. Refer tests/system/README.rst file for details on how to add new tests and run the existing tests. Change-Id: I2f47e03091acc260293b19edad69ff5c83888ec3 Implements: blueprint system-tests
Marconi System Tests
The System tests treat Marconi as a black box. The API calls are made similar to how an user would make them. Unlike unit tests, the system tests do not use mock endpoints.
Running the System Tests
Setup the Marconi server, to run the tests against. Refer to the Marconi README on how to run Marconi locally. (If you are running the tests against an existing server, skip this step.)
System tests require the requests & robot packages. Run the following to install them :
pip install -r tools/system-test-requires
cd to the marconi/tests/system directory
Copy etc/system-tests.conf-sample to one of the following locations:
~/.marconi/system-tests.conf /etc/marconi/system-tests.conf
Update the config file to point to the Marconi server you want to run the tests against
If keystone auth is enabled, update system-tests.conf with the credentials.
To run tests use the pybot commands,
Run all test suites :
pybot marconi/tests/system/queue/queue_tests.txt marconi/tests/system/messages/messages_tests.txt marconi/tests/system/claim/claim_tests.txt
Run a specific test suite :
pybot marconi/tests/system/queue/queue_tests.txt pybot marconi/tests/system/messages/messages_tests.txt pybot marconi/tests/system/claim/claim_tests.txt
pybot will generate report.html & log.html after the test run is complete.
To Add new tests
Add test case definition to the robot test case file (queue/queue_tests.txt, messages/messages_tests.txt, claim/claim_tests.txt) See here for more details on writing test cases.
Add test data to the test_data.csv in the same directory as the test case file you updated above (eg. queue/test_data.csv)
Add any validation logic you might need, to one of the following:
- corresponing *fnlib.py (eg. queue/queuefnlib.py)
- common/functionlib.py (If the code can be used across multiple test suites)