058b0302845f5f9ba3bf08916bcd03f41f18e34b
[integration/test.git] / test / csit / suites / base-of13 / 080__Inventory_Performance / 010__restconf_inventory.txt
1 *** Settings ***
2 Documentation     Test suite for RESTCONF inventory
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           ../../../libraries/RequestsLibrary.py
7 Library           ../../../libraries/Common.py
8 Variables         ../../../variables/Variables.py
9
10 *** Variables ***
11 ${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
12
13
14 *** Test Cases *** 
15 Get list of nodes
16     [Documentation]    Get the inventory
17         ${resp}    Get    session    ${REST_CONTEXT}
18     Should Be Equal As Strings    ${resp.status_code}    200
19         ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
20         ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
21         ${numnodes}             Num Of Nodes    ${TOPO_TREE_DEPTH}      ${TOPO_TREE_FANOUT}
22         :FOR    ${IND}  IN RANGE        1       ${numnodes+1}   
23     \   Should Contain     ${resp.content}  openflow:${IND}
24
25 Get nodeconnector for the root node 
26     [Documentation]    Get the inventory for the root node
27     ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
28     ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
29     Should Be Equal As Strings   ${resp.status_code}    200
30     Check conn loop   ${TOPO_TREE_FANOUT}   1  ${resp.content}
31
32 Get nodeconnector for a node 
33     [Documentation]    Get the inventory for a node
34     ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
35     ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
36     ${numnodes}     Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
37     :FOR    ${IND}  IN RANGE    2   ${numnodes+1}
38     \   ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:${IND}
39     \   Should Be Equal As Strings   ${resp.status_code}    200
40     \   Check conn loop   ${TOPO_TREE_FANOUT+1}   ${IND}  ${resp.content}
41
42 Get Stats for a node
43     [Documentation]    Get the stats for a node
44     ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
45     ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
46     ${numnodes}     Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
47     :FOR    ${IND}  IN RANGE    1   ${numnodes+1}
48     \   ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:${IND}
49     \   Should Be Equal As Strings   ${resp.status_code}    200
50     \   Should Contain     ${resp.content}      flow-capable-node-connector-statistics
51     \   Should Contain     ${resp.content}      flow-table-statistics
52
53 *** Keywords ***
54 Check conn loop
55     [Arguments]     ${arg}  ${outerind}     ${content}
56     :FOR    ${var}  IN RANGE    1   ${arg+1}
57     \   Should Contain     ${content}      openflow:${outerind}:${var}