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 Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up
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 Wait Until Keyword Succeeds 40s 2s Check Controller Status odc_test down
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 Wait Until Keyword Succeeds 40s 2s Check Controller Status odc_test up
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
77 Wait Until Keyword Succeeds 40s 2s Test Ping h1 h2
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}
118 [Documentation] Get controller status
119 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
120 ${contents} To JSON ${resp.content}
121 ${controllerblock} Get From Dictionary ${contents} controller
122 ${status} Get From Dictionary ${controllerblock} operstatus
123 Should Be Equal As Strings ${status} ${stat}
127 [Arguments] ${vtnname} ${vtndescription}
128 [Documentation] Create VTN in Coordinator
129 ${vtninfo} Create Dictionary vtn_name ${vtnname} description ${vtndescription}
130 ${vtncreate} Create Dictionary vtn ${vtninfo}
131 ${resp} PostJson session ${VTNWEBAPI}/${VTNS_CREATE} data=${vtncreate}
132 Should Be Equal As Strings ${resp.status_code} 201
136 [Arguments] ${vtnname}
137 [Documentation] Delete a VTN Created
138 ${resp} Delete session ${VTNWEBAPI}/${VTNS}/${vtnname}.json
139 Should Be Equal As Strings ${resp.status_code} 204
143 [Arguments] ${vtnname} ${vbrname} ${ctrlname}
144 [Documentation] Create VBR for VTN in Coordinator
145 ${vbrinfo} Create Dictionary vbr_name ${vbrname} controller_id ${ctrlname} domain_id (DEFAULT)
146 ${vbrcreate} Create Dictionary vbridge ${vbrinfo}
147 ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE} data=${vbrcreate}
148 Should Be Equal As Strings ${resp.status_code} 201
152 [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${ifdescription}
153 [Documentation] Create VBR Interface in VBR
154 ${vbrifinfo} Create Dictionary if_name ${vbrifname} description ${ifdescription}
155 ${vbrifcreate} Create Dictionary interface ${vbrifinfo}
156 ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE} data=${vbrifcreate}
157 Should Be Equal As Strings ${resp.status_code} 202
160 Define Portmap for VBRIF
161 [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${logical_port_id}
162 [Documentation] Map Interface to a logical port
163 ${logical_port_info} Create Dictionary logical_port_id ${logical_port_id}
164 ${portmapdefine} Create Dictionary portmap ${logical_port_info}
165 ${resp} Put session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE} data=${portmapdefine}
166 Should Be Equal As Strings ${resp.status_code} 204
169 [Arguments] ${host1} ${host2}
170 [Documentation] Ping hosts to check connectivity
171 Write ${host1} ping -w 10 ${host2}
173 Should Contain ${result} 64 bytes