98be43e93a3e30fcdcfe5c52f5c4c7f85bbba8f0
[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 official 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/doctor_tests`_. This test script
22 can be used for functional testing agained an OPNFV deployment.
23
24 .. _doctor/doctor_tests: https://git.opnfv.org/doctor/tree/doctor_tests
25
26 Before running this script, make sure OpenStack env parameters are set properly
27 (See e.g. `OpenStackClient Configuration`_), so that Doctor Inspector can operate
28 OpenStack services.
29
30 .. _OpenStackClient Configuration: https://docs.openstack.org/python-openstackclient/latest/configuration/index.html
31
32 Run Python Test Script
33 ~~~~~~~~~~~~~~~~~~~~~~
34
35 You can run the python script as follows:
36
37 .. code-block:: bash
38
39     git clone https://gerrit.opnfv.org/gerrit/doctor
40     cd doctor && tox
41
42 You can see all the configurations with default values in sample configuration
43 file `doctor.sample.conf`_. And you can also modify the file to meet your
44 environment and then run the test.
45
46 .. _doctor.sample.conf: https://git.opnfv.org/doctor/tree/etc/doctor.sample.conf
47
48 Run Functest Suite
49 ==================
50
51 Functest supports Doctor testing by triggering the test script above in a
52 Functest container. You can run the Doctor test with the following steps:
53
54 .. code-block:: bash
55
56     DOCKER_TAG=latest
57     docker pull docker.io/opnfv/functest-features:${DOCKER_TAG}
58     docker run --privileged=true -id \
59         -e INSTALLER_TYPE=${INSTALLER_TYPE} \
60         -e INSTALLER_IP=${INSTALLER_IP} \
61         -e INSPECTOR_TYPE=sample \
62         docker.io/opnfv/functest-features:${DOCKER_TAG} /bin/bash
63     docker exec <container_id> functest testcase run doctor-notification
64
65 See `Functest Userguide`_ for more information.
66
67 .. _Functest Userguide: http://docs.opnfv.org/en/latest/submodules/functest/docs/testing/user/userguide/index.html
68
69 For testing with stable version, change DOCKER_TAG to 'stable' or other release
70 tag identifier.
71
72 Tips
73 ====