3 Documentation Test suite for VTN Coordinator
4 Suite Setup Create Session session http://${VTNC}:8083 headers=${VTNC_HEADERS}
5 Suite Teardown Delete All Sessions
8 Library ../../../libraries/RequestsLibrary.py
9 Library ../../../libraries/Common.py
10 Library ../../../libraries/Topology.py
11 Variables ../../../variables/Variables.py
16 [Documentation] Add a Controller odc1
18 Add a Controller odc_test ${CONTROLLER}
20 Verify the Controller Status is up
21 [Documentation] Check Controller status
23 Check Controller Status odc_test up 20
26 [Documentation] Get switch1
28 Verify Switch odc_test 00:00:00:00:00:00:00:01 30
31 [Documentation] Get switch2
33 Verify Switch odc_test 00:00:00:00:00:00:00:02 1
36 [Documentation] Get switch3
38 Verify Switch odc_test 00:00:00:00:00:00:00:03 1
40 Verify switchPort switch1
41 [Documentation] Get switchport/switch1
43 Verify SwitchPort odc_test 00:00:00:00:00:00:00:01 15
45 Verify switchPort switch2
46 [Documentation] Get switchport/switch2
48 Verify SwitchPort odc_test 00:00:00:00:00:00:00:02 1
50 Verify switchPort switch3
51 [Documentation] Get switchport/switch3
53 Verify SwitchPort odc_test 00:00:00:00:00:00:00:03 1
56 [Documentation] Delete Controller odc1
58 Remove Controller odc_test
63 [Arguments] ${ctrlname} ${ctrlip}
64 [Documentation] Create a controller
65 ${controllerinfo} Create Dictionary controller_id ${ctrlname} type odc ipaddr ${CONTROLLER} version 1.0 auditstatus enable
66 ${controllercreate} Create Dictionary controller ${controllerinfo}
67 ${resp} PostJson session ${VTNWEBAPI}/${CTRLS_CREATE} data=${controllercreate}
68 Should Be Equal As Strings ${resp.status_code} 201
72 [Arguments] ${ctrlname}
73 [Documentation] Delete a Controller
74 ${resp} Delete session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
75 Should Be Equal As Strings ${resp.status_code} 204
77 Check Controller Status
78 [Arguments] ${ctrlname} ${stat} ${sec}
79 [Documentation] Get controller status
81 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
82 ${contents} To JSON ${resp.content}
83 ${controllerblock} Get From Dictionary ${contents} controller
84 ${status} Get From Dictionary ${controllerblock} operstatus
85 Should Be Equal As Strings ${status} ${stat}
88 [Arguments] ${ctrlname} ${switch_id} ${sec}
89 [Documentation] Get switch
91 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}.json
92 ${contents} To JSON ${resp.content}
93 ${switchblock} Get From Dictionary ${contents} switch
94 ${status} Get From Dictionary ${switchblock} switch_id
95 Should Be Equal As Strings ${status} ${switch_id}
98 [Arguments] ${ctrlname} ${switch_id} ${sec}
99 [Documentation] Get switch
101 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}/${PORTS}
102 Should Be Equal As Strings ${resp.status_code} 200