1b4f8cdb4a1bbd120c29673505c6f438577b9ff2
[csit.git] / tests / vpp / func / ip4 / eth2p-ethip4-ip4base-func.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 | Library | resources.libraries.python.NodePath
16 | Library | resources.libraries.python.Trace
17 | Resource | resources/libraries/robot/shared/default.robot
18 | Resource | resources/libraries/robot/shared/interfaces.robot
19 | Resource | resources/libraries/robot/ip/ip4.robot
20 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | SKIP_VPP_PATCH
21 | Suite Setup | Run Keywords
22 | ... | Restart Vpp Service On All Duts | ${nodes} | AND
23 | ... | Verify Vpp On All Duts | ${nodes} | AND
24 | ... | VPP Enable Traces On All Duts | ${nodes} | AND
25 | ... | Configure all TGs for traffic script | AND
26 | ... | Update All Interface Data On All Nodes | ${nodes} | AND
27 | ... | Configure DUT nodes for IPv4 testing
28 | Test Setup | Run Keywords | Save VPP PIDs | AND
29 | ... | Reset PAPI History On All DUTs | ${nodes} | AND
30 | ... | Clear interface counters on all vpp nodes in topology | ${nodes}
31 | Test Teardown | Run Keywords
32 | ... | Show packet trace on all DUTs | ${nodes} | AND
33 | ... | Show PAPI History On All DUTs | ${nodes} | AND
34 | ... | Verify VPP PID in Teardown
35 | Documentation | *IPv4 routing test cases*
36 | ...
37 | ... | RFC791 IPv4, RFC826 ARP, RFC792 ICMPv4. Encapsulations: Eth-IPv4-ICMPv4
38 | ... | on links TG-DUT1, TG-DUT2, DUT1-DUT2. IPv4 routing tests use circular
39 | ... | 3-node topology TG - DUT1 - DUT2 - TG with one link between the nodes.
40 | ... | DUT1 and DUT2 are configured with IPv4 routing and static routes. Test
41 | ... | ICMPv4 Echo Request packets are sent in both directions by TG on links
42 | ... | to DUT1 and DUT2 and received on TG links on the other side of circular
43 | ... | topology. On receive TG verifies packets IPv4 src-addr, dst-addr and MAC
44 | ... | addresses.
45
46 *** Test Cases ***
47
48 | TC01: DUT replies to ICMPv4 Echo Req to its ingress interface
49 | | [Documentation]
50 | | ... | Make TG send ICMPv4 Echo Req to DUT ingress interface. Make TG\
51 | | ... | verify ICMP Echo Reply is correct.
52 | | [Tags] | VM_ENV
53 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']}
54 | | Compute Path
55 | | ${src_port} | ${src_node}= | First Interface
56 | | ${dst_port} | ${dst_node}= | Last Interface
57 | | ${hops}= | Set Variable | ${0}
58 | | Route traffic from interface '${src_port}' on node '${src_node}' to interface '${dst_port}' on node '${dst_node}' '${hops}' hops away using IPv4
59
60 | TC02: DUT routes IPv4 to its egress interface
61 | | [Tags] | VM_ENV
62 | | [Documentation]
63 | | ... | Make TG send ICMPv4 Echo Req towards DUT1 egress interface\
64 | | ... | connected to DUT2. Make TG verify ICMPv4 Echo Reply is correct.
65 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']}
66 | | Compute Path
67 | | ${src_port} | ${src_node}= | First Interface
68 | | ${dst_port} | ${dst_node}= | Last Egress Interface
69 | | ${hops}= | Set Variable | ${0}
70 | | Route traffic from interface '${src_port}' on node '${src_node}' to interface '${dst_port}' on node '${dst_node}' '${hops}' hops away using IPv4
71
72 | TC03: DUT1 routes IPv4 to DUT2 ingress interface
73 | | [Tags] | VM_ENV
74 | | [Documentation]
75 | | ... | Make TG send ICMPv4 Echo Req towards DUT2 ingress interface\
76 | | ... | connected to DUT1. Make TG verify ICMPv4 Echo Reply is correct.
77 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']}
78 | | Compute Path
79 | | ${src_port} | ${src_node}= | First Interface
80 | | ${dst_port} | ${dst_node}= | Last Interface
81 | | ${hops}= | Set Variable | ${1}
82 | | Route traffic from interface '${src_port}' on node '${src_node}' to interface '${dst_port}' on node '${dst_node}' '${hops}' hops away using IPv4
83
84 | TC04: DUT1 routes IPv4 to DUT2 egress interface
85 | | [Tags] | VM_ENV
86 | | [Documentation]
87 | | ... | Make TG send ICMPv4 Echo Req towards DUT2 egress interface\
88 | | ... | connected to TG. Make TG verify ICMPv4 Echo Reply is correct.
89 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
90 | | Compute Path
91 | | ${src_port} | ${src_node}= | First Interface
92 | | ${dst_port} | ${dst_node}= | Last Egress Interface
93 | | ${hops}= | Set Variable | ${1}
94 | | Route traffic from interface '${src_port}' on node '${src_node}' to interface '${dst_port}' on node '${dst_node}' '${hops}' hops away using IPv4
95
96 | TC05: DUT1 and DUT2 route IPv4 between TG interfaces
97 | | [Tags] | VM_ENV
98 | | [Documentation]
99 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across DUT1\
100 | | ... | and DUT2. Make TG verify ICMPv4 Echo Replies are correct.
101 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
102 | | Compute Path
103 | | ${src_port} | ${src_node}= | First Interface
104 | | ${dst_port} | ${dst_node}= | Last Interface
105 | | ${hops}= | Set Variable | ${2}
106 | | Route traffic from interface '${src_port}' on node '${src_node}' to interface '${dst_port}' on node '${dst_node}' '${hops}' hops away using IPv4
107
108 | TC06: DUT replies to ICMPv4 Echo Reqs with size 64B-to-1500B-incr-1B
109 | | [Tags] | VM_ENV
110 | | [Documentation]
111 | | ... | Make TG send ICMPv4 Echo Reqs to DUT ingress interface,\
112 | | ... | incrementating frame size from 64B to 1500B with increment step
113 | | ... | of 1Byte. Make TG verify ICMP Echo Replies are correct.
114 | | Execute IPv4 ICMP echo sweep | ${nodes['TG']} | ${nodes['DUT1']} | 0 | 1452 | 1
115
116 | TC07: DUT replies to ICMPv4 Echo Reqs with size 1500B-to-9000B-incr-10B
117 | | [Documentation]
118 | | ... | Make TG send ICMPv4 Echo Reqs to DUT ingress interface,\
119 | | ... | incrementating frame size from 1500B to 9000B with increment
120 | | ... | step of 10Bytes. Make TG verify ICMPv4 Echo Replies are correct.
121 | | [Setup] | Configure MTU on TG based on MTU on DUT | ${nodes['TG']} | ${nodes['DUT1']}
122 | | [Teardown] | Run keywords
123 | | ... | Set default Ethernet MTU on all interfaces on node | ${nodes['TG']}
124 | | ... | AND | Verify VPP PID in Teardown
125 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']}
126 | | Compute Path
127 | | ${dut_port} | ${dut_node}= | Last Interface
128 | | ${mtu}= | Get Interface MTU | ${dut_node} | ${dut_port}
129 | | # ICMP payload size is frame size minus size of Ehternet header, FCS,
130 | | # IPv4 header and ICMP header
131 | | ${end_size}= | Evaluate | ${mtu} - 14 - 4 - 20 - 8
132 | | Run Keyword If | ${mtu} > 1518
133 | | ... | Execute IPv4 ICMP echo sweep | ${nodes['TG']} | ${nodes['DUT1']}
134 | | ... | 1452 | ${end_size} | 10
135
136 | TC08: DUT replies to ARP request
137 | | [Tags] | VM_ENV | SKIP_VPP_PATCH
138 | | [Documentation]
139 | | ... | Make TG send ARP Request to DUT and verify ARP Reply is correct.\
140 | | Send ARP request and verify response | ${nodes['TG']} | ${nodes['DUT1']}