158dd896f1cf9a62669c83d3705b4ee6d98f7f48
[csit.git] / tests / func / ipv4 / 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/default.robot
18 | Resource | resources/libraries/robot/interfaces.robot
19 | Resource | resources/libraries/robot/ipv4.robot
20 | Force Tags | HW_ENV
21 | Suite Setup | Run Keywords
22 | ... | Setup all DUTs before test | AND
23 | ... | Setup all TGs before traffic script | AND
24 | ... | Update All Interface Data On All Nodes | ${nodes} | AND
25 | ... | Setup 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 | ... | Check 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] | 3_NODE_SINGLE_LINK_TOPO | 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 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
57
58 | TC02: DUT routes IPv4 to its egress interface
59 | | [Documentation]
60 | | ... | Make TG send ICMPv4 Echo Req towards DUT1 egress interface\
61 | | ... | connected to DUT2. Make TG verify ICMPv4 Echo Reply is correct.
62 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
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 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
69
70 | TC03: DUT1 routes IPv4 to DUT2 ingress interface
71 | | [Documentation]
72 | | ... | Make TG send ICMPv4 Echo Req towards DUT2 ingress interface\
73 | | ... | connected to DUT1. Make TG verify ICMPv4 Echo Reply is correct.
74 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
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 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
81
82 | TC04: DUT1 routes IPv4 to DUT2 egress interface
83 | | [Documentation]
84 | | ... | Make TG send ICMPv4 Echo Req towards DUT2 egress interface\
85 | | ... | connected to TG. Make TG verify ICMPv4 Echo Reply is correct.
86 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
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 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
93
94 | TC05: DUT1 and DUT2 route IPv4 between TG interfaces
95 | | [Documentation]
96 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across DUT1\
97 | | ... | and DUT2. Make TG verify ICMPv4 Echo Replies are correct.
98 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
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 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
105
106 | TC06: DUT replies to ICMPv4 Echo Reqs with size 64B-to-1500B-incr-1B
107 | | [Documentation]
108 | | ... | Make TG send ICMPv4 Echo Reqs to DUT ingress interface,\
109 | | ... | incrementating frame size from 64B to 1500B with increment step
110 | | ... | of 1Byte. Make TG verify ICMP Echo Replies are correct.
111 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
112 | | 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 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO
120 | | [Setup] | Setup MTU on TG based on MTU on DUT | ${nodes['TG']} | ${nodes['DUT1']}
121 | | [Teardown] | Run keywords
122 | | ... | Set default Ethernet MTU on all interfaces on node | ${nodes['TG']}
123 | | ... | AND | Check VPP PID in Teardown
124 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']}
125 | | Compute Path
126 | | ${dut_port} | ${dut_node}= | Last Interface
127 | | ${mtu}= | Get Interface MTU | ${dut_node} | ${dut_port}
128 | | # ICMP payload size is frame size minus size of Ehternet header, FCS,
129 | | # IPv4 header and ICMP header
130 | | ${end_size}= | Evaluate | ${mtu} - 14 - 4 - 20 - 8
131 | | Run Keyword If | ${mtu} > 1518
132 | | ... | Ipv4 icmp echo sweep | ${nodes['TG']} | ${nodes['DUT1']}
133 | | ... | 1452 | ${end_size} | 10
134
135 | TC08: DUT replies to ARP request
136 | | [Documentation]
137 | | ... | Make TG send ARP Request to DUT and verify ARP Reply is correct.\
138 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
139 | | Send ARP request and validate response | ${nodes['TG']} | ${nodes['DUT1']}