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 Wait Until Keyword Succeeds 30s 2s 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
66 Wait Until Keyword Succeeds 30s 2s Test Ping h1 h3
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
102 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
103 ${contents} To JSON ${resp.content}
104 ${controllerblock} Get From Dictionary ${contents} controller
105 ${status} Get From Dictionary ${controllerblock} operstatus
106 Should Be Equal As Strings ${status} up
110 [Arguments] ${vtnname} ${vtndescription}
111 [Documentation] Create VTN in Coordinator
112 ${vtninfo} Create Dictionary vtn_name ${vtnname} description ${vtndescription}
113 ${vtncreate} Create Dictionary vtn ${vtninfo}
114 ${resp} PostJson session ${VTNWEBAPI}/${VTNS_CREATE} data=${vtncreate}
115 Should Be Equal As Strings ${resp.status_code} 201
119 [Arguments] ${vtnname}
120 [Documentation] Delete a VTN Created
121 ${resp} Delete session ${VTNWEBAPI}/${VTNS}/${vtnname}.json
122 Should Be Equal As Strings ${resp.status_code} 204
126 [Arguments] ${vtnname} ${vbrname} ${ctrlname}
127 [Documentation] Create VBR for VTN in Coordinator
128 ${vbrinfo} Create Dictionary vbr_name ${vbrname} controller_id ${ctrlname} domain_id (DEFAULT)
129 ${vbrcreate} Create Dictionary vbridge ${vbrinfo}
130 ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS_CREATE} data=${vbrcreate}
131 Should Be Equal As Strings ${resp.status_code} 201
135 [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${ifdescription}
136 [Documentation] Create VBR Interface in VBR
137 ${vbrifinfo} Create Dictionary if_name ${vbrifname} description ${ifdescription}
138 ${vbrifcreate} Create Dictionary interface ${vbrifinfo}
139 ${resp} PostJson session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS_CREATE} data=${vbrifcreate}
140 Should Be Equal As Strings ${resp.status_code} 201
143 Define Portmap for VBRIF
144 [Arguments] ${vtnname} ${vbrname} ${vbrifname} ${logical_port_id}
145 [Documentation] Map Interface to a logical port
146 ${logical_port_info} Create Dictionary logical_port_id ${logical_port_id}
147 ${portmapdefine} Create Dictionary portmap ${logical_port_info}
148 ${resp} Put session ${VTNWEBAPI}/${VTNS}/${vtnname}/${VBRS}/${vbrname}/${VBRIFS}/${vbrifname}/${PORTMAP_CREATE} data=${portmapdefine}
149 Should Be Equal As Strings ${resp.status_code} 204
152 [Arguments] ${host1} ${host2}
153 [Documentation] Ping hosts to check connectivity
154 Write ${host1} ping -w 10 ${host2}
156 Should Contain ${result} 64 bytes