VPP_Device - add baseline tests - part IIa)
[csit.git] / tests / vpp / device / ip4 / eth2p-ethip4-ip4base-dev.robot
1 # Copyright (c) 2018 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 | Resource | resources/libraries/robot/ip/ip4.robot
16 | Resource | resources/libraries/robot/shared/default.robot
17 | Resource | resources/libraries/robot/shared/interfaces.robot
18 | Resource | resources/libraries/robot/shared/traffic.robot
19 | ...
20 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV
21 | ... | FUNCTEST | IP4FWD | BASE | ETH | IP4BASE
22 | ...
23 | Test Setup | Set up VPP device test
24 | ...
25 | Test Teardown | Tear down VPP device test
26 | ...
27 | Documentation | *IPv4 routing test cases*
28 | ...
29 | ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology \
30 | ... | with single links between nodes.
31 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for IPv4 routing on \
32 | ... | both links.
33 | ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv4 routing and \
34 | ... | two static IPv4 /24 route entries.
35 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent in \
36 | ... | one direction by TG on links to DUT1; on receive TG verifies packets \
37 | ... | for correctness and their IPv4 src-addr, dst-addr and MAC addresses.
38 | ... | *[Ref] Applicable standard specifications:* RFC791, RFC826, RFC792
39
40 *** Variables ***
41 | ${tg_to_dut_if1_ip4}= | 10.10.10.2
42 | ${tg_to_dut_if2_ip4}= | 20.20.20.2
43 | ${dut_to_tg_if1_ip4}= | 10.10.10.1
44 | ${dut_to_tg_if2_ip4}= | 20.20.20.1
45 | ${remote_host1_ip4}= | 192.168.0.1
46 | ${remote_host2_ip4}= | 192.168.0.2
47 | ${remote_host_ip4_prefix}= | 32
48
49 *** Test Cases ***
50 | tc01-eth2p-ethicmpv4-ip4base-device_echo-req-to-dut-ingress-interface
51 | | [Documentation]
52 | | ... | Make TG send ICMPv4 Echo Req to DUT1 ingress interface. Make TG \
53 | | ... | verify ICMP Echo Reply is correct.
54 | | ...
55 | | ${hops}= | Set Variable | ${0}
56 | | ...
57 | | Given Configure path in 2-node circular topology
58 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
59 | | And Configure IPv4 forwarding in circular topology | ${tg_to_dut_if1_ip4}
60 | | ... | ${tg_to_dut_if2_ip4} | ${dut_to_tg_if1_ip4} | ${dut_to_tg_if2_ip4}
61 | | When All Vpp Interfaces Ready Wait | ${nodes}
62 | | Then Send IPv4 ping packet and verify headers | ${tg_node}
63 | | ... | ${tg_to_dut_if1} | ${dut_node} | ${dut_to_tg_if1}
64 | | ... | ${tg_to_dut_if1_ip4} | ${dut_to_tg_if1_ip4} | ${dut_to_tg_if1_mac}
65 | | ... | ${hops}
66
67 | tc02-eth2p-ethicmpv4-ip4base-device_echo-req-to-dut-egress-interface
68 | | [Documentation]
69 | | ... | Make TG send ICMPv4 Echo Req towards DUT1 egress interface. Make TG \
70 | | ... | verify ICMP Echo Reply is correct.
71 | | ...
72 | | ${hops}= | Set Variable | ${0}
73 | | ...
74 | | Given Configure path in 2-node circular topology
75 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
76 | | And Configure IPv4 forwarding in circular topology | ${tg_to_dut_if1_ip4}
77 | | ... | ${tg_to_dut_if2_ip4} | ${dut_to_tg_if1_ip4} | ${dut_to_tg_if2_ip4}
78 | | When All Vpp Interfaces Ready Wait | ${nodes}
79 | | Then Send IPv4 ping packet and verify headers | ${tg_node}
80 | | ... | ${tg_to_dut_if1} | ${dut_node} | ${dut_to_tg_if2}
81 | | ... | ${tg_to_dut_if1_ip4} | ${dut_to_tg_if2_ip4} | ${dut_to_tg_if1_mac}
82 | | ... | ${hops}
83
84 | tc03-eth2p-ethicmpv4-ip4base-device_echo-req-to-tg-interface-for-local-ipv4-address
85 | | [Documentation]
86 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across DUT1 for \
87 | | ... | locally connected IPv4 addresses. Make TG verify ICMPv4 Echo Replies \
88 | | ... | are correct.
89 | | ...
90 | | ${hops}= | Set Variable | ${1}
91 | | ...
92 | | Given Configure path in 2-node circular topology
93 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
94 | | And Configure IPv4 forwarding in circular topology | ${tg_to_dut_if1_ip4}
95 | | ... | ${tg_to_dut_if2_ip4} | ${dut_to_tg_if1_ip4} | ${dut_to_tg_if2_ip4}
96 | | When All Vpp Interfaces Ready Wait | ${nodes}
97 | | Then Send IPv4 ping packet and verify headers | ${tg_node}
98 | | ... | ${tg_to_dut_if1} | ${tg_node} | ${tg_to_dut_if2}
99 | | ... | ${tg_to_dut_if1_ip4} | ${tg_to_dut_if2_ip4} | ${dut_to_tg_if1_mac}
100 | | ... | ${hops}
101
102 | tc04-eth2p-ethicmpv4-ip4base-device_echo-req-to-tg-interface-for-remote-host-ipv4-address
103 | | [Documentation]
104 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across DUT1 for \
105 | | ... | remote host IPv4 addresses. Make TG verify ICMPv4 Echo Replies are \
106 | | ... | correct.
107 | | ...
108 | | ${hops}= | Set Variable | ${1}
109 | | ...
110 | | Given Configure path in 2-node circular topology
111 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
112 | | And Configure IPv4 forwarding in circular topology | ${tg_to_dut_if1_ip4}
113 | | ... | ${tg_to_dut_if2_ip4} | ${dut_to_tg_if1_ip4} | ${dut_to_tg_if2_ip4}
114 | | ... | remote_host1_ip4=${remote_host1_ip4}
115 | | ... | remote_host2_ip4=${remote_host2_ip4}
116 | | ... | remote_host_ip4_prefix=${remote_host_ip4_prefix}
117 | | When All Vpp Interfaces Ready Wait | ${nodes}
118 | | Then Send IPv4 ping packet and verify headers | ${tg_node}
119 | | ... | ${tg_to_dut_if1} | ${tg_node} | ${tg_to_dut_if2}
120 | | ... | ${remote_host1_ip4} | ${remote_host2_ip4} | ${dut_to_tg_if1_mac}
121 | | ... | ${hops}