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