24a408b9bed5d2c624818f0ae43354b0311339d7
[csit.git] / tests / suites / ipv6 / ipv6_iacl_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 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/counters.robot
17 | Resource | resources/libraries/robot/interfaces.robot
18 | Resource | resources/libraries/robot/iacl.robot
19 | Resource | resources/libraries/robot/ipv6.robot
20 | Resource | resources/libraries/robot/l2_xconnect.robot
21 | Resource | resources/libraries/robot/traffic.robot
22 | Library | resources.libraries.python.Classify.Classify
23 | Library | resources.libraries.python.Trace
24
25 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO
26 | Suite Setup | Run Keywords | Setup all TGs before traffic script
27 | ...         | AND          | Update All Interface Data On All Nodes | ${nodes}
28 | Test Setup | Setup all DUTs before test
29 | Test Teardown | Show packet trace on all DUTs | ${nodes}
30
31 *** Variables ***
32 | ${dut1_if1_ip}= | 3ffe:62::1
33 | ${dut1_if2_ip}= | 3ffe:63::1
34 | ${dut1_if2_ip_GW}= | 3ffe:63::2
35 | ${dut2_if1_ip}= | 3ffe:72::1
36 | ${dut2_if2_ip}= | 3ffe:73::1
37 | ${test_dst_ip}= | 3ffe:64::1
38 | ${test_src_ip}= | 3ffe:61::1
39 | ${prefix_length}= | 64
40
41 *** Test Cases ***
42 | VPP drops packets based on IPv6 source addresses
43 | | [Documentation] | Create classify table on VPP, add source IP address
44 | | ...             | of traffic into table and setup 'deny' traffic
45 | | ...             | and check if traffic is dropped.
46 | | Given Node path computed for 3-node topology
47 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
48 | | And Interfaces in path are up
49 | | And IPv6 Addresses set on the node interfaces
50 | | ... | ${dut1_node} | ${dut1_if1} | ${dut1_if1_ip} | ${dut1_if2}
51 | | ... | ${dut1_if2_ip} | ${prefix_length}
52 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table
53 | | ... | ${dut1_node} | ip6 | src
54 | | And Vpp Configure Classify Session
55 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
56 | | ... | ip6 | src | ${test_src_ip}
57 | | And Vpp Enable Input Acl Interface
58 | | ... | ${dut1_node} | ${dut1_if1} | ip6 | ${table_index}
59 | | And Add Ip Neighbor
60 | | ... | ${dut1_node} | ${dut1_if2} | ${dut1_if2_ip_GW} | ${tg_if2_mac}
61 | | And Vpp Route Add
62 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} | ${dut1_if2_ip_GW}
63 | | ... | ${dut1_if2}
64 | | And L2 setup xconnect on DUT | ${dut2_node} | ${dut2_if1} | ${dut2_if2}
65 | | Then Send packet from Port to Port should failed | ${tg_node} |
66 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_if1} | ${tg_if1_mac} |
67 | | ... | ${dut1_if1_mac} | ${tg_if2} | ${dut1_if2_mac} | ${tg_if2_mac}
68
69
70 | VPP drops packets based on IPv6 destination addresses
71 | | [Documentation] | Create classify table on VPP, add destination IP address
72 | | ...             | of traffic into table and setup 'deny' traffic
73 | | ...             | and check if traffic is dropped.
74 | | Given Node path computed for 3-node topology
75 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
76 | | And Interfaces in path are up
77 | | And IPv6 Addresses set on the node interfaces
78 | | ... | ${dut1_node} | ${dut1_if1} | ${dut1_if1_ip} | ${dut1_if2}
79 | | ... | ${dut1_if2_ip} | ${prefix_length}
80 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table
81 | | ... | ${dut1_node} | ip6 | dst
82 | | And Vpp Configure Classify Session
83 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
84 | | ... | ip6 | dst | ${test_dst_ip}
85 | | And Vpp Enable Input Acl Interface
86 | | ... | ${dut1_node} | ${dut1_if1} | ip6 | ${table_index}
87 | | And Add Ip Neighbor
88 | | ... | ${dut1_node} | ${dut1_if2} | ${dut1_if2_ip_GW} | ${tg_if2_mac}
89 | | And Vpp Route Add
90 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} | ${dut1_if2_ip_GW}
91 | | ... | ${dut1_if2}
92 | | And L2 setup xconnect on DUT | ${dut2_node} | ${dut2_if1} | ${dut2_if2}
93 | | Then Send packet from Port to Port should failed | ${tg_node} |
94 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_if1} | ${tg_if1_mac} |
95 | | ... | ${dut1_if1_mac} | ${tg_if2} | ${dut1_if2_mac} | ${tg_if2_mac}
96
97
98 | VPP drops packets based on IPv6 src-addr and dst-addr
99 | | [Documentation] | Create classify table on VPP, add source and destination
100 | | ...             | IP address of traffic into table and setup 'deny' traffic
101 | | ...             | and check if traffic is dropped.
102 | | Given Node path computed for 3-node topology
103 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
104 | | And Interfaces in path are up
105 | | And IPv6 Addresses set on the node interfaces
106 | | ... | ${dut1_node} | ${dut1_if1} | ${dut1_if1_ip} | ${dut1_if2}
107 | | ... | ${dut1_if2_ip} | ${prefix_length}
108 | | ${table_index_1} | ${skip_n_1} | ${match_n_1}=
109 | | ... | When Vpp Create Classify Table | ${dut1_node} | ip6 | src
110 | | ${table_index_2} | ${skip_n_2} | ${match_n_2}=
111 | | ... | When Vpp Create Classify Table | ${dut1_node} | ip6 | dst
112 | | And Vpp Configure Classify Session
113 | | ... | ${dut1_node} | deny | ${table_index_1} | ${skip_n_1} | ${match_n_2}
114 | | ... | ip6 | src | ${test_src_ip}
115 | | And Vpp Configure Classify Session
116 | | ... | ${dut1_node} | deny | ${table_index_2} | ${skip_n_2} | ${match_n_2}
117 | | ... | ip6 | dst | ${test_dst_ip}
118 | | And Vpp Enable Input Acl Interface
119 | | ... | ${dut1_node} | ${dut1_if1} | ip6 | ${table_index_1}
120 | | And Vpp Enable Input Acl Interface
121 | | ... | ${dut1_node} | ${dut1_if1} | ip6 | ${table_index_2}
122 | | And Add Ip Neighbor
123 | | ... | ${dut1_node} | ${dut1_if2} | ${dut1_if2_ip_GW} | ${tg_if2_mac}
124 | | And Vpp Route Add
125 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} | ${dut1_if2_ip_GW}
126 | | ... | ${dut1_if2}
127 | | And L2 setup xconnect on DUT | ${dut2_node} | ${dut2_if1} | ${dut2_if2}
128 | | Then Send packet from Port to Port should failed | ${tg_node} |
129 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_if1} | ${tg_if1_mac} |
130 | | ... | ${dut1_if1_mac} | ${tg_if2} | ${dut1_if2_mac} | ${tg_if2_mac}