Merge "Add API(v2) to create test suite"
[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 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
125
126 Config pod.yaml describing Topology
127 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
129 Before executing Yardstick test cases, make sure that pod.yaml reflects the
130 topology and update all the required fields.
131
132 ::
133
134     cp /etc/yardstick/nodes/pod.yaml.nsb.sample /etc/yardstick/nodes/pod.yaml
135
136 Config pod.yaml
137 ::
138     nodes:
139     -
140         name: trafficgen_1
141         role: TrafficGen
142         ip: 1.1.1.1
143         user: root
144         password: r00t
145         interfaces:
146             xe0:  # logical name from topology.yaml and vnfd.yaml
147                 vpci:      "0000:07:00.0"
148                 driver:    i40e # default kernel driver
149                 dpdk_port_num: 0
150                 local_ip: "152.16.100.20"
151                 netmask:   "255.255.255.0"
152                 local_mac: "00:00:00:00:00:01"
153             xe1:  # logical name from topology.yaml and vnfd.yaml
154                 vpci:      "0000:07:00.1"
155                 driver:    i40e # default kernel driver
156                 dpdk_port_num: 1
157                 local_ip: "152.16.40.20"
158                 netmask:   "255.255.255.0"
159                 local_mac: "00:00.00:00:00:02"
160
161     -
162         name: vnf
163         role: vnf
164         ip: 1.1.1.2
165         user: root
166         password: r00t
167         host: 1.1.1.2 #BM - host == ip, virtualized env - Host - compute node
168         interfaces:
169             xe0:  # logical name from topology.yaml and vnfd.yaml
170                 vpci:      "0000:07:00.0"
171                 driver:    i40e # default kernel driver
172                 dpdk_port_num: 0
173                 local_ip: "152.16.100.19"
174                 netmask:   "255.255.255.0"
175                 local_mac: "00:00:00:00:00:03"
176
177             xe1:  # logical name from topology.yaml and vnfd.yaml
178                 vpci:      "0000:07:00.1"
179                 driver:    i40e # default kernel driver
180                 dpdk_port_num: 1
181                 local_ip: "152.16.40.19"
182                 netmask:   "255.255.255.0"
183                 local_mac: "00:00:00:00:00:04"
184         routing_table:
185         - network: "152.16.100.20"
186           netmask: "255.255.255.0"
187           gateway: "152.16.100.20"
188           if: "xe0"
189         - network: "152.16.40.20"
190           netmask: "255.255.255.0"
191           gateway: "152.16.40.20"
192           if: "xe1"
193         nd_route_tbl:
194         - network: "0064:ff9b:0:0:0:0:9810:6414"
195           netmask: "112"
196           gateway: "0064:ff9b:0:0:0:0:9810:6414"
197           if: "xe0"
198         - network: "0064:ff9b:0:0:0:0:9810:2814"
199           netmask: "112"
200           gateway: "0064:ff9b:0:0:0:0:9810:2814"
201           if: "xe1"
202
203 Enable yardstick virtual environment
204 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
205
206 Before executing yardstick test cases, make sure to activate yardstick
207 python virtual environment
208
209 ::
210
211     source /opt/nsb_bin/yardstick_venv/bin/activate
212
213
214 Run Yardstick - Network Service Testcases
215 -----------------------------------------
216
217 NS testing - using NSBperf CLI
218 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
219 ::
220
221   source /opt/nsb_setup/yardstick_venv/bin/activate
222   PYTHONPATH: ". ~/.bash_profile"
223   cd <yardstick_repo>/yardstick/cmd
224
225  Execute command: ./NSPerf.py -h
226       ./NSBperf.py --vnf <selected vnf> --test <rfc test>
227       eg: ./NSBperf.py --vnf vpe --test tc_baremetal_rfc2544_ipv4_1flow_64B.yaml
228
229 NS testing - using yardstick CLI
230 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
231 ::
232
233   source /opt/nsb_setup/yardstick_venv/bin/activate
234   PYTHONPATH: ". ~/.bash_profile"
235
236 Go to test case forlder type we want to execute.
237       e.g. <yardstick repo>/samples/vnf_samples/nsut/<vnf>/
238       run: yardstick --debug task start <test_case.yaml>