2 Documentation Test suite for VTN Coordinator
3 Suite Setup Create Session session http://${VTNC}:8083 headers=${VTNC_HEADERS}
4 Suite Teardown Delete All Sessions
7 Library ../../../libraries/RequestsLibrary.py
8 Library ../../../libraries/Common.py
9 Library ../../../libraries/Topology.py
10 Variables ../../../variables/Variables.py
15 [Documentation] Add a Controller
17 Add a Controller odc_test ${CONTROLLER}
19 Verify the Controller Status is up
20 [Documentation] Check Controller status
22 Check Controller Status odc_test up 20
25 [Documentation] Create Vtn Tenant1
27 Add a VTN Tenant1 VTN_TEST
29 Create VBR in VTN Tenant1
30 [Documentation] Create a VBR in Tenant1 as Vbridge1
32 Create VBR in VTN Tenant1 Vbridge1 odc_test
34 Update controller ip invalid
35 [Documentation] Update Controller ip to invalid
37 Update Controller odc_test 10.0.0.1 invalid_IP
39 Verify the Controller State is down
40 [Documentation] Check Controller status
42 Check Controller Status odc_test down 45
44 Create VBRIF in VBRIDGE Vbridge1 Interface1
45 [Documentation] Create an interface to Vbridge1
47 Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1
49 Create VBRIF in VBRIDGE Vbridge1 Interface2
50 [Documentation] Create an interface to Vbridge1
52 Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2
54 Update controller ip valid
55 [Documentation] Update Controller ip to valid
57 Update Controller odc_test ${CONTROLLER} valid_IP
59 Verify the Controller State is up
60 [Documentation] Check Controller status
62 Check Controller Status odc_test up 45
64 Define Portmap for Interface1
65 [Documentation] Map Interface1 to a logical port
67 Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 PP-OF:00:00:00:00:00:00:00:02-s2-eth1
69 Define Portmap for Interface2
70 [Documentation] Map Interface2 to a logical port
72 Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 PP-OF:00:00:00:00:00:00:00:02-s2-eth2
74 Test Ping for Configuration1
75 [Documentation] ping between hosts in mininet
80 [Documentation] Delete Vtn Tenant1
84 Delete a Controller odc1
85 [Documentation] Delete Controller odc1
87 Remove Controller odc_test
92 [Arguments] ${ctrlname} ${ctrlip}
93 [Documentation] Create a controller
94 ${controllerinfo} Create Dictionary controller_id ${ctrlname} type odc ipaddr ${CONTROLLER} version 1.0 auditstatus enable
95 ${controllercreate} Create Dictionary controller ${controllerinfo}
96 ${resp} PostJson session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate}
97 Should Be Equal As Strings ${resp.status_code} 201
101 [Arguments] ${ctrlname}
102 [Documentation] Delete a Controller
103 ${resp} Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
104 Should Be Equal As Strings ${resp.status_code} 204
108 [Arguments] ${ctrlname} ${ctrlip} ${desc}
109 [Documentation] Update controller
110 ${controllerinfo} Create Dictionary description ${desc} ipaddr ${ctrlip} version 1.0 auditstatus enable
111 ${controllerupdate} Create Dictionary controller ${controllerinfo}
112 ${resp} Put session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json data=${controllerupdate}
113 Should Be Equal As Strings ${resp.status_code} 204
116 Check Controller Status
117 [Arguments] ${ctrlname} ${stat} ${sec}
118 [Documentation] Get controller status
120 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
121 ${contents} To JSON ${resp.content}
122 ${controllerblock} Get From Dictionary ${contents} controller
123 ${status} Get From Dictionary ${controllerblock} operstatus
124 Should Be Equal As Strings ${status} ${stat}
128 [Arguments] ${vtnname} ${vtndescription}
129 [Documentation] Create VTN in Coordinator
130 ${vtninfo} Create Dictionary vtn_name ${vtnname} description ${vtndescription}
131 ${vtncreate} Create Dictionary vtn ${vtninfo}
132 ${resp} PostJson session ${VTNWEBAPI}/${VTNS_CREATE} data=${vtncreate}
133 Should Be Equal As Strings ${resp.status_code} 201
137 [Arguments] ${vtnname}
138 [Documentation] Delete a VTN Created
139 ${resp} Delete session ${VTNWEBAPI}/${VTNS}/${vtnname}.json
140 Should Be Equal As Strings ${resp.status_code} 204
144 [Arguments] ${vtnname} ${vbrname} ${ctrlname}
145 [Documentation] Create VBR for VTN in Coordinator
146 ${vbrinfo} Create Dictionary vbr_name ${vbrname} controller_id ${ctrlname} domain_id (DEFAULT)
147 ${vbrcreate} Create Dictionary vbridge ${vbrinfo}
148 ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE} data=${vbrcreate}
149 Should Be Equal As Strings ${resp.status_code} 201
153 [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${ifdescription}
154 [Documentation] Create VBR Interface in VBR
155 ${vbrifinfo} Create Dictionary if_name ${vbrifname} description ${ifdescription}
156 ${vbrifcreate} Create Dictionary interface ${vbrifinfo}
157 ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE} data=${vbrifcreate}
158 Should Be Equal As Strings ${resp.status_code} 202
161 Define Portmap for VBRIF
162 [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${logical_port_id}
163 [Documentation] Map Interface to a logical port
164 ${logical_port_info} Create Dictionary logical_port_id ${logical_port_id}
165 ${portmapdefine} Create Dictionary portmap ${logical_port_info}
166 ${resp} Put session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE} data=${portmapdefine}
167 Should Be Equal As Strings ${resp.status_code} 204
170 [Arguments] ${host1} ${host2}
171 [Documentation] Ping hosts to check connectivity
173 Write ${host1} ping -w 10 ${host2}
176 Should Contain ${result} 64 bytes