Create stats mgr + Complete some test cases with mininet + fix test file names
[integration/test.git] / test / csit / suites / base / 025__host_tracker.txt
1 *** Settings ***
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
5 Library           Collections
6 Library           ../../libraries/RequestsLibrary.py
7 Library           ../../libraries/Common.py
8 Variables         ../../variables/Variables.py
9
10 *** Variables ***
11 ${name}           10.0.1.4
12 ${key}            hostConfig
13 ${REST_CONTEXT}    /controller/nb/v2/hosttracker
14
15 *** Test Cases ***
16 Add a host
17     [Documentation]    Add a host, list to validate the result.
18     [Tags]    add
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}
29
30 Remove a host
31     [Documentation]    Remove a host, list to validate the result.
32     [Tags]    remove
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}