Fixing mininet reads so that we always clear mininet
[integration/test.git] / test / csit / suites / base-of13 / 080__Inventory_Performance / 020__switch_manager.txt
1 *** Settings ***
2 Documentation     Test suite for Switch Manager
3 Suite Setup       Create Session    ${ODL_CONTROLLER_SESSION}    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
4 Suite Teardown    Delete All Sessions
5 Library           Collections
6 Library           RequestsLibrary
7 Library           ../../../libraries/Common.py
8 Library           ../../../libraries/SwitchManager.py
9 Variables         ../../../variables/Variables.py
10 Library           ../../../libraries/Topologynew.py
11
12 *** Variables ***
13 ${REST_CONTEXT}    /controller/nb/v2/switchmanager
14
15 *** Test Cases ***
16
17 List all nodes
18     [Documentation]    List all nodes and their properties in the network.
19     [Tags]    list_info
20     Log    ${TOPO_TREE_LEVEL}
21     ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
22     ${resp}    Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/nodes
23     Should Be Equal As Strings    ${resp.status_code}    200    Response   status code error
24     ${jsondata}=    To JSON    ${resp.content}
25     ${nodes}    Extract All Nodes    ${jsondata}
26     List Should Contain Sublist   ${nodes}    ${topo_nodes}
27
28 Check root node connectors 
29     [Documentation]    List node connectors and verify all connectors are there
30     [Tags]    list_info
31     ${resp}    Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01
32     Should Be Equal As Strings    ${resp.status_code}    200    Response   status code error
33     ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
34     Check conn loop     ${TOPO_TREE_FANOUT}   1   ${resp.content}
35
36 Check node i connectors              
37     [Documentation]    List node connectors and verify all connectors are there                      
38     [Tags]    list_info
39     ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})   1
40     :FOR    ${ITEM}  IN     @{topo_nodes}
41     \   ${IND}  Get From Dictionary    ${ITEM}    id
42     \   ${resp}    Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/${IND}
43     \   Should Be Equal As Strings   ${resp.status_code}    200
44     \   Check conn loop   ${TOPO_TREE_FANOUT+1}   ${IND}  ${resp.content}
45
46 *** Keywords ***
47 Check conn loop
48     [Arguments]     ${arg}  ${outerind}     ${content}
49     :FOR    ${var}  IN RANGE    0   ${arg+1}
50     \   Should Contain     ${content}      "id":"${var}"
51