2 Documentation Basic tests for BIER information configuration and verification.
3 ... Copyright (c) 2016-2017 Zte, Inc. and others. All rights reserved.
4 ... Test suite performs basic BIER information configuration and verification test cases for topology domain, subdomain, node and channel as follows:
5 ... Test Case 1: Query the topology, node and check their existence
6 ... Expected result: Exist a topology which topologyId is example-linkstate-topology and five nodes inside it
7 ... Test Case 2: Configure domain with add and delete operation
8 ... Expected result: The Configure result with corresponding operation verified as expected
9 ... Test Case 3: Configure subdomain with add and delete operation
10 ... Expected result: The Configure result with corresponding operation verified as expected
11 ... Test Case 4: Configure bier node params with add, modify and delete operation
12 ... Expected result: The Configure result with corresponding operation verified as expected
13 ... Test Case 5: Configure bier-te node params with add, modify and delete operation
14 ... Expected result: The Configure result with corresponding operation verified as expected
15 ... Test Case 6: Configure channel with add, modify, deploy and delete operation
16 ... Expected result: The Configure result with corresponding operation verified as expected
18 Suite Teardown Delete All Sessions
19 Resource ../../../libraries/BierTeResource.robot
20 Resource ../../../libraries/TemplatedRequests.robot
21 Variables ../../../variables/Variables.robot
22 Library RequestsLibrary
25 @{NODE_ID_LIST} 1111.1111.1111 1111.1111.1122 1111.1111.1133 1111.1111.1144 1111.1111.1155
26 ${TOPOLOGY_ID} example-linkstate-topology
27 @{DOMAIN_ID_LIST} ${1} ${2}
28 @{SUBDOMAIN_ID_LIST} ${1} ${2}
29 @{BFR_ID_LIST} ${1} ${2} ${3} ${4} ${5}
30 @{TE_LABEL_BASE_LIST} ${1100} ${2200} ${3300} ${4400} ${5500}
31 ${TE_LABEL_RANGE_SIZE} ${100}
32 @{TP_ID_LIST_OF_NODE1} fei-0/1/0/4 fei-0/1/0/1 fei-0/1/0/7 atm135-0/1/2/2
33 @{BP_LIST_OF_NODE1} 1 2 3 4
34 @{TP_ID_LIST_OF_NODE2} fei-0/1/0/1 atm155-0/1/2/1 fei-0/1/0/6
35 @{BP_LIST_OF_NODE2} 5 6 15
36 @{TP_ID_LIST_OF_NODE3} fei-0/1/0/4 fei-0/1/0/5 pos192-0/1/0/3
37 @{BP_LIST_OF_NODE3} 7 8 9
38 @{TP_ID_LIST_OF_NODE4} fei-0/1/0/5 spi-0/1/0/4 fei-0/1/0/6
39 @{BP_LIST_OF_NODE4} 10 11 14
40 &{NODE_TO_TP_ID_LIST} 1111.1111.1111=${TP_ID_LIST_OF_NODE1} 1111.1111.1122=${TP_ID_LIST_OF_NODE2} 1111.1111.1133=${TP_ID_LIST_OF_NODE3} 1111.1111.1144=${TP_ID_LIST_OF_NODE4}
41 &{NODE_TO_BP_LIST} 1111.1111.1111=${BP_LIST_OF_NODE1} 1111.1111.1122=${BP_LIST_OF_NODE2} 1111.1111.1133=${BP_LIST_OF_NODE3} 1111.1111.1144=${BP_LIST_OF_NODE4}
42 @{CHANNEL_NAME_LIST} channel1 channel2 channel3
43 @{SRC_IP_LIST} 1.1.1.1 2.2.2.2 3.3.3.3
44 @{DST_GROUP_LIST} 239.1.1.1 239.2.2.2 239.3.3.3
48 [Documentation] Verify the topology has been succesfully put into the datastore by querying nodes and topology names.
49 Wait Until Keyword Succeeds 30s 2s Node Online
50 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/load_topology {} session True
53 [Documentation] Query the all links in the bier topology.
54 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID}
55 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/query_link ${mapping1} session True
58 [Documentation] Configure two BIER domains with domain id list ${DOMAIN_ID_LIST}.
59 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} DOMAINID1=${DOMAIN_ID_LIST[0]} DOMAINID2=${DOMAIN_ID_LIST[1]}
60 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_domain_configuration/configure_domain ${mapping1} session
61 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response
64 [Documentation] Delete the second domain created in the testcase TC2_Configure Domain.
65 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} DOMAINID=${DOMAIN_ID_LIST[1]}
66 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_domain_configuration/delete_domain ${mapping1} session
67 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response
70 [Documentation] Query the domains created in the datastore.
71 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID}
72 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_domain_configuration/query_domain ${mapping1} session True
74 TC3_Configure Subdomain
75 [Documentation] Configure two subdomains with subdomain list ${SUBDOMAIN_ID_LIST}.
76 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAIN1=${SUBDOMAIN_ID_LIST[0]} SUBDOMAIN2=${SUBDOMAIN_ID_LIST[1]}
77 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_domain_configuration/configure_subdomain ${mapping1} session
78 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response
81 [Documentation] Delete the second subdomain created in TC3_Configure Subdomain.
82 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[1]}
83 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_domain_configuration/delete_subdomain ${mapping1} session
84 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response
87 [Documentation] Query the subdomains in the datastore.
88 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} DOMAINID=${DOMAIN_ID_LIST[0]}
89 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_domain_configuration/query_subdomain ${mapping1} session True
92 [Documentation] Configure the bier params of nodes in the bier network topology.
93 : FOR ${i} IN RANGE len(${NODE_ID_LIST})
94 \ ${domain-bfr-id} Get From List ${BFR_ID_LIST} ${i}
95 \ ${node-id} Get From List ${NODE_ID_LIST} ${i}
96 \ ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${node-id} DOMAINID=${DOMAIN_ID_LIST[0]} DOMAINBFRID=${domain-bfr-id}
97 \ ... SUBDOMAINBFRID=${domain-bfr-id} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
98 \ ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_node ${mapping1} session
99 \ Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response
100 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/query_node {} session
101 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_node config_node_response
104 [Documentation] Configure the bier params of one node in the bier network topology and then delete it.
105 ${node-id} Get From List ${NODE_ID_LIST} ${3}
106 ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} NODEID=${node-id}
107 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_node ${mapping} session
108 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response
111 [Documentation] Configure the bier params of one node in the bier network topology and delete the ipv4 parameter of it.
112 ${node-id} Get From List ${NODE_ID_LIST} ${4}
113 ${mapping} Create Dictionary DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} NODEID=${node-id} TOPOLOGYID=${TOPOLOGY_ID}
114 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_ipv4 ${mapping} session
115 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response
117 TC4_Query Subdomain Link
118 [Documentation] Query the bier links in the domain 1 and subdomain 1.
119 ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
120 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/query_subdomain_link ${mapping} session True
122 TC5_Configure Te Label
123 [Documentation] Configure the BIER-TE label base and label range size for all nodes in the bier topology.
124 : FOR ${i} IN RANGE len(${NODE_ID_LIST})
125 \ ${node-id} Get From List ${NODE_ID_LIST} ${i}
126 \ ${label-base} Get From List ${TE_LABEL_BASE_LIST} ${i}
127 \ ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${node-id} LABELBASE=${label-base} LABELRANGESIZE=${TE_LABEL_RANGE_SIZE}
128 \ ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_label ${mapping} session
129 \ Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response
131 TC5_Configure Te Node
132 [Documentation] Configure the BIER-TE params of nodes in the bier network topology.
133 : FOR ${i} IN RANGE 4
134 \ ${node-id} Get From List ${NODE_ID_LIST} ${i}
135 \ ${tp-id-list} Get From Dictionary ${NODE_TO_TP_ID_LIST} ${node-id}
136 \ ${bp-list} Get From Dictionary ${NODE_TO_BP_LIST} ${node-id}
137 \ Second Layer Loop ${node-id} ${tp-id-list} ${bp-list} len(${bp-list})
139 TC5_Query Te Subdomain Link
140 [Documentation] Query the bier links in the te-domain 1 and te-subdomain 1.
141 ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
142 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/query_te_subdomain_link ${mapping} session True
145 [Documentation] Configure the bier te params of one node and delete the BP parameter.
146 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${NODE_ID_LIST[4]} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} TPID=spi-0/1/0/3
148 ${resp1} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_node ${mapping1} session
149 Verify_Response_As_Json_Templated ${resp1} ${BIER_TE_VAR_FOLDER}/common success_response
150 ${mapping2} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${NODE_ID_LIST[4]} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} TPID=spi-0/1/0/3
151 ${resp2} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_te_bp ${mapping2} session
152 Verify_Response_As_Json_Templated ${resp2} ${BIER_TE_VAR_FOLDER}/common success_response
155 [Documentation] Configure the bier te params of one node and delete the SI parameter.
156 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${NODE_ID_LIST[4]} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} TPID=spi-0/1/0/3
158 ${resp1} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_node ${mapping1} session
159 Verify_Response_As_Json_Templated ${resp1} ${BIER_TE_VAR_FOLDER}/common success_response
160 ${mapping2} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${NODE_ID_LIST[4]} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
161 ${resp2} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_te_si ${mapping2} session
162 Verify_Response_As_Json_Templated ${resp2} ${BIER_TE_VAR_FOLDER}/common success_response
165 [Documentation] Configure the bier te params of one node and delete the BSL parameter.
166 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${NODE_ID_LIST[4]} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} TPID=spi-0/1/0/3
168 ${resp1} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_node ${mapping1} session
169 Verify_Response_As_Json_Templated ${resp1} ${BIER_TE_VAR_FOLDER}/common success_response
170 ${mapping2} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${NODE_ID_LIST[4]} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
171 ${resp2} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_te_bsl ${mapping2} session
172 Verify_Response_As_Json_Templated ${resp2} ${BIER_TE_VAR_FOLDER}/common success_response
175 [Documentation] Delete te label base and label range size of one node.
176 ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${NODE_ID_LIST[4]}
177 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_te_label ${mapping} session
178 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response
181 [Documentation] Add three channels to the datastore defined by bier-network-channel.
182 : FOR ${i} IN RANGE len(${CHANNEL_NAME_LIST})
183 \ ${channel-name} Get From List ${CHANNEL_NAME_LIST} ${i}
184 \ ${src-ip} Get From List ${SRC_IP_LIST} ${i}
185 \ ${dst-group} Get From List ${DST_GROUP_LIST} ${i}
186 \ ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} CHANNELNAME=${channel-name} SRCIP=${src-ip} DSTGROUP=${dst-group}
187 \ ... DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
188 \ ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/add_channel ${mapping} session
189 \ Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/bier_channel_configuration success_response
192 [Documentation] Query the channels put into the datastore.
193 ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID}
194 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/get_channel ${mapping} session True
197 [Documentation] Query the channel put into the datastore by given name .
198 ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} CHANNEL1=${CHANNEL_NAME_LIST[0]} CHANNEL2=${CHANNEL_NAME_LIST[1]}
199 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/query_channel ${mapping} session True
202 [Documentation] Remove one channel which was put into the datastore.
203 ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} CHANNELNAME=channel3
204 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/remove_channel ${mapping} session
205 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/bier_channel_configuration success_response
208 [Documentation] Modify one channel which was put into the datastore.
209 ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} CHANNELNAME=${CHANNEL_NAME_LIST[0]} SRCIP=10.10.10.10 DSTGROUP=${DST_GROUP_LIST[0]} DOMAINID=${DOMAIN_ID_LIST[0]}
210 ... SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
211 ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/modify_channel ${mapping} session
212 Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/bier_channel_configuration success_response
215 [Documentation] Deploy two channels which was put into the datastore, by giving the ingress node, ingress tp, egress nodes and coressponding tps.
216 ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} CHANNELNAME=${CHANNEL_NAME_LIST[0]} INGRESSNODE=${NODE_ID_LIST[0]} SRCTP=${TP_ID_LIST_OF_NODE1[3]} NODEID1=${NODE_ID_LIST[1]}
217 ... RCVTP1=${TP_ID_LIST_OF_NODE2[1]} NODEID2=${NODE_ID_LIST[2]} RCVTP2=${TP_ID_LIST_OF_NODE3[2]}
218 ${resp1} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/deploy_channel ${mapping1} session
219 Verify_Response_As_Json_Templated ${resp1} ${BIER_TE_VAR_FOLDER}/bier_channel_configuration success_response
220 ${mapping2} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} CHANNELNAME=${CHANNEL_NAME_LIST[1]} INGRESSNODE=${NODE_ID_LIST[0]} SRCTP=${TP_ID_LIST_OF_NODE1[3]} NODEID1=${NODE_ID_LIST[1]}
221 ... RCVTP1=${TP_ID_LIST_OF_NODE2[1]} NODEID2=${NODE_ID_LIST[3]} RCVTP2=${TP_ID_LIST_OF_NODE4[1]}
222 ${resp2} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/deploy_channel ${mapping2} session
223 Verify_Response_As_Json_Templated ${resp2} ${BIER_TE_VAR_FOLDER}/bier_channel_configuration success_response