47de572b18c11fe9112cc5c49d8911ad2c0f2f7e
[csit.git] / tests / vpp / device / interfaces / eth2p-ethip4-ip4base-eth-1tap-dev.robot
1 # Copyright (c) 2019 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.IPUtil
16 | Library  | resources.libraries.python.Namespaces
17 | Library  | resources.libraries.python.Tap
18 | Library  | resources.libraries.python.Trace
19 | ...
20 | Resource | resources/libraries/robot/ip/ip4.robot
21 | Resource | resources/libraries/robot/ip/ip6.robot
22 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
23 | Resource | resources/libraries/robot/shared/default.robot
24 | Resource | resources/libraries/robot/shared/interfaces.robot
25 | Resource | resources/libraries/robot/shared/testing_path.robot
26 | Resource | resources/libraries/robot/shared/traffic.robot
27 | ...
28 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV
29 | ... | FUNCTEST | IP4FWD | BASE | ETH | IP4BASE | TAP
30 | ...
31 | Test Setup | Run Keywords | Set up VPP device test
32 | ... | AND | Clean Up Namespaces | ${nodes['DUT1']}
33 | ...
34 | Test Teardown | Run Keywords | Tear down VPP device test
35 | ... | AND | Clean Up Namespaces | ${nodes['DUT1']}
36 | ...
37 | Documentation | *Tap Interface Traffic Tests*
38 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
39 | ... | between nodes.
40 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
41 | ... | IPv4.
42 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
43 | ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG)
44 | ... | are set depending on test case; Namespaces (NM)
45 | ... | are set on DUT1 with attached linux-TAP.
46 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets
47 | ... | are sent by TG on link to DUT1; On receipt TG verifies packets
48 | ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses.
49 | ... | *[Ref] Applicable standard specifications:*
50
51 *** Variables ***
52 | ${tap1_VPP_ip}= | 16.0.10.1
53 | ${tap1_NM_ip}= | 16.0.10.2
54 | ${tap1_NM_mac}= | 02:00:00:00:00:02
55 | ${tap_int1}= | tap0
56
57 | ${namespace1}= | nmspace1
58
59 | ${dut_ip_address}= | 192.168.0.1
60 | ${tg_ip_address}= | 192.168.0.2
61 | ${tg_ip_address_GW}= | 192.168.0.0
62 | ${prefix}= | 24
63
64 *** Test Cases ***
65 | tc01-eth2p-ethicmpv4-ip4base-device_tap-no-namespace
66 | | [Documentation]
67 | | ... | [Cfg] On DUT1 configure two interface addresses with IPv4 of which\
68 | | ... | one is TAP interface (dut_to_tg_if and TAP) and one is linux-TAP.
69 | | ... | [Ver] Packet sent from TG gets to the destination and ICMP-reply is\
70 | | ... | received on TG.
71 | | ...
72 | | Given Configure path in 2-node circular topology | ${nodes['TG']}
73 | | ... | ${nodes['DUT1']} | ${nodes['TG']}
74 | | And Set interfaces in 2-node circular topology up
75 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} |
76 | | And VPP Interface Set IP Address
77 | | ... | ${dut_node} | ${int1} | ${tap1_VPP_ip} | ${prefix}
78 | | And VPP Interface Set IP Address
79 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip_address} | ${prefix}
80 | | And Set Interface State | ${dut_node} | ${int1} | up
81 | | And Set Linux Interface MAC | ${dut_node} | ${tap_int1} | ${tap1_NM_mac}
82 | | And Set Linux Interface IP | ${dut_node}
83 | | ... | ${tap_int1} | ${tap1_NM_ip} | ${prefix}
84 | | And Add Linux Route | ${dut_node}
85 | | ... | ${tg_ip_address_GW} | ${prefix} | ${tap1_VPP_ip}
86 | | And VPP Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1}
87 | | ... | ${tg_ip_address} | ${tg_to_dut_if1_mac}
88 | | And VPP Add IP Neighbor | ${dut_node} | ${int1}
89 | | ... | ${tap1_NM_ip} | ${tap1_NM_mac}
90 | | Then Send ICMP echo request and verify answer | ${tg_node}
91 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac}
92 | | ... | ${tap1_NM_ip} | ${tg_ip_address}
93
94 | tc02-eth2p-ethicmpv4-ip4base-device_tap-namespace
95 | | [Documentation]
96 | | ... | [Cfg] On DUT1 configure two interface addresses with IPv4 of which\
97 | | ... | one is TAP interface (dut_to_tg_if and TAP) and one is linux-TAP in\
98 | | ... | namespace.
99 | | ... | [Ver] Packet sent from TG gets to the destination and ICMP-reply is\
100 | | ... | received on TG.
101 | | ...
102 | | Given Configure path in 2-node circular topology | ${nodes['TG']}
103 | | ... | ${nodes['DUT1']} | ${nodes['TG']}
104 | | And Set interfaces in 2-node circular topology up
105 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} |
106 | | And VPP Interface Set IP Address
107 | | ... | ${dut_node} | ${int1} | ${tap1_VPP_ip} | ${prefix}
108 | | And VPP Interface Set IP Address
109 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip_address} | ${prefix}
110 | | And Set Interface State | ${dut_node} | ${int1} | up
111 | | When Create Namespace | ${dut_node} | ${namespace1}
112 | | And Attach Interface To Namespace | ${dut_node}
113 | | ... | ${namespace1} | ${tap_int1}
114 | | And Set Linux Interface MAC | ${dut_node}
115 | | ... | ${tap_int1} | ${tap1_NM_mac} | ${namespace1}
116 | | And Set Linux Interface IP | ${dut_node}
117 | | ... | ${tap_int1} | ${tap1_NM_ip} | ${prefix} | ${namespace1}
118 | | And VPP Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1}
119 | | ... | ${tg_ip_address} | ${tg_to_dut_if1_mac}
120 | | And VPP Add IP Neighbor | ${dut_node} | ${int1}
121 | | ... | ${tap1_NM_ip} | ${tap1_NM_mac}
122 | | And Add Linux Route | ${dut_node}
123 | | ... | ${tg_ip_address_GW} | ${prefix} | ${tap1_VPP_ip} | ${namespace1}
124 | | Then Send ICMP echo request and verify answer | ${tg_node}
125 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac}
126 | | ... | ${tap1_NM_ip} | ${tg_ip_address}