2 Documentation Test suite for Time our values and Vlan and PCP Vlan
3 Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
4 Suite Teardown Delete All Sessions
7 Library OperatingSystem
8 Library RequestsLibrary
9 Library ../../../libraries/Common.py
10 Variables ../../../variables/Variables.py
13 ${REST_CON} /restconf/config/opendaylight-inventory:nodes
14 ${FILE} ${CURDIR}/../../../variables/xmls/f16.xml
17 @{FLOWELMENTS} table=2 priority=16 dl_vlan=78 dl_vlan_pcp=3 dl_src=00:00:00:11:23:ae dl_dst=ff:ff:29:01:19:61 dec_ttl
20 Add a flow - Output to physical port#
21 [Documentation] Push a flow through REST-API
23 ${body} OperatingSystem.Get File ${FILE}
24 Set Suite Variable ${body}
25 ${resp} RequestsLibrary.Put session ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW} headers=${HEADERS_XML} data=${body}
26 Should Be Equal As Strings ${resp.status_code} 200
28 Verify after adding flow config - Output to physical port#
29 [Documentation] Verify the flow
31 ${resp} RequestsLibrary.Get session ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW} headers=${ACCEPT_XML}
32 Should Be Equal As Strings ${resp.status_code} 200
33 compare xml ${body} ${resp.content}
35 Verify flows after adding flow config on OVS
36 [Documentation] Checking Flows on switch
39 write dpctl dump-flows -O OpenFlow13
40 ${switchoutput} Read Until mininet>
41 : FOR ${flowElement} IN @{FLOWELMENTS}
42 \ should Contain ${switchoutput} ${flowElement}
44 Remove a flow - Output to physical port#
45 [Documentation] Remove a flow
47 ${resp} RequestsLibrary.Delete session ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
48 Should Be Equal As Strings ${resp.status_code} 200
50 Verify after deleting flow config - Output to physical port#
51 [Documentation] Verify the flow
53 ${resp} RequestsLibrary.Get session ${REST_CON}/node/openflow:1/table/${TABLE}
54 Should Not Contain ${resp.content} ${FLOW}
56 Verify flows after deleting flow config on OVS
57 [Documentation] Checking Flows on switch
60 write dpctl dump-flows -O OpenFlow13
61 ${switchoutput} Read Until mininet>
62 : FOR ${flowElement} IN @{FLOWELMENTS}
63 \ should Not Contain ${switchoutput} ${flowElement}