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