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