cd39ee03b7072a4219c9de9ec8d0ce62d978e7ac
[doctor.git] / docs / development / overview / testing.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 ==============
5 Testing Doctor
6 ==============
7
8 You have two options to test Doctor functions with the script developed
9 for doctor CI.
10
11 You need to install OpenStack and other OPNFV components except Doctor Sample
12 Inspector, Sample Monitor and Sample Consumer, as these will be launched in
13 this script. You are encouraged to use OPNFV offcial installers, but you can
14 also deploy all components with other installers such as devstack or manual
15 operation. In those cases, the versions of all components shall be matched with
16 the versions of them in OPNFV specific release.
17
18 Run Test Script
19 ===============
20
21 Doctor project has own testing script under `doctor/tests`_. This test script
22 can be used for functional testing agained an OPNFV deployment.
23
24 .. _doctor/tests: https://gerrit.opnfv.org/gerrit/gitweb?p=doctor.git;a=tree;f=tests;
25
26 Before running this script, make sure OpenStack env parameters are set properly
27 following `OpenStack CLI manual`_, so that Doctor Inspector can operate
28 OpenStack services.
29
30 .. _OpenStack CLI manual: https://docs.openstack.org/user-guide/common/cli-set-environment-variables-using-openstack-rc.html
31
32 Then, you can run the script as follows:
33
34 .. code-block:: bash
35
36     git clone https://gerrit.opnfv.org/gerrit/doctor
37     cd doctor/tests
38     export INSTALLER_TYPE=local
39     export INSPECTOR_TYPE=sample
40     ./run.sh
41
42 INSTALLER_TYPE can be 'apex', 'fuel', 'joid' and 'local'(default). If you are
43 not using OPNFV installers in this option, chose 'local'.
44 INSPECTOR_TYPE can be specified either 'sample'(default) or 'congress'.
45
46 For testing with stable version, checkout stable branch of doctor repo before
47 './run.sh'.
48
49 Run Functest Suite
50 ==================
51
52 Functest supports Doctor testing by triggering the test script above in a
53 Functest container. You can run the Doctor test with the following steps:
54
55 .. code-block:: bash
56
57     DOCKER_TAG=latest
58     docker pull opnfv/functest:${DOCKER_TAG}
59     docker run --privileged=true -id \
60         -e INSTALLER_TYPE=${INSTALLER_TYPE} \
61         -e INSTALLER_IP=${INSTALLER_IP} \
62         -e INSPECTOR_TYPE=sample \
63         opnfv/functest:${DOCKER_TAG} /bin/bash
64     docker exec <container_id> python /home/opnfv/repos/functest/functest/ci/prepare_env.py start
65     docker exec <container_id> functest testcase run doctor
66
67 See `Functest Userguide`_ for more information.
68
69 .. _Functest Userguide: http://artifacts.opnfv.org/functest/docs/userguide/index.html
70
71 For testing with stable version, change DOCKER_TAG to 'stable' or other release
72 tag identifier.
73
74 Tips
75 ====