Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / bier / basic / 010_BierTeIntergrationTest.robot
1 *** Settings ***
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
17 Suite Setup       Init All
18 Suite Teardown    Delete All Sessions
19 Resource          ../../../libraries/BierTeResource.robot
20 Resource          ../../../libraries/TemplatedRequests.robot
21 Resource          ../../../variables/Variables.robot
22 Library           RequestsLibrary
23
24 *** Variables ***
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
45
46 *** Test Cases ***
47 TC1_Load Topology
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
51
52 TC1_Query Link
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
56
57 TC2_Configure Domain
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
62
63 TC2_Delete Domain
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
68
69 TC2_Query Domain
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
73
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
79
80 TC3_Delete Subdomain
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
85
86 TC3_Query Subdomain
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
90
91 TC4_Configure Node
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     END
101     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/query_node    {}    session
102     Verify_Response_As_Json_Templated    ${resp}    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_node    config_node_response
103
104 TC4_Delete Node
105     [Documentation]    Configure the bier params of one node in the bier network topology and then delete it.
106     ${node-id}    Get From List    ${NODE_ID_LIST}    ${3}
107     ${mapping}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    DOMAINID=${DOMAIN_ID_LIST[0]}    SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}    NODEID=${node-id}
108     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_node    ${mapping}    session
109     Verify_Response_As_Json_Templated    ${resp}    ${BIER_TE_VAR_FOLDER}/common    success_response
110
111 TC4_Delete IPV4
112     [Documentation]    Configure the bier params of one node in the bier network topology and delete the ipv4 parameter of it.
113     ${node-id}    Get From List    ${NODE_ID_LIST}    ${4}
114     ${mapping}    Create Dictionary    DOMAINID=${DOMAIN_ID_LIST[0]}    SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}    NODEID=${node-id}    TOPOLOGYID=${TOPOLOGY_ID}
115     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_ipv4    ${mapping}    session
116     Verify_Response_As_Json_Templated    ${resp}    ${BIER_TE_VAR_FOLDER}/common    success_response
117
118 TC4_Query Subdomain Link
119     [Documentation]    Query the bier links in the domain 1 and subdomain 1.
120     ${mapping}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    DOMAINID=${DOMAIN_ID_LIST[0]}    SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
121     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/query_subdomain_link    ${mapping}    session    True
122
123 TC5_Configure Te Label
124     [Documentation]    Configure the BIER-TE label base and label range size for all nodes in the bier topology.
125     FOR    ${i}    IN RANGE    len(${NODE_ID_LIST})
126         ${node-id}    Get From List    ${NODE_ID_LIST}    ${i}
127         ${label-base}    Get From List    ${TE_LABEL_BASE_LIST}    ${i}
128         ${mapping}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    NODEID=${node-id}    LABELBASE=${label-base}    LABELRANGESIZE=${TE_LABEL_RANGE_SIZE}
129         ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_label    ${mapping}    session
130         Verify_Response_As_Json_Templated    ${resp}    ${BIER_TE_VAR_FOLDER}/common    success_response
131     END
132
133 TC5_Configure Te Node
134     [Documentation]    Configure the BIER-TE params of nodes in the bier network topology.
135     FOR    ${i}    IN RANGE    4
136         ${node-id}    Get From List    ${NODE_ID_LIST}    ${i}
137         ${tp-id-list}    Get From Dictionary    ${NODE_TO_TP_ID_LIST}    ${node-id}
138         ${bp-list}    Get From Dictionary    ${NODE_TO_BP_LIST}    ${node-id}
139         Second Layer Loop    ${node-id}    ${tp-id-list}    ${bp-list}    len(${bp-list})
140     END
141
142 TC5_Query Te Subdomain Link
143     [Documentation]    Query the bier links in the te-domain 1 and te-subdomain 1.
144     ${mapping}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    DOMAINID=${DOMAIN_ID_LIST[0]}    SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
145     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/query_te_subdomain_link    ${mapping}    session    True
146
147 TC5_Delete Te BP
148     [Documentation]    Configure the bier te params of one node and delete the BP parameter.
149     ${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
150     ...    BP=13
151     ${resp1}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_node    ${mapping1}    session
152     Verify_Response_As_Json_Templated    ${resp1}    ${BIER_TE_VAR_FOLDER}/common    success_response
153     ${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
154     ${resp2}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_te_bp    ${mapping2}    session
155     Verify_Response_As_Json_Templated    ${resp2}    ${BIER_TE_VAR_FOLDER}/common    success_response
156
157 TC5_Delete Te SI
158     [Documentation]    Configure the bier te params of one node and delete the SI parameter.
159     ${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
160     ...    BP=13
161     ${resp1}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_node    ${mapping1}    session
162     Verify_Response_As_Json_Templated    ${resp1}    ${BIER_TE_VAR_FOLDER}/common    success_response
163     ${mapping2}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    NODEID=${NODE_ID_LIST[4]}    DOMAINID=${DOMAIN_ID_LIST[0]}    SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
164     ${resp2}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_te_si    ${mapping2}    session
165     Verify_Response_As_Json_Templated    ${resp2}    ${BIER_TE_VAR_FOLDER}/common    success_response
166
167 TC5_Delete Te BSL
168     [Documentation]    Configure the bier te params of one node and delete the BSL parameter.
169     ${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
170     ...    BP=13
171     ${resp1}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_node    ${mapping1}    session
172     Verify_Response_As_Json_Templated    ${resp1}    ${BIER_TE_VAR_FOLDER}/common    success_response
173     ${mapping2}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    NODEID=${NODE_ID_LIST[4]}    DOMAINID=${DOMAIN_ID_LIST[0]}    SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
174     ${resp2}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_te_bsl    ${mapping2}    session
175     Verify_Response_As_Json_Templated    ${resp2}    ${BIER_TE_VAR_FOLDER}/common    success_response
176
177 TC5_Delete Te Label
178     [Documentation]    Delete te label base and label range size of one node.
179     ${mapping}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    NODEID=${NODE_ID_LIST[4]}
180     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/delete_te_label    ${mapping}    session
181     Verify_Response_As_Json_Templated    ${resp}    ${BIER_TE_VAR_FOLDER}/common    success_response
182
183 TC6_Add Channel
184     [Documentation]    Add three channels to the datastore defined by bier-network-channel.
185     FOR    ${i}    IN RANGE    len(${CHANNEL_NAME_LIST})
186         ${channel-name}    Get From List    ${CHANNEL_NAME_LIST}    ${i}
187         ${src-ip}    Get From List    ${SRC_IP_LIST}    ${i}
188         ${dst-group}    Get From List    ${DST_GROUP_LIST}    ${i}
189         ${mapping}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    CHANNELNAME=${channel-name}    SRCIP=${src-ip}    DSTGROUP=${dst-group}
190         ...    DOMAINID=${DOMAIN_ID_LIST[0]}    SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
191         ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/add_channel    ${mapping}    session
192         Verify_Response_As_Json_Templated    ${resp}    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration    success_response
193     END
194
195 TC6_Get Channel
196     [Documentation]    Query the channels put into the datastore.
197     ${mapping}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}
198     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/get_channel    ${mapping}    session    True
199
200 TC6_Query Channel
201     [Documentation]    Query the channel put into the datastore by given name .
202     ${mapping}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    CHANNEL1=${CHANNEL_NAME_LIST[0]}    CHANNEL2=${CHANNEL_NAME_LIST[1]}
203     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/query_channel    ${mapping}    session    True
204
205 TC6_Remove Channel
206     [Documentation]    Remove one channel which was put into the datastore.
207     ${mapping}    Create Dictionary    TOPOLOGYID=${TOPOLOGY_ID}    CHANNELNAME=channel3
208     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/remove_channel    ${mapping}    session
209     Verify_Response_As_Json_Templated    ${resp}    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration    success_response
210
211 TC6_Modify Channel
212     [Documentation]    Modify one channel which was put into the datastore.
213     ${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]}
214     ...    SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
215     ${resp}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/modify_channel    ${mapping}    session
216     Verify_Response_As_Json_Templated    ${resp}    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration    success_response
217
218 TC6_Deploy Channel
219     [Documentation]    Deploy two channels which was put into the datastore, by giving the ingress node, ingress tp, egress nodes and coressponding tps.
220     ${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]}
221     ...    RCVTP1=${TP_ID_LIST_OF_NODE2[1]}    NODEID2=${NODE_ID_LIST[2]}    RCVTP2=${TP_ID_LIST_OF_NODE3[2]}
222     ${resp1}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/deploy_channel    ${mapping1}    session
223     Verify_Response_As_Json_Templated    ${resp1}    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration    success_response
224     ${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]}
225     ...    RCVTP1=${TP_ID_LIST_OF_NODE2[1]}    NODEID2=${NODE_ID_LIST[3]}    RCVTP2=${TP_ID_LIST_OF_NODE4[1]}
226     ${resp2}    TemplatedRequests.Post_As_Json_Templated    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/deploy_channel    ${mapping2}    session
227     Verify_Response_As_Json_Templated    ${resp2}    ${BIER_TE_VAR_FOLDER}/bier_channel_configuration    success_response