Fixing mininet reads so that we always clear mininet
[integration/test.git] / test / csit / suites / base-of10 / 010__AD_SAL_NSF / 030__topology_manager.txt
1 *** Settings ***
2 Documentation     Test suite for Topology Manager
3 Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   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 ${node1}   "00:00:00:00:00:00:00:01"
12 ${node2}   "00:00:00:00:00:00:00:02"
13 ${node3}   "00:00:00:00:00:00:00:03"
14 ${name}           test_userlink1
15 ${key}            userLinks
16 ${REST_CONTEXT}    /controller/nb/v2/topology
17
18 *** Test Cases ***
19 Get Topology
20     [Documentation]    Get Topology and validate the result.
21     [Tags]    get
22     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
23     Should Be Equal As Strings    ${resp.status_code}    200 
24     Log    ${resp.content}
25     Should Contain X Times  ${resp.content}   ${node1}   4
26     Should Contain X Times  ${resp.content}   ${node2}   2
27     Should Contain X Times  ${resp.content}   ${node3}   2
28 Add a userlink
29     [Documentation]    Add a userlink, list to validate the result.
30     [Tags]    add
31     ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
32     ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
33     ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}    data=${body}
34     Should Be Equal As Strings    ${resp.status_code}    201
35     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
36     Should Be Equal As Strings    ${resp.status_code}    200
37     ${result}    To JSON    ${resp.content}
38     ${content}    Get From Dictionary    ${result}    ${key}
39     List Should Contain Value    ${content}    ${body}
40 Remove a userlink
41     [Documentation]    Remove a userlink, list to validate the result.
42     [Tags]    remove
43     ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
44     ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
45     ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}
46     Should Be Equal As Strings    ${resp.status_code}    204
47     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
48     Should Be Equal As Strings    ${resp.status_code}    200
49     ${result}    To JSON    ${resp.content}
50     ${content}    Get From Dictionary    ${result}    ${key}
51     List Should Not Contain Value    ${content}    ${body}