2 Documentation Test suite for metadata and mask
3 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${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/f20.xml
17 @{FLOWELMENTS} metadata=0x3039/0xf0ff LOCAL
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 Request 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 Request 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 ${body} OperatingSystem.Get File ${FILE}
41 ${switchoutput} Read Until >
42 : FOR ${flowElement} IN @{FLOWELMENTS}
43 \ should Contain ${switchoutput} ${flowElement}
45 Remove a flow - Output to physical port#
46 [Documentation] Remove a flow
48 ${resp} RequestsLibrary.Delete Request session ${REST_CON}/node/openflow:1/table/${TABLE}/flow/${FLOW}
49 Should Be Equal As Strings ${resp.status_code} 200
51 Verify after deleting flow config - Output to physical port#
52 [Documentation] Verify the flow
54 ${resp} RequestsLibrary.Get Request session ${REST_CON}/node/openflow:1/table/${TABLE}
55 Should Not Contain ${resp.content} ${FLOW}
57 Verify flows after deleting flow config on OVS
58 [Documentation] Checking Flows on switch
61 write dpctl dump-flows -O OpenFlow13
62 ${body} OperatingSystem.Get File ${FILE}
63 ${switchoutput} Read Until >
64 : FOR ${flowElement} IN @{FLOWELMENTS}
65 \ should Not Contain ${switchoutput} ${flowElement}