Step 1: Move vm scripts to the right place
[integration/test.git] / csit / suites / openflowplugin / Inventory_Scalability_OF10 / 030__switch_manager.robot
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 List all nodes
17     [Documentation]    List all nodes and their properties in the network.
18     [Tags]    adsal
19     Log    ${TOPO_TREE_LEVEL}
20     ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
21     ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/nodes
22     Log    ${resp.content}
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]    adsal
31     ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01
32     Log    ${resp.content}
33     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
34     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
35     Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.content}
36
37 Check node i connectors
38     [Documentation]    List node connectors and verify all connectors are there
39     [Tags]    adsal
40     ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
41     Wait Until Keyword Succeeds    30s    2s    Check Every Nodes Connectors    ${topo_nodes}
42
43 *** Keywords ***
44 Check Every Nodes Connectors
45     [Arguments]    ${topo_nodes}
46     : FOR    ${ITEM}    IN    @{topo_nodes}
47     \    ${IND}    Get From Dictionary    ${ITEM}    id
48     \    ${resp}    RequestsLibrary.Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/${IND}
49     \    Log    ${resp.content}
50     \    Should Be Equal As Strings    ${resp.status_code}    200
51     \    Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.content}
52
53 Check conn loop
54     [Arguments]    ${arg}    ${outerind}    ${content}
55     : FOR    ${var}    IN RANGE    0    ${arg+1}
56     \    Should Contain    ${content}    "id":"${var}"