bugfix: bottlenecks devguide in docs.opnfv.org
[bottlenecks.git] / docs / testing / developer / devguide / vstf_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 VSTF Testsuite Guide
7 ********************
8
9 VSTF Introduction
10 ====================
11 VSTF(Virtual Switch Test Framework) is a system-level testing framework in the
12 area of network virtualization, and it could help you estimate the system switch
13 ability and find out the network bottlenecks by main KPIs(bandwidth, latency,
14 resource usage and so on), VSTF owns a methodology to define the test scenario and
15 testcases, Now we could support Tu testcases in the Openstack environment, More
16 scenarios and cases will be added.
17
18 VSTF TestScenario
19 -----------------
20 1. Tu - VM to VM
21 2. Tn - Physical Nic loopback
22 3. TnV - VNF loopback
23 4. Ti - VM to Physical Nic
24
25 Pre-install Packages on the ubuntu 14.04 VM
26 ===========================================
27 VSTF VM Preparation Steps
28 -------------------------
29 1. Create a ubuntu 14.04 VM
30 2. Install dependency inside VM
31 3. Install vstf python package inside VM
32
33 VM preparation
34 --------------
35 Install python2.7 version and git
36
37 ::
38
39   sudo apt-get install python2.7
40   sudo apt-get install git
41
42 Download Bottlenecks package
43
44 ::
45
46   sudo cd /home/
47   sudo git clone https://gerrit.opnfv.org/gerrit/bottlenecks
48
49 Install the dependency
50
51 ::
52
53   sudo apt-get install python-pip
54   sudo pip install --upgrade pip
55   sudo dpkg-reconfigure dash
56   sudo apt-get install libjpeg-dev
57   sudo apt-get install libpng-dev
58   sudo apt-get install python-dev
59   sudo apt-get install python-testrepository
60   sudo apt-get install git
61   sudo apt-get install python-pika
62   sudo apt-get install python-oslo.config
63   sudo pip install -r /home/bottlenecks/vstf/requirements.txt
64
65 Install vstf package
66
67 ::
68
69   sudo mkdir -p /var/log/vstf/
70   sudo cp -r /home/bottlenecks/vstf/etc/vstf/ /etc/
71   sudo mkdir -p /opt/vstf/
72   sudo cd /home/bottlenecks;sudo rm -rf build/
73   sudo python setup.py install
74
75 Image on the Cloud
76 ------------------
77 +-----------+-------------------------------------------------------------+
78 |    Name   | vstf-image                                                  |
79 +===========+=============================================================+
80 |    URL    | http://artifacts.opnfv.org/bottlenecks/vstf-manager-new.img |
81 +-----------+-------------------------------------------------------------+
82 |   Format  | QCOW2                                                       |
83 +-----------+-------------------------------------------------------------+
84 |    Size   | 5G                                                          |
85 +-----------+-------------------------------------------------------------+
86 |    User   | root                                                        |
87 +-----------+-------------------------------------------------------------+
88 |   Passwd  | root                                                        |
89 +-----------+-------------------------------------------------------------+
90 There is a complete vstf image on the cloud ,you could download it and use it to
91 deploy and run cases ,but do not need VM preparation steps.
92
93
94 How is VSTF Integrated into Installers
95 ========================================
96 VM requirements
97 ---------------
98 +------------------+----------+--------------------+-----------------------------------------------------+
99 |        Name      |  FLAVOR  |     IMAGE_NAME     | NETWORK                                             |
100 +==================+==========+====================+=====================================================+
101 |   vstf-manager   | m1.large |     vstf-image     | control-plane=XX.XX.XX.XX                           |
102 +------------------+----------+--------------------+-----------------------------------------------------+
103 |   vstf-tester    | m1.large |     vstf-image     | control-plane(eth0)=XX.XX.XX.XX                     |
104 |                  |          |                    | test-plane(eth1)=XX.XX.XX.XX                        |
105 +------------------+----------+--------------------+-----------------------------------------------------+
106 |   vstf-target    | m1.large |     vstf-image     | control-plane(eth0)=XX.XX.XX.XX                     |
107 |                  |          |                    | test-plane(eth1)=XX.XX.XX.XX                        |
108 +------------------+----------+--------------------+-----------------------------------------------------+
109 m1.large means 4U4G for the target image Size 5GB
110 For the network used by VMs,network need two plane ,one plane is control plane and the other plane is test plane.
111
112 OPNFV community Usage in the CI system
113 --------------------------------------
114 +---------------------------------------+---------------------------------------+
115 | Project Name                          | Project Categoty                      |
116 +=======================================+=======================================+
117 | bottlenecks-daily-fuel-vstf-lf-master | bottlenecks                           |
118 +---------------------------------------+---------------------------------------+
119 OPNFV community jenkins Project info
120
121 Main Entrance for the ci test:
122
123 ::
124
125   cd /home/bottlenecks/ci;
126   bash -x vstf_run.sh
127
128 Test on local(Openstack Environment)
129 ------------------------------------
130 download the image file
131
132 ::
133
134   curl --connect-timeout 10 -o /tmp/vstf-manager.img \
135        http://artifacts.opnfv.org/bottlenecks/vstf-manager-new.img -v
136
137 create the image file by the glance
138
139 ::
140
141   glance image-create --name $MANAGER_IMAGE_NAME \
142         --disk-format qcow2 \
143         --container-format bare \
144         --file /tmp/vstf-manager.img
145
146 create the keypair for the image(anyone will be ok)
147
148 ::
149
150   cd /home/bottlenecks/utils/infra_setup/bottlenecks_key
151   nova keypair-add --pub_key $KEY_PATH/bottlenecks_key.pub $KEY_NAME
152
153 create the vstf three VMs in the openstack by heat
154
155 ::
156
157   cd /home/bottlenecks/utils/infra_setup/heat_template/vstf_heat_template
158   heat stack-create vstf -f bottleneck_vstf.yaml
159
160 launch the vstf process inside the vstf-manager vstf-tester vstf-target VMs
161
162 ::
163
164   cd /home/bottlenecks/utils/infra_setup/heat_template/vstf_heat_template
165   bash -x launch_vstf.sh
166
167 edit the test scenario and test packet list in the vstf_test.sh, now support the Tu-1/2/3
168
169 ::
170
171   function fn_testing_scenario(){
172       ...
173       local test_length_list="64 128 256 512 1024"
174       local test_scenario_list="Tu-1 Tu-3"
175       ...
176   }
177
178 launch the vstf script
179
180 ::
181
182   cd /home/bottlenecks/utils/infra_setup/heat_template/vstf_heat_template
183   bash -x vstf_test.sh
184
185 Test Result Description
186 =======================
187 Result Format
188 -------------
189 For example after the test, The result will display as the following format
190
191 ::
192
193   { u'64': { u'AverageLatency': 0.063,
194              u'Bandwidth': 0.239,
195              u'CPU': 0.0,
196              u'Duration': 20,
197              u'MaximumLatency': 0.063,
198              u'MinimumLatency': 0.063,
199              u'MppspGhz': 0,
200              u'OfferedLoad': 100.0,
201              u'PercentLoss': 22.42,
202              u'RxFrameCount': 4309750.0,
203              u'RxMbps': 198.28,
204              u'TxFrameCount': 5555436.0,
205              u'TxMbps': 230.03}}
206
207 Option Description
208 ------------------
209 +---------------------+---------------------------------------------------+
210 |     Option Name     |                 Description                       |
211 +=====================+===================================================+
212 |    AverageLatency   | The average latency data during the packet        |
213 |                     | transmission (Unit:microsecond)                   |
214 +---------------------+---------------------------------------------------+
215 |      Bandwidth      | Network bandwidth(Unit:Million packets per second)|
216 +---------------------+---------------------------------------------------+
217 |         CPU         | Total Resource Cpu usage(Unit: Ghz)               |
218 +---------------------+---------------------------------------------------+
219 |      Duration       | Test time(Unit: second)                           |
220 +---------------------+---------------------------------------------------+
221 |   MaximumLatency    | The maximum packet latency during the packet      |
222 |                     | transmission (Unit:microsecond)                   |
223 +---------------------+---------------------------------------------------+
224 |   MinimumLatency    | The maximum packet latency during the packet      |
225 |                     | transmission (Unit:microsecond)                   |
226 +---------------------+---------------------------------------------------+
227 |      MppspGhz       | Million Packets per second with per CPU           |
228 |                     | resource Ghz(Unit: Mpps/Ghz)                      |
229 +---------------------+---------------------------------------------------+
230 |    OfferedLoad      | The load of network offered                       |
231 +---------------------+---------------------------------------------------+
232 |    PercentLoss      | The percent of frame loss rate                    |
233 +---------------------+---------------------------------------------------+
234 |    RxFrameCount     | The total frame on Nic rx                         |
235 +---------------------+---------------------------------------------------+
236 |       RxMbps        | The received bandwidth per second                 |
237 +---------------------+---------------------------------------------------+
238 |    TxFrameCount     | The total frame on Nic rx                         |
239 +---------------------+---------------------------------------------------+
240 |       TxMbps        | The send bandwidth per second                     |
241 +---------------------+---------------------------------------------------+