Introduce HC_NSH tag
[csit.git] / tests / vpp / func / honeycomb / mgmt-cfg-apihcv6-func.robot
1 # Copyright (c) 2017 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 *** Variables ***
15 # IP addresses for IPv6 link
16 | ${tg_to_dut_if2_ip}= | fd00:1234::1
17 | ${dut_to_tg_if2_ip}= | fd00:1234::2
18 | ${ipv6_prefix}= | ${64}
19 # Configuration which will be set and verified during tests.
20 | ${bd1_name}= | bd-01
21 | ${bd2_name}= | bd-02
22 | &{bd_settings}= | flood=${True} | forward=${True} | learn=${True}
23 | ... | unknown-unicast-flood=${True} | arp-termination=${True}
24 | &{if_settings}= | split_horizon_group=${1} | bvi=${False}
25 | &{if_settings2}= | split_horizon_group=${2} | bvi=${True}
26 | ${vhost_interface}= | test_vhost
27 | &{vhost_user_server}= | socket=/tmp/soc1 | role=server
28 | &{vhost_user_server_edit_1}= | socket=/tmp/soc12 | role=server
29 | &{vhost_user_server_edit_2}= | socket=/tmp/soc12 | role=client
30
31 *** Settings ***
32 | Library | resources.libraries.python.honeycomb.IPv6Management
33 | Library | resources.libraries.python.VPPUtil
34 | Resource | resources/libraries/robot/shared/default.robot
35 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
36 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
37 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
38 | Resource | resources/libraries/robot/honeycomb/ipv6_control.robot
39 | Resource | resources/libraries/robot/shared/testing_path.robot
40 | Resource | resources/libraries/robot/honeycomb/netconf.robot
41 | Resource | resources/libraries/robot/honeycomb/vhost_user.robot
42 | Variables | resources/test_data/honeycomb/netconf/triggers.py
43 | ...
44 | Suite Setup | Set Up Honeycomb Functional Test Suite | ${node}
45 | ...
46 | Suite Teardown | Run Keywords
47 | ... | Unconfigure IPv6 Management Interface | AND
48 | ... | Tear Down Honeycomb Functional Test Suite | ${node}
49 | ...
50 | Force Tags | HC_FUNC | HC_REST_ONLY
51 | ...
52 | Documentation | *Honeycomb IPv6 control interface test suite.*
53
54 *** Test Cases ***
55 | TC01: Honeycomb sets up l2 bridge domain
56 | | [Documentation] | Check if Honeycomb can create bridge domains on VPP node.
57 | | ...
58 | | [Setup] | Configure IPv6 Management Interface
59 | | When Honeycomb creates first l2 bridge domain
60 | | ... | ${tunneled_node} | ${bd1_name} | ${bd_settings}
61 | | Then Bridge domain Operational Data From Honeycomb Should Be
62 | | ... | ${tunneled_node} | ${bd1_name} | ${bd_settings}
63
64 | TC02: Honeycomb removes bridge domains
65 | | [Documentation] | Check if Honeycomb can remove bridge domains from a VPP\
66 | | ... | node.
67 | | ...
68 | | Given Bridge domain Operational Data From Honeycomb Should Be
69 | | ... | ${tunneled_node} | ${bd1_name} | ${bd_settings}
70 | | When Honeycomb removes all bridge domains | ${tunneled_node}
71 | | Then Honeycomb should show no bridge domains | ${tunneled_node}
72
73 | TC03: Honeycomb creates vhost-user interface - server
74 | | [Documentation] | Check if Honeycomb creates a vhost-user interface, role:\
75 | | ... | server.
76 | | ...
77 | | Given vhost-user Operational Data From Honeycomb Should Be empty
78 | | ... | ${tunneled_node} | ${vhost_interface}
79 | | When Honeycomb creates vhost-user interface
80 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server}
81 | | Then vhost-user Operational Data From Honeycomb Should Be
82 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server}
83
84 | TC04: Honeycomb modifies vhost-user interface - server
85 | | [Documentation] | Check if Honeycomb can modify properties of existing\
86 | | ... | vhost-user interface, role: server.
87 | | ...
88 | | Given vhost-user Operational Data From Honeycomb Should Be
89 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server}
90 | | When Honeycomb configures vhost-user interface
91 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server_edit_1}
92 | | Then vhost-user Operational Data From Honeycomb Should Be
93 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server_edit_1}
94 | | When Honeycomb configures vhost-user interface
95 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server_edit_2}
96 | | Then vhost-user Operational Data From Honeycomb Should Be
97 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server_edit_2}
98 | | When Honeycomb configures vhost-user interface
99 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server}
100 | | Then vhost-user Operational Data From Honeycomb Should Be
101 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server}
102
103 | TC05: Honeycomb deletes vhost-user interface - server
104 | | [Documentation] | Check if Honeycomb can delete an existing vhost-user\
105 | | ... | interface, role: server.
106 | | ...
107 | | Given vhost-user Operational Data From Honeycomb Should Be
108 | | ... | ${tunneled_node} | ${vhost_interface} | ${vhost_user_server}
109 | | When Honeycomb removes vhost-user interface
110 | | ... | ${tunneled_node} | ${vhost_interface}
111 | | Then vhost-user Operational Data From Honeycomb Should Be empty
112 | | ... | ${tunneled_node} | ${vhost_interface}
113
114 | TC06: Honeycomb can create and delete interfaces
115 | | [Documentation] | Repeatedly create and delete an interface through Netconf\
116 | | ... | and check the reply for any errors.
117 | | ...
118 | | Given Netconf session should be established | ${tunneled_node}
119 | | And Honeycomb creates first L2 bridge domain
120 | | ... | ${tunneled_node} | bd_netconf | ${bd_settings}
121 | | :FOR | ${index} | IN RANGE | 20
122 | | | When Error trigger is sent | ${trigger_105}
123 | | | Then Replies should not contain RPC errors
124
125 | TC07: Honeycomb can create vlan subinterface
126 | | [Documentation] | Configure a Vlan sub-interface under a physical interface.
127 | | ...
128 | | Given Netconf session should be established | ${tunneled_node}
129 | | When Error Trigger Is Sent
130 | | ... | ${trigger_vlan} | interface=${interface}
131 | | Then Replies should not contain RPC errors
132
133 *** Keywords ***
134 | Configure IPv6 Management Interface
135 | | [Documentation] | Change one of VPP's data-plane interfaces on DUT into\
136 | | ... | a control-plane interface that Honeycomb can listen on. Setup IPv6\
137 | | ... | addresses on the link. Create an IPv4 to IPv6 tunnel on TG and create\
138 | | ... | suite variables.
139 | | ...
140 | | Configure path in 2-node circular topology
141 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
142 | | Stop VPP service on DUT | ${dut_node}
143 | | Stop Honeycomb Service on DUTs | ${dut_node}
144 | | Convert data-plane interface to control-plane
145 | | ... | ${dut_node} | ${dut_to_tg_if2}
146 | | Sleep | 5sec | Wait until Linux reclaims the interface.
147 | | ${tg_to_dut_if2_name}= | Get Interface Name by MAC
148 | | ... | ${tg_node} | ${tg_to_dut_if2_mac}
149 | | ${dut_to_tg_if2_name}= | Get Interface Name by MAC
150 | | ... | ${dut_node} | ${dut_to_tg_if2_mac}
151 | | ${tunneled_node}= | Copy Dictionary | ${dut_node}
152 | | Set To Dictionary | ${tunneled_node} | host | ${tg_node['host']}
153 | | ${interface}= | Get Interface Name | ${dut_node} | ${dut_to_tg_if1}
154 | | Set Suite Variable | ${interface}
155 | | Set Suite Variable | ${tunneled_node}
156 | | Set Suite Variable | ${tg_node}
157 | | Set Suite Variable | ${dut_node}
158 | | Set Suite Variable | ${dut_to_tg_if2}
159 | | Set Suite Variable | ${dut_to_tg_if2_name}
160 | | Set Suite Variable | ${tg_to_dut_if2_name}
161 | | Set management interface address
162 | | ... | ${tg_node} | ${tg_to_dut_if2_name}
163 | | ... | ${tg_to_dut_if2_ip} | ${ipv6_prefix}
164 | | Set management interface address
165 | | ... | ${dut_node} | ${dut_to_tg_if2_name}
166 | | ... | ${dut_to_tg_if2_ip} | ${ipv6_prefix}
167 | | Configure Control Interface Tunnel
168 | | ... | ${tg_node} | ${dut_node['honeycomb']['port']}
169 | | ... | ${dut_to_tg_if2_ip} | ${dut_node['honeycomb']['port']}
170 | | Configure Control Interface Tunnel
171 | | ... | ${tg_node} | ${dut_node['honeycomb']['netconf_port']}
172 | | ... | ${dut_to_tg_if2_ip} | ${dut_node['honeycomb']['netconf_port']}
173 | | Start VPP service on DUT | ${dut_node}
174 | | Configure Honeycomb service on DUTs | ${dut_node}
175
176 | Unconfigure IPv6 Management Interface
177 | | [Documentation] | Remove all IP addresses from interfaces in the IPv6 link.
178 | | ...
179 | | Clear Interface Configuration | ${tg_node} | ${tg_to_dut_if2_name}
180 | | Clear Interface Configuration | ${dut_node} | ${dut_to_tg_if2_name}