Add library for set path variables for testing.
[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/testing_path.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_to_tg_ip}= | 3ffe:62::1
33 | ${dut1_to_dut2_ip}= | 3ffe:63::1
34 | ${dut1_to_dut2_ip_GW}= | 3ffe:63::2
35 | ${dut2_to_dut1_ip}= | 3ffe:72::1
36 | ${dut2_to_tg_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 Path for 3-node testing is set
47 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
48 | | And Interfaces in 3-node path are up
49 | | And Vpp Set If Ipv6 Addr | ${dut1_node}
50 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
51 | | And Vpp Set If Ipv6 Addr  | ${dut1_node}
52 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
53 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table
54 | | ... | ${dut1_node} | ip6 | src
55 | | And Vpp Configure Classify Session
56 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
57 | | ... | ip6 | src | ${test_src_ip}
58 | | And Vpp Enable Input Acl Interface
59 | | ... | ${dut1_node} | ${dut1_to_tg} | ip6 | ${table_index}
60 | | And Add Ip Neighbor
61 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
62 | | ... | ${tg_to_dut2_mac}
63 | | And Vpp Route Add
64 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
65 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
66 | | And L2 setup xconnect on DUT
67 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
68 | | Then Send packet from Port to Port should failed | ${tg_node}
69 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
70 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
71 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
72
73
74 | VPP drops packets based on IPv6 destination addresses
75 | | [Documentation] | Create classify table on VPP, add destination IP address
76 | | ...             | of traffic into table and setup 'deny' traffic
77 | | ...             | and check if traffic is dropped.
78 | | Given Path for 3-node testing is set
79 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
80 | | And Interfaces in 3-node path are up
81 | | And Vpp Set If Ipv6 Addr | ${dut1_node}
82 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
83 | | And Vpp Set If Ipv6 Addr  | ${dut1_node}
84 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
85 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table
86 | | ... | ${dut1_node} | ip6 | dst
87 | | And Vpp Configure Classify Session
88 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
89 | | ... | ip6 | dst | ${test_dst_ip}
90 | | And Vpp Enable Input Acl Interface
91 | | ... | ${dut1_node} | ${dut1_to_tg} | ip6 | ${table_index}
92 | | And Add Ip Neighbor
93 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
94 | | ... | ${tg_to_dut2_mac}
95 | | And Vpp Route Add
96 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
97 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
98 | | And L2 setup xconnect on DUT
99 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
100 | | Then Send packet from Port to Port should failed | ${tg_node}
101 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
102 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
103 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
104
105
106 | VPP drops packets based on IPv6 src-addr and dst-addr
107 | | [Documentation] | Create classify table on VPP, add source and destination
108 | | ...             | IP address of traffic into table and setup 'deny' traffic
109 | | ...             | and check if traffic is dropped.
110 | | Given Path for 3-node testing is set
111 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
112 | | And Interfaces in 3-node path are up
113 | | And Vpp Set If Ipv6 Addr | ${dut1_node}
114 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
115 | | And Vpp Set If Ipv6 Addr  | ${dut1_node}
116 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
117 | | ${table_index_1} | ${skip_n_1} | ${match_n_1}=
118 | | ... | When Vpp Create Classify Table | ${dut1_node} | ip6 | src
119 | | ${table_index_2} | ${skip_n_2} | ${match_n_2}=
120 | | ... | When Vpp Create Classify Table | ${dut1_node} | ip6 | dst
121 | | And Vpp Configure Classify Session
122 | | ... | ${dut1_node} | deny | ${table_index_1} | ${skip_n_1} | ${match_n_2}
123 | | ... | ip6 | src | ${test_src_ip}
124 | | And Vpp Configure Classify Session
125 | | ... | ${dut1_node} | deny | ${table_index_2} | ${skip_n_2} | ${match_n_2}
126 | | ... | ip6 | dst | ${test_dst_ip}
127 | | And Vpp Enable Input Acl Interface
128 | | ... | ${dut1_node} | ${dut1_to_tg} | ip6 | ${table_index_1}
129 | | And Vpp Enable Input Acl Interface
130 | | ... | ${dut1_node} | ${dut1_to_tg} | ip6 | ${table_index_2}
131 | | And Add Ip Neighbor
132 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
133 | | ... | ${tg_to_dut2_mac}
134 | | And Vpp Route Add
135 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
136 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
137 | | And L2 setup xconnect on DUT
138 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
139 | | Then Send packet from Port to Port should failed | ${tg_node}
140 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
141 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
142 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}