2 Documentation Test suite for Flow Programmer
3 Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
6 Library ../../../libraries/RequestsLibrary.py
7 Library ../../../libraries/Common.py
8 Variables ../../../variables/Variables.py
9 Resource ../../../libraries/Utils.txt
14 ${node_id} 00:00:00:00:00:00:00:02
15 ${REST_CONTEXT} /controller/nb/v2/flowprogrammer
16 ${REST_CONTEXT_ST} /controller/nb/v2/statistics
20 [Documentation] Add a flow, list to validate the result.
22 ${node} Create Dictionary type=OF id=${node_id}
23 ${actions} Create List OUTPUT=1
24 ${body} Create Dictionary name=${name} installInHw=true node=${node}
25 ... priority=1 etherType=0x800 nwDst=10.0.0.1/32 actions=${actions}
26 ${resp} RequestsLibrary.Put session ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name} data=${body}
27 Should Be Equal As Strings ${resp.status_code} 201
28 ${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}
29 Should Be Equal As Strings ${resp.status_code} 200
30 ${result} To JSON ${resp.content}
31 ${content} Get From Dictionary ${result} ${key}
32 List Should Contain Value ${content} ${body}
34 Check flow in flow stats
35 [Documentation] Show flow stats and validate result
37 ${elements}= Create List 10.0.0.1
38 Wait Until Keyword Succeeds 90s 2s Check For Elements At URI ${REST_CONTEXT_ST}/${CONTAINER}/flow ${elements}
41 [Documentation] Remove a flow, list to validate the result.
43 ${node} Create Dictionary type=OF id=${node_id}
44 ${actions} Create List OUTPUT=1
45 ${body} Create Dictionary name=${name} installInHw=true node=${node}
46 ... priority=1 etherType=0x800 nwDst=10.0.0.1/32 actions=${actions}
47 ${resp} RequestsLibrary.Delete session ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}
48 Should Be Equal As Strings ${resp.status_code} 204
49 ${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}
50 Should Be Equal As Strings ${resp.status_code} 200
51 ${result} To JSON ${resp.content}
52 ${content} Get From Dictionary ${result} ${key}
53 List Should Not Contain Value ${content} ${body}
55 Check flow is not in flow stats
56 [Documentation] Show flow stats and validate result
58 ${elements}= Create List 10.0.0.1
59 Wait Until Keyword Succeeds 60s 2s Check For Elements Not At URI ${REST_CONTEXT_ST}/${CONTAINER}/flow ${elements}