Correctly space expected_status
[integration/test.git] / csit / suites / l2switch / Inventory_Scalability_OF13 / 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
10 Suite Setup         Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
11 Suite Teardown      Delete All Sessions
12
13
14 *** Variables ***
15 ${REST_CONTEXT}     /restconf/operational/network-topology:network-topology/topology/flow:1
16
17
18 *** Test Cases ***
19 Get Nodes Count
20     [Documentation]    Checks the number of switches
21     ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
22     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
23     ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
24     Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    node    ${numnodes}
25
26 Get Links Count
27     [Documentation]    Checks the number of links
28     ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
29     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
30     ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
31     ${numlinks}    Evaluate    (${numnodes}-1)*2
32     Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    link    ${numlinks}
33
34
35 *** Keywords ***
36 Verify Element Count
37     [Arguments]    ${URI}    ${xpath_location}    ${expected_count}
38     ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}    headers=${ACCEPT_XML}
39     Log    ${resp.content}
40     Should Be Equal As Strings    ${resp.status_code}    200
41     ${count}    Get Element Count    ${resp.content}    xpath=${xpath_location}
42     Should Be Equal As Numbers    ${count}    ${expected_count}