Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Hands-On Testing: How to Integrate Tests in OPNFV

511 Aufrufe

Veröffentlicht am

Jose Lausuch, Ericsson

I have developed and integrated a new feature but… how do I write test cases and where do I put them? How do I start?

These are common questions asked by developers bringing new features that need to be tested and verified in our CI pipeline.

Veröffentlicht in: Software
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

Hands-On Testing: How to Integrate Tests in OPNFV

  1. 1. Hands-On Testing: How to Integrate Tests in OPNFV Jose Lausuch Ericsson, Functest PTL
  2. 2. Do not worry we make it easy for you
  3. 3. 1) Check the documentation We have plenty of documents and guides that can help you http://docs.opnfv.org Config guide Dev guide User guide Release notes Wiki API Docs
  4. 4. Documentation (e.g Functest) • Config guide • User guide • Developer guide • http://testresults.opnfv.org/functest/framework/ • API Docs • https://wiki.opnfv.org/display/functest
  5. 5. 2) Get familiar with the environment Deploy OPNFV with your desired features installed Follow the instructions to set up the test framework Run tests
  6. 6. 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”
  7. 7. 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
  8. 8. 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
  9. 9. { "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 " }
  10. 10. 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
  11. 11. Example: Doctor test case in Functest - 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' testcases.yamlDockerfile THAT’S IT!
  12. 12. 7) Finally Once the code is merged in your repository and in the test framework  Check CI
  13. 13. DEMO
  14. 14. Thank You

×