2 Documentation Test suite for the host tracker module.
3 Suite Teardown Delete All Sessions
5 Library ../../libraries/RequestsLibrary.py
6 Library ../../libraries/Common.py
7 Variables ../../variables/Variables.py
12 ${REST_CONTEXT} /controller/nb/v2/hosttracker
16 [Documentation] Add a host, list to validate the result.
18 ${body} Create Dictionary nodeType OF dataLayerAddress 5e:bf:79:84:10:a6 vlan
19 ... 1 nodeId 00:00:00:00:00:00:00:03 nodeConnectorId 9 networkAddress
20 ... 10.0.1.4 staticHost ${True} nodeConnectorType OF
21 ${headers} Create Dictionary Content-Type application/json
22 Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth}
23 ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/address/${name} data=${body}
24 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
25 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
26 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
27 ${result} To JSON ${resp.content}
28 ${content} Get From Dictionary ${result} ${key}
29 List Should Contain Value ${content} ${body}
32 [Documentation] Remove a host, list to validate the result.
34 ${body} Create Dictionary nodeType OF dataLayerAddress 5e:bf:79:84:10:a6 vlan
35 ... 1 nodeId 00:00:00:00:00:00:00:03 nodeConnectorId 9 networkAddress
36 ... 10.0.1.4 staticHost ${True} nodeConnectorType OF
37 ${headers} Create Dictionary Content-Type application/json
38 Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth}
39 ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/address/${name}
40 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
41 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
42 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
43 ${result} To JSON ${resp.content}
44 ${content} Get From Dictionary ${result} ${key}
45 List Should Not Contain Value ${content} ${body}