Step 2: Move test folder to root
[integration/test.git] / tools / Robot_Tool / suites / base / topology_manager.txt
1 *** Settings ***
2 Documentation     Test suite for the arp handler bundle.
3 Suite Teardown    Delete All Sessions
4 Library           Collections
5 Library           RequestsLibrary
6 Library           ../../libraries/Common.py
7 Variables         ../../variables/Variables.py
8
9 *** Variables ***
10 ${name}           test_userlink1
11 ${key}            userLinks
12 ${REST_CONTEXT}    /controller/nb/v2/topology
13
14 *** Test Cases ***
15 Add a userlink
16     [Documentation]    Add a userlink, list to validate the result.
17     [Tags]    add
18     ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
19     ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
20     ${headers}    Create Dictionary    Content-Type    application/json
21     Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
22     ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}    data=${body}
23     Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
24     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
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 userlink
31     [Documentation]    Remove a userlink, list to validate the result.
32     [Tags]    remove
33     ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
34     ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
35     ${headers}    Create Dictionary    Content-Type    application/json
36     Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
37     ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}
38     Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
39     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
40     Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
41     ${result}    To JSON    ${resp.content}
42     ${content}    Get From Dictionary    ${result}    ${key}
43     List Should Not Contain Value    ${content}    ${body}