e8a56adc0ec9134ba10ca8ca7735d75d95271d87
[csit.git] / resources / libraries / robot / performance.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/interfaces.robot
17 | Resource | resources/libraries/robot/l2_xconnect.robot
18 | Resource | resources/libraries/robot/ipv4.robot
19 | Resource | resources/libraries/robot/bridge_domain.robot
20 | Resource | resources/libraries/robot/counters.robot
21 | Library | resources.libraries.python.TrafficGenerator
22 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
23 | Documentation | Performance suite keywords
24
25 *** Keywords ***
26 | 3-node circular Topology Variables Setup
27 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']}
28 | | ...          | ${nodes['TG']}
29 | | Compute Path
30 | | ${tg_if1} | ${tg}= | Next Interface
31 | | ${dut1_if1} | ${dut1}= | Next Interface
32 | | ${dut1_if2} | ${dut1}= | Next Interface
33 | | ${dut2_if1} | ${dut2}= | Next Interface
34 | | ${dut2_if2} | ${dut2}= | Next Interface
35 | | ${tg_if2} | ${tg}= | Next Interface
36 | | Set Suite Variable | ${tg}
37 | | Set Suite Variable | ${tg_if1}
38 | | Set Suite Variable | ${tg_if2}
39 | | Set Suite Variable | ${dut1}
40 | | Set Suite Variable | ${dut1_if1}
41 | | Set Suite Variable | ${dut1_if2}
42 | | Set Suite Variable | ${dut2}
43 | | Set Suite Variable | ${dut2_if1}
44 | | Set Suite Variable | ${dut2_if2}
45
46 | IPv4 forwarding initialized in a 3-node circular topology
47 | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG
48 | | Set Interface State | ${dut1} | ${dut1_if1} | up
49 | | Set Interface State | ${dut1} | ${dut1_if2} | up
50 | | Set Interface State | ${dut2} | ${dut2_if1} | up
51 | | Set Interface State | ${dut2} | ${dut2_if2} | up
52 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
53 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
54 | | ${dut1_if1_mac}= | Get Interface MAC | ${dut1} | ${dut1_if1}
55 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
56 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut1_if1}
57 | | ${dut2_if2_mac}= | Get Interface MAC | ${dut2} | ${dut1_if2}
58 | | dut1_v4.set_arp | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
59 | | dut1_v4.set_arp | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
60 | | dut2_v4.set_arp | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
61 | | dut2_v4.set_arp | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
62 | | dut1_v4.set_ip | ${dut1_if1} | 10.10.10.1 | 24
63 | | dut1_v4.set_ip | ${dut1_if2} | 1.1.1.1 | 30
64 | | dut2_v4.set_ip | ${dut2_if1} | 1.1.1.2 | 30
65 | | dut2_v4.set_ip | ${dut2_if2} | 20.20.20.1 | 24
66 | | dut1_v4.set_route | 20.20.20.0 | 24 | 1.1.1.2 | ${dut1_if2}
67 | | dut2_v4.set_route | 10.10.10.0 | 24 | 1.1.1.1 | ${dut2_if1}
68 | | All Vpp Interfaces Ready Wait | ${nodes}
69
70 | L2 xconnect initialized in a 3-node circular topology
71 | | [Documentation] | Custom setup of L2 xconnect topology
72 | | L2 setup xconnect on DUT | ${dut1} | ${dut1_if1} | ${dut1_if2}
73 | | L2 setup xconnect on DUT | ${dut2} | ${dut2_if1} | ${dut2_if2}
74 | | All Vpp Interfaces Ready Wait | ${nodes}
75
76 | L2 bridge domain initialized in a 3-node circular topology
77 | | [Documentation] | Custom setup of L2 bridge topology
78 | | Vpp l2bd forwarding setup | ${dut1} | ${dut1_if1} | ${dut1_if2}
79 | | Vpp l2bd forwarding setup | ${dut2} | ${dut2_if1} | ${dut2_if2}
80 | | All Vpp Interfaces Ready Wait | ${nodes}
81
82 | 3-node Performance Suite Setup
83 | | 3-node circular Topology Variables Setup
84 | | [Arguments] | ${topology_type}
85 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
86 | | ...                          | ${dut1} | ${dut1_if1} | ${dut1_if2}
87 | | ...                          | ${dut2} | ${dut2_if1} | ${dut2_if2}
88 | | ...                          | ${topology_type}
89
90 | 3-node Performance Suite Teardown
91 | | Teardown traffic generator | ${tg}
92
93 | Find NDR using linear search and pps
94 | | [Documentation] | Find throughput by using RFC2544 linear search
95 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
96 | | ...         | ${topology_type} | ${min_rate} | ${max_rate}
97 | | Set Duration | 60
98 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
99 | | Set Search Linear Step | ${step_rate}
100 | | Set Search Frame Size | ${framesize}
101 | | Set Search Rate Type pps
102 | | Linear Search | ${start_rate} | ${topology_type}
103 | | ${rate_per_stream}= | Verify Search Result
104 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
105
106 | Find NDR using binary search and pps
107 | | [Documentation] | Find throughput by using RFC2544 binary search
108 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
109 | | ...         | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
110 | | Set Duration | 60
111 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
112 | | Set Search Rate Type pps
113 | | Set Binary Convergence Threshold | ${threshold}
114 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
115 | | ${rate_per_stream}= | Verify Search Result
116 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
117
118 | Find NDR using combined search and pps
119 | | [Documentation] | Find throughput by using RFC2544 combined search
120 | | ...             | (linear + binary)
121 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
122 | | ...         | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
123 | | Set Duration | 60
124 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
125 | | Set Search Linear Step | ${step_rate}
126 | | Set Search Frame Size | ${framesize}
127 | | Set Search Rate Type pps
128 | | Set Binary Convergence Threshold | ${threshold}
129 | | Combined Search | ${start_rate} | ${topology_type}
130 | | ${rate_per_stream}= | Verify Search Result
131 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
132
133 | Display result of NDR search
134 | | [Documentation] | Display result of NDR search in packet per seconds (total
135 | | ...             | and per stream) and Gbps
136 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams}
137 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
138 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
139 | | Set Test Message | FINAL_RATE: ${rate_total} pps
140 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
141 | | Set Test Message | FINAL_BANDWIDTH: ${bandwidth_total} Gbps | append=yes
142
143
144 | Traffic should pass with no loss
145 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
146 | | Send traffic on | ${tg} | ${duration}
147 | | ...             | ${rate} | ${framesize} | ${topology_type}
148 | | No traffic loss occured