2 Documentation Test suite for the host tracker module.
3 Suite Setup Create Session session http://${CONTROLLER}:8080 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
13 ${REST_CONTEXT} /controller/nb/v2/hosttracker
17 [Documentation] Add a host, list to validate the result.
19 ${body} Create Dictionary nodeType OF dataLayerAddress 5e:bf:79:84:10:a6 vlan
20 ... 1 nodeId 00:00:00:00:00:00:00:03 nodeConnectorId 9 networkAddress
21 ... 10.0.1.4 staticHost ${True} nodeConnectorType OF
22 ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/address/${name} data=${body}
23 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
24 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
25 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
26 ${result} To JSON ${resp.content}
27 ${content} Get From Dictionary ${result} ${key}
28 List Should Contain Value ${content} ${body}
31 [Documentation] Remove a host, list to validate the result.
33 ${body} Create Dictionary nodeType OF dataLayerAddress 5e:bf:79:84:10:a6 vlan
34 ... 1 nodeId 00:00:00:00:00:00:00:03 nodeConnectorId 9 networkAddress
35 ... 10.0.1.4 staticHost ${True} nodeConnectorType OF
36 ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/address/${name}
37 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
38 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
39 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
40 ${result} To JSON ${resp.content}
41 ${content} Get From Dictionary ${result} ${key}
42 List Should Not Contain Value ${content} ${body}