Step 1: Move vm scripts to the right place
[integration/test.git] / test / csit / suites / openflowplugin / Inventory_Scalability_OF13 / 050__topology_manager.robot
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           RequestsLibrary
7 Library           ../../../libraries/Common.py
8 Library           ../../../libraries/Topologynew.py
9 Variables         ../../../variables/Variables.py
10
11 *** Variables ***
12 ${nodeprefix}     openflow:
13 ${REST_CONTEXT}    /controller/nb/v2/topology
14
15 *** Test Cases ***
16 Get Topology
17     [Documentation]    Get Topology and validate the result.
18     [Tags]    adsal
19     ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
20     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
21     ${leaflist}    Get Ids Of Leaf Nodes    ${TOPO_TREE_FANOUT}    ${TOPO_TREE_DEPTH}
22     ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
23     Wait Until Keyword Succeeds    30s    2s    Check Link Counts For Each Node    ${topo_nodes}    ${leaflist}
24
25 *** Keywords ***
26 Check Link Counts For Each Node
27     [Arguments]    ${topo_nodes}    ${leaflist}
28     ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}
29     Log    ${resp.content}
30     Should Be Equal As Strings    ${resp.status_code}    200
31     Should Contain X Times    ${resp.content}    "00:00:00:00:00:00:00:01"    ${TOPO_TREE_FANOUT*2}
32     : FOR    ${ITEM}    IN    @{topo_nodes}
33     \    ${IND}    Get From Dictionary    ${ITEM}    id
34     \    ${linkcnt}    Num Of Links For Node    ${IND}    ${leaflist}    ${TOPO_TREE_FANOUT}
35     \    Should Contain X Times    ${resp.content}    "${IND}"    ${linkcnt*2}