Documents up-to-date
[doctor.git] / docs / testing / developer / 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 Doctor now supports different test cases and for that you might want to
33 export TEST_CASE with different values:
34
35 .. code-block:: bash
36
37     #Fault management (default)
38     export TEST_CASE='fault_management'
39     #Maintenance (requires 3 compute nodes)
40     export TEST_CASE='maintenance'
41     #Run both tests cases
42     export TEST_CASE='all'
43
44     #Use Fenix in maintenance testing instead of sample admin_tool
45     #This is only for 'mainteanance' test case
46     export ADMIN_TOOL_TYPE='fenix'
47     export APP_MANAGER_TYPE='vnfm'
48
49     #Run in different installer jumphost 'fuel' or 'apex'
50     #In multinode DevStack you run Doctor in controller node
51     #with value export APP_MANAGER_TYPE=vnfm
52     export INSTALLER_TYPE='fuel'
53
54 Run Python Test Script
55 ~~~~~~~~~~~~~~~~~~~~~~
56
57 You can run the python script as follows:
58
59 .. code-block:: bash
60
61     git clone https://gerrit.opnfv.org/gerrit/doctor
62     cd doctor && tox
63
64 You can see all the configurations with default values in sample configuration
65 file `doctor.sample.conf`_. And you can also modify the file to meet your
66 environment and then run the test.
67
68 .. _doctor.sample.conf: https://git.opnfv.org/doctor/tree/etc/doctor.sample.conf
69
70 In OPNFV testing environment jumphost you can run Doctor testing as follows
71 using tox:
72
73 .. code-block:: bash
74
75     source overcloudrc
76     export INSTALLER_IP=${INSTALLER_IP}
77     export INSTALLER_TYPE=${INSTALLER_TYPE}
78     git clone https://gerrit.opnfv.org/gerrit/doctor
79     cd doctor
80     sudo -E tox
81     
82 Note! In DevStack you run Doctor in controller node.