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
16 [Documentation] Add a Controller
18 Add a Controller odc_test ${CONTROLLER}
21 Verify the Controller Status is up
22 [Documentation] Check Controller status
24 Check Controller Status odc_test
28 [Documentation] Create Vtn Tenant1
30 Add a VTN Tenant1 VTN_TEST
33 Create VBR in VTN Tenant1
34 [Documentation] Create a VBR in Tenant1 as Vbridge1
36 Create VBR in VTN Tenant1 Vbridge1 odc_test
39 Create VBRIF in VBRIDGE Vbridge1 Interface1
40 [Documentation] Create an interface to Vbridge1
42 Create VBRIF in VBR Tenant1 Vbridge1 Interface1 Interface1
45 Create VBRIF in VBRIDGE Vbridge1 Interface2
46 [Documentation] Create an interface to Vbridge1
48 Create VBRIF in VBR Tenant1 Vbridge1 Interface2 Interface2
51 Define Portmap for Interface1
52 [Documentation] Map Interface1 to a logical port
54 Define Portmap for VBRIF Tenant1 Vbridge1 Interface1 PP-OF:00:00:00:00:00:00:00:03-s3-eth1
57 Define Portmap for Interface2
58 [Documentation] Map Interface2 to a logical port
60 Define Portmap for VBRIF Tenant1 Vbridge1 Interface2 PP-OF:00:00:00:00:00:00:00:02-s2-eth1
63 Test Ping for Configuration1
64 [Documentation] ping between hosts in mininet
70 [Documentation] Delete Vtn Tenant1
75 Delete a Controller odc1
76 [Documentation] Delete Controller odc1
78 Remove Controller odc_test
84 [Arguments] ${ctrlname} ${ctrlip}
85 [Documentation] Create a controller
86 ${controllerinfo} Create Dictionary controller_id ${ctrlname} type odc ipaddr ${CONTROLLER} version 1.0 auditstatus enable
87 ${controllercreate} Create Dictionary controller ${controllerinfo}
88 ${resp} PostJson session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate}
89 Should Be Equal As Strings ${resp.status_code} 201
93 [Arguments] ${ctrlname}
94 [Documentation] Delete a Controller
95 ${resp} Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
96 Should Be Equal As Strings ${resp.status_code} 204
99 Check Controller Status
100 [Arguments] ${ctrlname}
101 [Documentation] Get controller status
103 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
104 ${contents} To JSON ${resp.content}
105 ${controllerblock} Get From Dictionary ${contents} controller
106 ${status} Get From Dictionary ${controllerblock} operstatus
107 Should Be Equal As Strings ${status} up
111 [Arguments] ${vtnname} ${vtndescription}
112 [Documentation] Create VTN in Coordinator
113 ${vtninfo} Create Dictionary vtn_name ${vtnname} description ${vtndescription}
114 ${vtncreate} Create Dictionary vtn ${vtninfo}
115 ${resp} PostJson session ${VTNWEBAPI}/${VTNS_CREATE} data=${vtncreate}
116 Should Be Equal As Strings ${resp.status_code} 201
120 [Arguments] ${vtnname}
121 [Documentation] Delete a VTN Created
122 ${resp} Delete session ${VTNWEBAPI}/${VTNS}/${vtnname}.json
123 Should Be Equal As Strings ${resp.status_code} 204
127 [Arguments] ${vtnname} ${vbrname} ${ctrlname}
128 [Documentation] Create VBR for VTN in Coordinator
129 ${vbrinfo} Create Dictionary vbr_name ${vbrname} controller_id ${ctrlname} domain_id (DEFAULT)
130 ${vbrcreate} Create Dictionary vbridge ${vbrinfo}
131 ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE} data=${vbrcreate}
132 Should Be Equal As Strings ${resp.status_code} 201
136 [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${ifdescription}
137 [Documentation] Create VBR Interface in VBR
138 ${vbrifinfo} Create Dictionary if_name ${vbrifname} description ${ifdescription}
139 ${vbrifcreate} Create Dictionary interface ${vbrifinfo}
140 ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE} data=${vbrifcreate}
141 Should Be Equal As Strings ${resp.status_code} 201
144 Define Portmap for VBRIF
145 [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${logical_port_id}
146 [Documentation] Map Interface to a logical port
147 ${logical_port_info} Create Dictionary logical_port_id ${logical_port_id}
148 ${portmapdefine} Create Dictionary portmap ${logical_port_info}
149 ${resp} Put session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE} data=${portmapdefine}
150 Should Be Equal As Strings ${resp.status_code} 204
153 [Arguments] ${host1} ${host2}
154 [Documentation] Ping hosts to check connectivity
156 Write ${host1} ping -w 10 ${host2}
159 Should Contain ${result} 64 bytes