Correctly space expected_status
[integration/test.git] / csit / suites / openflowplugin / Inventory_Scalability_OF10 / 020__restconf_topology.robot
1 *** Settings ***
2 Documentation       Test suite for RESTCONF topology
3
4 Library             Collections
5 Library             XML
6 Library             RequestsLibrary
7 Library             ../../../libraries/Common.py
8 Variables           ../../../variables/Variables.py
9 Resource            ../../../variables/openflowplugin/Variables.robot
10
11 Suite Setup         Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
12 Suite Teardown      Delete All Sessions
13
14
15 *** Test Cases ***
16 Get Nodes Count
17     [Documentation]    Checks the number of switches
18     ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
19     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
20     ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
21     Wait Until Keyword Succeeds
22     ...    60s
23     ...    2s
24     ...    Verify Element Count
25     ...    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
26     ...    node
27     ...    ${numnodes}
28
29 Get Links Count
30     [Documentation]    Checks the number of links
31     ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
32     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
33     ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
34     ${numlinks}    Evaluate    (${numnodes}-1)*2
35     Wait Until Keyword Succeeds
36     ...    60s
37     ...    2s
38     ...    Verify Element Count
39     ...    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
40     ...    link
41     ...    ${numlinks}
42
43
44 *** Keywords ***
45 Verify Element Count
46     [Arguments]    ${URI}    ${xpath_location}    ${expected_count}
47     ${resp}    RequestsLibrary.Get Request    session    ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}    headers=${ACCEPT_XML}
48     Log    ${resp.text}
49     Should Be Equal As Strings    ${resp.status_code}    200
50     ${count}    Get Element Count    ${resp.text}    xpath=${xpath_location}
51     Should Be Equal As Numbers    ${count}    ${expected_count}