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