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