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 Wait Until Keyword Succeeds 30s 2s Check Controller Status odc_test up
26 [Documentation] Get switch1
28 Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test 00:00:00:00:00:00:00:01
31 [Documentation] Get switch2
33 Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test 00:00:00:00:00:00:00:02
36 [Documentation] Get switch3
38 Wait Until Keyword Succeeds 30s 2s Verify Switch odc_test 00:00:00:00:00:00:00:03
40 Verify switchPort switch1
41 [Documentation] Get switchport/switch1
43 Wait Until Keyword Succeeds 16s 2s Verify SwitchPort odc_test 00:00:00:00:00:00:00:01
45 Verify switchPort switch2
46 [Documentation] Get switchport/switch2
48 Wait Until Keyword Succeeds 16s 2s Verify SwitchPort odc_test 00:00:00:00:00:00:00:02
50 Verify switchPort switch3
51 [Documentation] Get switchport/switch3
53 Wait Until Keyword Succeeds 16s 2s Verify SwitchPort odc_test 00:00:00:00:00:00:00:03
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}
79 [Documentation] Get controller status
80 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}.json
81 ${contents} To JSON ${resp.content}
82 ${controllerblock} Get From Dictionary ${contents} controller
83 ${status} Get From Dictionary ${controllerblock} operstatus
84 Should Be Equal As Strings ${status} ${stat}
87 [Arguments] ${ctrlname} ${switch_id}
88 [Documentation] Get switch
89 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}.json
90 ${contents} To JSON ${resp.content}
91 ${switchblock} Get From Dictionary ${contents} switch
92 ${status} Get From Dictionary ${switchblock} switch_id
93 Should Be Equal As Strings ${status} ${switch_id}
96 [Arguments] ${ctrlname} ${switch_id}
97 [Documentation] Get switch
98 ${resp} Get session ${VTNWEBAPI}/${CTRLS}/${ctrlname}/${SW}/${switch_id}/${PORTS}
99 Should Be Equal As Strings ${resp.status_code} 200