Merge "Test case: add test config file for TC078 and TC079"
[yardstick.git] / docs / testing / user / userguide / 14-nsb_installation.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International
2 .. License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. (c) OPNFV, 2016-2017 Intel Corporation.
5
6 Yardstick - NSB Testing -Installation
7 =====================================
8
9 Abstract
10 --------
11
12 The Network Service Benchmarking (NSB) extends the yardstick framework to do
13 VNF characterization and benchmarking in three different execution
14 environments viz., bare metal i.e. native Linux environment, standalone virtual
15 environment and managed virtualized environment (e.g. Open stack etc.).
16 It also brings in the capability to interact with external traffic generators
17 both hardware & software based for triggering and validating the traffic
18 according to user defined profiles.
19
20 The steps needed to run Yardstick with NSB testing are:
21
22 * Install Yardstick (NSB Testing).
23 * Setup pod.yaml describing Test topology
24 * Create the test configuration yaml file.
25 * Run the test case.
26
27
28 Prerequisites
29 -------------
30
31 Refer chapter Yardstick Instalaltion for more information on yardstick
32 prerequisites
33
34 Several prerequisites are needed for Yardstick(VNF testing):
35
36 - Python Modules: pyzmq, pika.
37
38 - flex
39
40 - bison
41
42 - build-essential
43
44 - automake
45
46 - libtool
47
48 - librabbitmq-dev
49
50 - rabbitmq-server
51
52 - collectd
53
54 - intel-cmt-cat
55
56 Install Yardstick (NSB Testing)
57 -------------------------------
58
59 Refer chapter :doc:`04-installation` for more information on installing *Yardstick*
60
61 After *Yardstick* is installed, executing the "nsb_setup.sh" script to setup
62 NSB testing.
63
64 ::
65
66   ./nsb_setup.sh
67
68 It will also automatically download all the packages needed for NSB Testing setup.
69
70 System Topology:
71 -----------------
72
73 .. code-block:: console
74
75   +----------+              +----------+
76   |          |              |          |
77   |          | (0)----->(0) |   Ping/  |
78   |    TG1   |              |   vPE/   |
79   |          |              |   2Trex  |
80   |          | (1)<-----(1) |          |
81   +----------+              +----------+
82   trafficgen_1                   vnf
83
84
85 OpenStack parameters and credentials
86 ------------------------------------
87
88 Environment variables
89 ^^^^^^^^^^^^^^^^^^^^^
90
91 Before running Yardstick (NSB Testing) it is necessary to export traffic
92 generator libraries.
93
94 ::
95
96     source ~/.bash_profile
97
98 Config yardstick conf
99 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
101 ::
102
103     cp ./etc/yardstick/yardstick.conf.sample /etc/yardstick/yardstick.conf
104     vi /etc/yardstick/yardstick.conf
105
106 Add trex_path, trex_client_lib and bin_path in 'nsb' section.
107
108 ::
109
110   [DEFAULT]
111   debug = True
112   dispatcher = influxdb
113
114   [dispatcher_influxdb]
115   timeout = 5
116   target = http://{YOUR_IP_HERE}:8086
117   db_name = yardstick
118   username = root
119   password = root
120
121   [nsb]
122   trex_path=/opt/nsb_bin/trex/scripts
123   bin_path=/opt/nsb_bin
124   trex_client_lib=/opt/nsb_bin/trex_client/stl
125
126
127 Config pod.yaml describing Topology
128 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129
130 Before executing Yardstick test cases, make sure that pod.yaml reflects the
131 topology and update all the required fields.
132
133 ::
134
135     cp /etc/yardstick/nodes/pod.yaml.nsb.sample /etc/yardstick/nodes/pod.yaml
136
137 Config pod.yaml
138 ::
139     nodes:
140     -
141         name: trafficgen_1
142         role: TrafficGen
143         ip: 1.1.1.1
144         user: root
145         password: r00t
146         interfaces:
147             xe0:  # logical name from topology.yaml and vnfd.yaml
148                 vpci:      "0000:07:00.0"
149                 driver:    i40e # default kernel driver
150                 dpdk_port_num: 0
151                 local_ip: "152.16.100.20"
152                 netmask:   "255.255.255.0"
153                 local_mac: "00:00:00:00:00:01"
154             xe1:  # logical name from topology.yaml and vnfd.yaml
155                 vpci:      "0000:07:00.1"
156                 driver:    i40e # default kernel driver
157                 dpdk_port_num: 1
158                 local_ip: "152.16.40.20"
159                 netmask:   "255.255.255.0"
160                 local_mac: "00:00.00:00:00:02"
161
162     -
163         name: vnf
164         role: vnf
165         ip: 1.1.1.2
166         user: root
167         password: r00t
168         host: 1.1.1.2 #BM - host == ip, virtualized env - Host - compute node
169         interfaces:
170             xe0:  # logical name from topology.yaml and vnfd.yaml
171                 vpci:      "0000:07:00.0"
172                 driver:    i40e # default kernel driver
173                 dpdk_port_num: 0
174                 local_ip: "152.16.100.19"
175                 netmask:   "255.255.255.0"
176                 local_mac: "00:00:00:00:00:03"
177
178             xe1:  # logical name from topology.yaml and vnfd.yaml
179                 vpci:      "0000:07:00.1"
180                 driver:    i40e # default kernel driver
181                 dpdk_port_num: 1
182                 local_ip: "152.16.40.19"
183                 netmask:   "255.255.255.0"
184                 local_mac: "00:00:00:00:00:04"
185         routing_table:
186         - network: "152.16.100.20"
187           netmask: "255.255.255.0"
188           gateway: "152.16.100.20"
189           if: "xe0"
190         - network: "152.16.40.20"
191           netmask: "255.255.255.0"
192           gateway: "152.16.40.20"
193           if: "xe1"
194         nd_route_tbl:
195         - network: "0064:ff9b:0:0:0:0:9810:6414"
196           netmask: "112"
197           gateway: "0064:ff9b:0:0:0:0:9810:6414"
198           if: "xe0"
199         - network: "0064:ff9b:0:0:0:0:9810:2814"
200           netmask: "112"
201           gateway: "0064:ff9b:0:0:0:0:9810:2814"
202           if: "xe1"
203
204 Enable yardstick virtual environment
205 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
206
207 Before executing yardstick test cases, make sure to activate yardstick
208 python virtual environment
209
210 ::
211
212     source /opt/nsb_bin/yardstick_venv/bin/activate
213
214
215 Run Yardstick - Network Service Testcases
216 -----------------------------------------
217
218 NS testing - using NSBperf CLI
219 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
220 ::
221
222   source /opt/nsb_setup/yardstick_venv/bin/activate
223   PYTHONPATH: ". ~/.bash_profile"
224   cd <yardstick_repo>/yardstick/cmd
225
226  Execute command: ./NSPerf.py -h
227       ./NSBperf.py --vnf <selected vnf> --test <rfc test>
228       eg: ./NSBperf.py --vnf vpe --test tc_baremetal_rfc2544_ipv4_1flow_64B.yaml
229
230 NS testing - using yardstick CLI
231 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
232 ::
233
234   source /opt/nsb_setup/yardstick_venv/bin/activate
235   PYTHONPATH: ". ~/.bash_profile"
236
237 Go to test case forlder type we want to execute.
238       e.g. <yardstick repo>/samples/vnf_samples/nsut/<vnf>/
239       run: yardstick --debug task start <test_case.yaml>