47fe34acdfcba076c8e388c810e35ef6d4d9ac99
[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.topology.Topology
16 | Library | resources.libraries.python.NodePath
17 | Library | resources.libraries.python.Trace
18 | Resource | resources/libraries/robot/default.robot
19 | Resource | resources/libraries/robot/interfaces.robot
20 | Resource | resources/libraries/robot/ipv4.robot
21 | Force Tags | HW_ENV
22 | Suite Setup | Run Keywords | Setup all DUTs before test
23 | ...         | AND          | Setup all TGs before traffic script
24 | ...         | AND          | Update All Interface Data On All Nodes | ${nodes}
25 | ...         | AND          | Setup DUT nodes for IPv4 testing
26 | Test Setup | Clear interface counters on all vpp nodes in topology | ${nodes}
27 | Test Teardown | Run Keyword If Test Failed | Show packet trace on all DUTs | ${nodes}
28
29 *** Test Cases ***
30
31 | VPP replies to ICMPv4 echo request
32 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
33 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']}
34 | | Compute Path
35 | | ${src_port} | ${src_node}= | First Interface
36 | | ${dst_port} | ${dst_node}= | Last Interface
37 | | ${hops}= | Set Variable | ${0}
38 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
39
40 | TG can route to DUT egress interface
41 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
42 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']}
43 | | Compute Path
44 | | ${src_port} | ${src_node}= | First Interface
45 | | ${dst_port} | ${dst_node}= | Last Egress Interface
46 | | ${hops}= | Set Variable | ${0}
47 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
48
49 | TG can route to DUT2 through DUT1
50 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
51 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']}
52 | | Compute Path
53 | | ${src_port} | ${src_node}= | First Interface
54 | | ${dst_port} | ${dst_node}= | Last Interface
55 | | ${hops}= | Set Variable | ${1}
56 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
57
58 | TG can route to DUT2 egress interface through DUT1
59 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
60 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
61 | | Compute Path
62 | | ${src_port} | ${src_node}= | First Interface
63 | | ${dst_port} | ${dst_node}= | Last Egress Interface
64 | | ${hops}= | Set Variable | ${1}
65 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
66
67 | TG can route to TG through DUT1 and DUT2
68 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
69 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
70 | | Compute Path
71 | | ${src_port} | ${src_node}= | First Interface
72 | | ${dst_port} | ${dst_node}= | Last Interface
73 | | ${hops}= | Set Variable | ${2}
74 | | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4
75 | | ${port} | ${node}= | Next Interface
76 | | ${port} | ${node}= | Next Interface
77 | | ${exp_counter_val}= | Set Variable | ${1}
78 | | Vpp dump stats table | ${node}
79 | | Check ipv4 interface counter | ${node} | ${port} | ${exp_counter_val}
80 | | ${port} | ${node}= | Next Interface
81 | | Check ipv4 interface counter | ${node} | ${port} | ${exp_counter_val}
82 | | ${port} | ${node}= | Next Interface
83 | | Vpp dump stats table | ${node}
84 | | Check ipv4 interface counter | ${node} | ${port} | ${exp_counter_val}
85 | | ${port} | ${node}= | Next Interface
86 | | Check ipv4 interface counter | ${node} | ${port} | ${exp_counter_val}
87
88 | VPP can process ICMP echo request from min to 1500B packet size with 1B increment
89 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
90 | | Ipv4 icmp echo sweep | ${nodes['TG']} | ${nodes['DUT1']} | 0 | 1452 | 1
91
92 | VPP can process ICMP echo request from 1500B to max packet size with 10B increment
93 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO
94 | | [Documentation] | This test case cannot be run reliably on VM_ENV because
95 | | ...             | the virtual hosts can be connected using a bridge which
96 | | ...             | has its own MTU
97 | | [Setup] | Setup MTU on TG based on MTU on DUT | ${nodes['TG']} | ${nodes['DUT1']}
98 | | [Teardown] | Set default Ethernet MTU on all interfaces on node | ${nodes['TG']}
99 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']}
100 | | Compute Path
101 | | ${dut_port} | ${dut_node}= | Last Interface
102 | | ${mtu}= | Get Interface MTU | ${dut_node} | ${dut_port}
103 | | # ICMP payload size is frame size minus size of Ehternet header, FCS,
104 | | # IPv4 header and ICMP header
105 | | ${end_size}= | Evaluate | ${mtu} - 14 - 4 - 20 - 8
106 | | Run Keyword If | ${mtu} > 1518
107 | | ...            | Ipv4 icmp echo sweep | ${nodes['TG']} | ${nodes['DUT1']}
108 | | ...            | 1452 | ${end_size} | 10
109
110 | VPP responds to ARP request
111 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
112 | | Send ARP request and validate response | ${nodes['TG']} | ${nodes['DUT1']}