renamed the test cases file name to contain proper
[integration/test.git] / test / csit / suites / karaf-compatible / 080__Inventory_Performance / 015__restconf_topology.txt
1 *** Settings ***
2 Documentation     Test suite for RESTCONF topology
3 Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
4 Suite Teardown    Delete All Sessions
5 Library           Collections
6 Library           XML
7 Library           ../../../libraries/RequestsLibrary.py
8 Library           ../../../libraries/Common.py
9 Variables         ../../../variables/Variables.py
10
11 *** Variables ***
12 ${REST_CONTEXT}    /restconf/operational/network-topology:network-topology/topology/flow:1
13
14
15 *** Test Cases *** 
16 Get Nodes Count
17     [Documentation]    Checks the number of switches
18         ${resp}    Get    session    ${REST_CONTEXT}   headers=${ACCEPT_XML}
19         Should Be Equal As Strings    ${resp.status_code}    200
20         ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
21         ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
22         ${numnodes}             Num Of Nodes    ${TOPO_TREE_DEPTH}      ${TOPO_TREE_FANOUT}
23         ${count}=    Get Element Count    ${resp.content}    xpath=node
24         Should Be Equal As Numbers     ${count}     ${numnodes}
25 Get Links Count
26     [Documentation]    Checks the number of links
27         ${resp}    Get    session    ${REST_CONTEXT}   headers=${ACCEPT_XML}
28         Should Be Equal As Strings    ${resp.status_code}    200
29         ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
30         ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
31         ${numnodes}           Num Of Nodes    ${TOPO_TREE_DEPTH}      ${TOPO_TREE_FANOUT}
32         ${numlinks}           Evaluate        (${numnodes}-1)*2
33         ${count}=    Get Element Count    ${resp.content}    xpath=link
34         Should Be Equal As Numbers     ${count}     ${numlinks}