summaryrefslogtreecommitdiffstats
path: root/docs/testing/developer/vstf_guide.rst
blob: e1ad5f2b88fdeb26427dd0e2ae4f78b3d21176d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
.. (c) Huawei Technologies Co.,Ltd and others.

********************
VSTF Testsuite Guide
********************

VSTF Introduction
====================
VSTF(Virtual Switch Test Framework) is a system-level testing framework in the
area of network virtualization, and it could help you estimate the system switch
ability and find out the network bottlenecks by main KPIs(bandwidth, latency,
resource usage and so on), VSTF owns a methodology to define the test scenario and
testcases, Now we could support Tu testcases in the Openstack environment, More
scenarios and cases will be added.

VSTF TestScenario
-----------------
1. Tu - VM to VM
2. Tn - Physical Nic loopback
3. TnV - VNF loopback
4. Ti - VM to Physical Nic

Pre-install Packages on the ubuntu 14.04 VM
===========================================
VSTF VM Preparation Steps
-------------------------
1. Create a ubuntu 14.04 VM
2. Install dependency inside VM
3. Install vstf python package inside VM

VM preparation
--------------
Install python2.7 version and git

::

  sudo apt-get install python2.7
  sudo apt-get install git

Download Bottlenecks package

::

  sudo cd /home/
  sudo git clone https://gerrit.opnfv.org/gerrit/bottlenecks

Install the dependency

::

  sudo apt-get install python-pip
  sudo pip install --upgrade pip
  sudo dpkg-reconfigure dash
  sudo apt-get install libjpeg-dev
  sudo apt-get install libpng-dev
  sudo apt-get install python-dev
  sudo apt-get install python-testrepository
  sudo apt-get install git
  sudo apt-get install python-pika
  sudo apt-get install python-oslo.config
  sudo pip install -r /home/bottlenecks/vstf/requirements.txt

Install vstf package

::

  sudo mkdir -p /var/log/vstf/
  sudo cp -r /home/bottlenecks/vstf/etc/vstf/ /etc/
  sudo mkdir -p /opt/vstf/
  sudo cd /home/bottlenecks;sudo rm -rf build/
  sudo python setup.py install

Image on the Cloud
------------------
+-----------+-------------------------------------------------------------+
|    Name   | vstf-image                                                  |
+===========+=============================================================+
|    URL    | http://artifacts.opnfv.org/bottlenecks/vstf-manager-new.img |
+-----------+-------------------------------------------------------------+
|   Format  | QCOW2                                                       |
+-----------+-------------------------------------------------------------+
|    Size   | 5G                                                          |
+-----------+-------------------------------------------------------------+
|    User   | root                                                        |
+-----------+-------------------------------------------------------------+
|   Passwd  | root                                                        |
+-----------+-------------------------------------------------------------+
There is a complete vstf image on the cloud ,you could download it and use it to
deploy and run cases ,but do not need VM preparation steps.


How is VSTF Integrated into Installers
========================================
VM requirements
---------------
+------------------+----------+--------------------+-----------------------------------------------------+
|        Name      |  FLAVOR  |     IMAGE_NAME     | NETWORK                                             |
+==================+==========+====================+=====================================================+
|   vstf-manager   | m1.large |     vstf-image     | control-plane=XX.XX.XX.XX                           |
+------------------+----------+--------------------+-----------------------------------------------------+
|   vstf-tester    | m1.large |     vstf-image     | control-plane(eth0)=XX.XX.XX.XX                     |
|                  |          |                    | test-plane(eth1)=XX.XX.XX.XX                        |
+------------------+----------+--------------------+-----------------------------------------------------+
|   vstf-target    | m1.large |     vstf-image     | control-plane(eth0)=XX.XX.XX.XX                     |
|                  |          |                    | test-plane(eth1)=XX.XX.XX.XX                        |
+------------------+----------+--------------------+-----------------------------------------------------+
m1.large means 4U4G for the target image Size 5GB
For the network used by VMs,network need two plane ,one plane is control plane and the other plane is test plane.

