ca7ce3028611b18f800f4353398f197d62514de1
[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 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
95 | | ...         | ${topology_type} | ${min_rate} | ${max_rate}
96 | | Set Duration | 60
97 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
98 | | Set Search Linear Step | ${step_rate}
99 | | Set Search Frame Size | ${framesize}
100 | | Set Search Rate Type pps
101 | | Linear Search | ${start_rate} | ${topology_type}
102 | | ${result_rate}= | Verify Search Result
103 | | Set Test Message | FINAL_RATE: ${result_rate} pps
104
105 | Traffic should pass with no loss
106 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
107 | | Send traffic on | ${tg} | ${duration}
108 | | ...             | ${rate} | ${framesize} | ${topology_type}
109 | | No traffic loss occured