****************************** OPNFV FUNCTEST developer guide ****************************** .. toctree:: :numbered: :maxdepth: 2 ============ Introduction ============ Functest is a project dealing with functional testing. Functest produces its own internal test cases but can also be considered as a framework to support feature and VNF onboarding project testing. Functest developed a test API and defined a test collection framework that can be used by any OPNFV project. Therefore there are many ways to contribute to Functest. You can: * Develop new internal test cases * Integrate the tests from your feature project * Develop the framework to ease the integration of external test cases * Develop the API / Test collection framework * Develop dashboards or automatic reporting portals This document describes how, as a developer, you may interact with the Functest project. The first section details the main working areas of the project. The Second part is a list of "How to" to help you to join the Functest family whatever your field of interest is. ======================== Functest developer areas ======================== Functest High level architecture ================================ Functest is project delivering a test container dedicated to OPNFV. It includes the tools, the scripts and the test scenarios. Functest can be described as follow:: +----------------------+ | | | +--------------+ | +-------------------+ | | | | Public | | | | Tools | +------------------+ OPNFV | | | Scripts | | | System Under Test | | | Scenarios | +------------------+ | | | | | Management | | | +--------------+ | +-------------------+ | | | Functest Docker | | | +----------------------+ Functest internal test cases ============================ The internal test cases in Danube are: * healthcheck * connection_check * api_check * vping_ssh * vping_userdata * odl * snaps_smoke * tempest_smoke_serial * rally_sanity * tempest_full_parallel * rally_full * cloudify_ims By internal, we mean that this particular test cases have been developped and/or integrated by functest contributors and the associated code is hosted in the Functest repository. An internal case can be fully developped or a simple integration of upstream suites (e.g. Tempest/Rally developped in OpenStack are just integrated in Functest). The structure of this repository is detailed in `[1]`_. The main internal test cases are in the opnfv_tests subfolder of the repository, the internal test cases are: * sdn: odl, onos * openstack: healthcheck, vping_ssh, vping_userdata, tempest_*, rally_*, connection_check, api_check, snaps_smoke * vnf: cloudify_ims If you want to create a new test case you will have to create a new folder under the testcases directory. Functest external test cases ============================ The external test cases are inherited from other OPNFV projects, especially the feature projects. The external test cases are: * promise * doctor * onos * bgpvpn * copper * security_scan * sfc-odl * sfc-onos * parser * domino * multisite * opera_ims * orchestra_ims The code to run these test cases may be directly in the repository of the project. We have also a **features** sub directory under opnfv_tests directory that may be used (it can be usefull if you want to reuse Functest library). Functest framework ================== Functest can be considered as a framework. Functest is release as a docker file, including tools, scripts and a CLI to prepare the environement and run tests. It simplifies the integration of external test suites in CI pipeline and provide commodity tools to collect and display results. Since Colorado, test categories also known as tiers have been created to group similar tests, provide consistant sub-lists and at the end optimize test duration for CI (see How To section). The definition of the tiers has been agreed by the testing working group. The tiers are: * healthcheck * smoke * features * components * performance * vnf * stress Functest abstraction classes ============================ In order to harmonize test integration, 3 abstraction classes have been introduced in Danube: * testcase_base: base for any test case * feature_base: abstraction for feature project * vnf_base: abstraction for vnf onboarding The goal is to unify the way to run test from Functest. feature_base and vnf_base inherit from testcase_base. +-----------------------------------------+ | | | Testcase_base | | | | - init() | | - run() | | - publish_report() | | - check_criteria() | | | +-----------------------------------------+ | | V V +--------------------+ +--------------------------+ | |
##############################################################################
# Copyright (c) 2017 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
# Sample benchmark task config file
# Two scenarios run serially using different types of runners
schema: "yardstick:task:0.1"
scenarios:
-
type: Ping
options:
packetsize: 100
host: apollo.demo
target: artemis.demo
runner:
type: Duration
duration: 20
interval: 1
sla:
max_rtt: 10
action: monitor
-
type: Ping
host: apollo.demo
target: artemis.demo
runner:
type: Arithmetic
interval: 0.2
iterators:
-
name: packetsize
start: 100
stop: 6000
step: 100
context:
name: demo
image: yardstick-image
flavor: yardstick-flavor
user: ubuntu
servers:
apollo:
floating_ip: true
artemis:
networks:
test:
cidr: '10.0.1.0/24'