2 Documentation Test suite for the container manager module.
3 Suite Teardown Delete All Sessions
5 Library ../../libraries/RequestsLibrary.py
6 Library ../../libraries/Common.py
7 Variables ../../variables/Variables.py
10 ${name} test_container1
11 @{nodeconnectors} OF|1@OF|00:00:00:00:00:00:00:01 OF|23@OF|00:00:00:00:00:00:20:21
12 ${key} container-config
13 ${REST_CONTEXT} /controller/nb/v2/containermanager
17 [Documentation] Add a container, list to validate the result.
19 ${flowspecs} Convert To List ${EMPTY}
20 ${body} Create Dictionary container ${name} flowSpecs ${flowspecs} staticVlan
21 ... 10 nodeConnectors ${nodeconnectors}
22 ${headers} Create Dictionary Content-Type application/json
23 Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth}
24 ${resp} Put session ${REST_CONTEXT}/container/${name} data=${body}
25 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
26 ${resp} Get session ${REST_CONTEXT}/containers
27 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
28 ${result} To JSON ${resp.content}
29 ${content} Get From Dictionary ${result} ${key}
30 List Should Contain Value ${content} ${body}
33 [Documentation] Remove a container, list to validate the result.
35 ${flowspecs} Convert To List ${EMPTY}
36 ${body} Create Dictionary container ${name} flowSpecs ${flowspecs} staticVlan
37 ... 10 nodeConnectors ${nodeconnectors}
38 ${headers} Create Dictionary Content-Type application/json
39 Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth}
40 ${resp} Delete session ${REST_CONTEXT}/container/${name}
41 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
42 ${resp} Get session ${REST_CONTEXT}/containers
43 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
44 ${result} To JSON ${resp.content}
45 ${content} Get From Dictionary ${result} ${key}
46 List Should Not Contain Value ${content} ${body}