Hands-On Testing: How to Integrate Tests in OPNFV Jose Lausuch Ericsson, Functest PTL
Do not worry we make it easy for you
1) Check the documentation We have plenty of documents and guides that can help you http://docs.opnfv.org Config guide Release notes Wiki User guide Dev guide API Docs
Documentation (e.g Functest) Config guide User guide Developer guide http://testresults.opnfv.org/functest/framework/ API Docs https://wiki.opnfv.org/display/functest
2) Get familiar with the environment Deploy OPNFV with your desired features installed Follow the instructions to set up the test framework Run tests
3) Write a dummy test case Before testing your feature, make sure you can run a simple “Hello World” with the test framework. The framework should return “test successful”
4) Add the content of the test Once you understand how to integrate a test in the framework, you can start writing the code that exercises your feature Make use of framework libraries and helper functions
5) Declare the test case in the Test DB There is a Database to store community results from CI runs It is also used to store some information, such as: Test cases per project CI PODs Scenarios Easy to do this using the Rest API https://wiki.opnfv.org/pages/viewpage.action?pageId=6825128
{ "project_name": “myProject", "run": "", "name": "myTest", "ci_loop": "daily", "tags": "", "blocking": "false", "domains": "networking", "dependencies": "", "version": ">Euphrates", "criteria": "", "tier": "features", "trust": "silver", "catalog_description": "Hello world test case", "description": "Hello world test case blah blah " }
6) Push your code You probably want to keep the code of your test in your repo BUT You will need to enable some things in the test framework
Example: Doctor test case in Functest testcases.yaml Dockerfile - case_name: doctor-notification project_name: doctor criteria: 100 blocking: false description: >- Test suite from Doctor project. dependencies: installer: '(apex)|(fuel)' scenario: '^((?!fdio).)*$' run: module: 'functest.core.feature' class: 'BashFeature' args: cmd: 'cd /home/opnfv/repos/doctor/tests && ./run.sh' THAT’S IT!
7) Finally Once the code is merged in your repository and in the test framework Check CI
DEMO
Thank You