OPNFV community Usage in the CI system
--------------------------------------
+---------------------------------------+---------------------------------------+
| Project Name                          | Project Categoty                      |
+=======================================+=======================================+
| bottlenecks-daily-fuel-vstf-lf-master | bottlenecks                           |
+---------------------------------------+---------------------------------------+
OPNFV community jenkins Project info

Main Entrance for the ci test:

::

  cd /home/bottlenecks/ci;
  bash -x vstf_run.sh

Test on local(Openstack Environment)
------------------------------------
download the image file

::

  curl --connect-timeout 10 -o /tmp/vstf-manager.img \
       http://artifacts.opnfv.org/bottlenecks/vstf-manager-new.img -v

create the image file by the glance

::

  glance image-create --name $MANAGER_IMAGE_NAME \
        --disk-format qcow2 \
        --container-format bare \
        --file /tmp/vstf-manager.img

create the keypair for the image(anyone will be ok)

::

  cd /home/bottlenecks/utils/infra_setup/bottlenecks_key
  nova keypair-add --pub_key $KEY_PATH/bottlenecks_key.pub $KEY_NAME

create the vstf three VMs in the openstack by heat

::

  cd /home/bottlenecks/utils/infra_setup/heat_template/vstf_heat_template
  heat stack-create vstf -f bottleneck_vstf.yaml

launch the vstf process inside the vstf-manager vstf-tester vstf-target VMs

::

  cd /home/bottlenecks/utils/infra_setup/heat_template/vstf_heat_template
  bash -x launch_vstf.sh

edit the test scenario and test packet list in the vstf_test.sh, now support the Tu-1/2/3

::

  function fn_testing_scenario(){
      ...
      local test_length_list="64 128 256 512 1024"
      local test_scenario_list="Tu-1 Tu-3"
      ...
  }

launch the vstf script

::

  cd /home/bottlenecks/utils/infra_setup/heat_template/vstf_heat_template
  bash -x vstf_test.sh

Test Result Description
=======================
Result Format
-------------
For example after the test, The result will display as the following format

::

  { u'64': { u'AverageLatency': 0.063,
             u'Bandwidth': 0.239,
             u'CPU': 0.0,
             u'Duration': 20,
             u'MaximumLatency': 0.063,
             u'MinimumLatency': 0.063,
             u'MppspGhz': 0,
             u'OfferedLoad': 100.0,
             u'PercentLoss': 22.42,
             u'RxFrameCount': 4309750.0,
             u'RxMbps': 198.28,
             u'TxFrameCount': 5555436.0,
             u'TxMbps': 230.03}}

Option Description
------------------
+---------------------+---------------------------------------------------+
|     Option Name     |                 Description                       |
+=====================+===================================================+
|    AverageLatency   | The average latency data during the packet        |
|                     | transmission (Unit:microsecond)                   |
+---------------------+---------------------------------------------------+
|      Bandwidth      | Network bandwidth(Unit:Million packets per second)|
+---------------------+---------------------------------------------------+
|         CPU         | Total Resource Cpu usage(Unit: Ghz)               |
+---------------------+---------------------------------------------------+
|      Duration       | Test time(Unit: second)                           |
+---------------------+---------------------------------------------------+
|   MaximumLatency    | The maximum packet latency during the packet      |
|                     | transmission (Unit:microsecond)                   |
+---------------------+---------------------------------------------------+
|   MinimumLatency    | The maximum packet latency during the packet      |
|                     | transmission (Unit:microsecond)                   |
+---------------------+---------------------------------------------------+
|      MppspGhz       | Million Packets per second with per CPU           |
|                     | resource Ghz(Unit: Mpps/Ghz)                      |
+---------------------+---------------------------------------------------+
|    OfferedLoad      | The load of network offered                       |
+---------------------+---------------------------------------------------+
|    PercentLoss      | The percent of frame loss rate                    |
+---------------------+---------------------------------------------------+
|    RxFrameCount     | The total frame on Nic rx                         |
+---------------------+---------------------------------------------------+
|       RxMbps        | The received bandwidth per second                 |
+---------------------+---------------------------------------------------+
|    TxFrameCount     | The total frame on Nic rx                         |
+---------------------+---------------------------------------------------+
|       TxMbps        | The send bandwidth per second                     |
+---------------------+---------------------------------------------------+