Change naming and veriy test-scheduler function
[bottlenecks.git] / docs / testing / user / userguide / testing_scheduler_user_guide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) Huawei Technologies Co.,Ltd and others.
4
5 ****************************
6 Test-scheduler User Guide
7 ****************************
8
9
10 Test-scheduler Introduction
11 ==============================
12
13 Test scheduler aims to schedule the testing process on NFV(Network
14 Function Virtualizaion) platform or MSA(Microservice Architecture)
15 application.By creating a testcase, you can implements a testing
16 process integrates and schedules the other testing frameworks and tools.
17 You can also create a testsuite which contains several testcases, and run
18 all the testcases at a time.
19
20
21 Preinstall Packages
22 ===================
23
24 * Docker: https://docs.docker.com/engine/installation/
25     * For Ubuntu, please refer to https://docs.docker.com/engine/installation/linux/ubuntu/
26
27 * Docker-Compose: https://docs.docker.com/compose/
28
29 .. code-block:: bash
30
31     if [ -d usr/local/bin/docker-compose ]; then
32         rm -rf usr/local/bin/docker-compose
33     fi
34     curl -L https://github.com/docker/compose/releases/download/1.11.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
35     chmod +x /usr/local/bin/docker-compose
36
37
38 Run Test-scheduler
39 =====================
40
41 There are a few steps to do.
42
43
44 Download Bottlenecks Software
45 -----------------------------
46
47 .. code-block:: bash
48
49     mkdir -p /some/dir
50     git clone https://gerrit.opnfv.org/gerrit/bottlenecks
51     cd bottlenecks/test-scheduler
52
53
54 Build And Run Docker Containers
55 -------------------------------
56
57 .. code-block:: bash
58
59     cd docker
60     sh build.sh
61     sh run.sh
62
63
64 build.sh is used to build the images, and run.sh is use to
65 run the containers based on the images.
66 If you are not the root user, you need to use 'sudo', like:
67
68 .. code-block:: bash
69
70     cd docker
71     sudo sh build.sh
72     sudo sh run.sh
73
74
75 Otherwise there will be a problem of "Permission Denied".
76 The second command takes approximately 1h to finish(
77 so need some patience :) ), and the latter one just takes a few minutes.
78
79 You can use command the check whether all the containers are in running.
80
81 .. code-block:: bash
82
83     docker ps
84
85 if the output contains 6 containers as below, then the project
86 runs successfully:
87
88 * t-scheduler-server
89 * t-scheduler-ui
90 * conductor_conductor-server_1
91 * conductor_conductor-ui_1
92 * conductor_dynomite_1
93 * conductor_elasticsearch_1
94
95 Sometimes, the command execution fails, and you need to read the sections:
96 *(Optional)Commands Explanation* ,
97 *(Optional) Build And Run Containers Seperately* to solve it.
98
99
100 Start To Use Via Web
101 --------------------
102 You can visit the web pages via the url: http://your-host-ip:5311/.
103
104 You can do these operations:
105
106 * test suite CRUD
107 * test case CRUD
108 * execute a single test case
109 * execute several chosen test cases
110 * execute a single test suite
111 * test service CRUD
112 * context setting
113
114 Cleaning Up Environment
115 -----------------------
116
117 .. code-block:: bash
118
119     cd docker
120     sh clean.sh
121
122
123 (Optional)Commands Explanation
124 ------------------------------
125
126 The directory(**docker**) contains the shell scripts which are used
127 to build this project(**test-scheduler**) as a dockerized application.
128 Built by these scripts, the dockerized application will contain
129 6 containers(1 + 1 + 4). They can be divided as three components:
130
131 * 1 server container: server component of **test-scheduler**.
132 * 1 webUI container: ui component of **test-scheduler**.
133 * a group of 4 containers of Conductor.
134
135 Correspondingly, there are three subdirectories in the current
136 directory(**docker**):
137
138 * server: contains scirpts of running server container.
139 * ui: contains scirpts of running ui container.
140 * plugin:  contains scirpts of running Conductor containers.
141
142 The three subdirectories contains scripts respectively.The scripts
143 (in one subdirectory) are used to build image and start container
144 for the single component.
145
146 Essentially,  the **build.sh**  and **run.sh** (in the directory(**docker**))
147 call the subdirectory scripts to build all three components.
148
149
150 (Optional) Build And Run Containers Seperately
151 ----------------------------------------------
152
153 If you run the containers successfully, you can skip this section.
154 As said in *Build And Run Docker Containers*, build step will need about 1h to
155 finish.But it sometime will failed due to the network, and the rebuild will
156 take a great time cost.So we can build and run the containers seperately
157 according to the three subdirectories(**server**, **ui**, **plugin**).The
158 steps are similar to *Build And Run Docker Containers*.
159
160 *IMPORTANT: There are relationships in these components(some need to be
161 created before other).So you can only build the components below in the
162 order:* **plugin** -> **server** -> **ui** .
163
164 * enter the subdirectory(**$dir** stands for **server**, **ui**, **plugin**).
165
166 .. code-block:: bash
167
168     cd $dir
169
170 * build the docker images.
171
172 .. code-block:: bash
173
174     sh build.sh
175
176 * run the docker containers.
177
178 .. code-block:: bash
179
180     sh run.sh