Step 2: Move test folder to root
[integration/test.git] / csit / suites / lacp / Lacp_Feature_OF13 / 010__lacp_inventory.robot
1 *** Settings ***\r
2 Documentation     Test suite for RESTCONF LACP inventory\r
3 Suite Setup       LACP Inventory Suite Setup\r
4 Suite Teardown    Delete All Sessions\r
5 Library           SSHLibrary\r
6 Library           Collections\r
7 Library           RequestsLibrary\r
8 Library           ../../../libraries/Common.py\r
9 Variables         ../../../variables/Variables.py\r
10 \r
11 *** Variables ***\r
12 ${node1}          openflow:1\r
13 ${agg-id1}        1\r
14 ${agg-id2}        2\r
15 ${agg1-connector-id1}    1\r
16 ${agg1-connector-id2}    2\r
17 ${agg2-connector-id1}    3\r
18 ${agg2-connector-id2}    4\r
19 \r
20 *** Test Cases ***\r
21 Get the Specific Node Inventory and Lacp aggregator details\r
22     [Documentation]    Get the lacp-aggregator data for specific node\r
23     ${resp}    Get    session    ${OPERATIONAL_NODES_API}/node/${node1}\r
24     Verify LACP RESTAPI Response Code for node\r
25     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    ${agg-id1}\r
26     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    ${agg-id2}\r
27 \r
28 Get information of each lacp-aggregator for a node\r
29     [Documentation]    Get each lacp-aggregator data for a node\r
30     ${resp}    Get    session    ${OPERATIONAL_NODES_API}/node/${node1}/lacp-aggregators/${agg-id1}\r
31     Verify LACP RESTAPI Response Code for node\r
32     Verify LACP connector associated for aggregator    ${resp.content}    ${node1}    ${agg1-connector-id1}\r
33     Verify LACP connector associated for aggregator    ${resp.content}    ${node1}    ${agg1-connector-id2}\r
34     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    lag-groupid\r
35     ${resp}    Get    session    ${OPERATIONAL_NODES_API}/node/${node1}/lacp-aggregators/${agg-id2}\r
36     Verify LACP RESTAPI Response Code for node\r
37     Verify LACP connector associated for aggregator    ${resp.content}    ${node1}    ${agg2-connector-id1}\r
38     Verify LACP connector associated for aggregator    ${resp.content}    ${node1}    ${agg2-connector-id2}\r
39     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    lag-groupid\r
40 \r
41 Get node connector data for node 1\r
42     [Documentation]    Get the node connector inventory for node 1\r
43     ${resp}    Get    session    ${OPERATIONAL_NODES_API}/node/${node1}/node-connector/${node1}:${agg1-connector-id1}\r
44     Verify LACP RESTAPI Response Code for node\r
45     Verify specific LACP node connector data for node    ${resp.content}    ${agg-id1}    agg-id\r
46     ${resp}    Get    session    ${OPERATIONAL_NODES_API}/node/${node1}/node-connector/${node1}:${agg1-connector-id2}\r
47     Verify LACP RESTAPI Response Code for node\r
48     Verify specific LACP node connector data for node    ${resp.content}    ${agg-id1}    agg-id\r
49     ${resp}    Get    session    ${OPERATIONAL_NODES_API}/node/${node1}/node-connector/${node1}:${agg2-connector-id1}\r
50     Verify LACP RESTAPI Response Code for node\r
51     Verify specific LACP node connector data for node    ${resp.content}    ${agg-id2}    agg-id\r
52     ${resp}    Get    session    ${OPERATIONAL_NODES_API}/node/${node1}/node-connector/${node1}:${agg2-connector-id2}\r
53     Verify LACP RESTAPI Response Code for node\r
54     Verify specific LACP node connector data for node    ${resp.content}    ${agg-id2}    agg-id\r
55 \r
56 *** Keywords ***\r
57 Verify LACP RESTAPI Response Code for node\r
58     [Documentation]    Will check for the response code of the REST query\r
59     Should Be Equal As Strings    ${resp.status_code}    200\r
60     Should Contain    ${resp.content}    ${node1}\r
61 \r
62 Verify LACP RESTAPI Aggregator and Tag Contents\r
63     [Arguments]    ${resp.content}    ${content-lookup}\r
64     [Documentation]    Will check for the LACP Specific tags or Aggregator ID for node\r
65     Should Contain    ${resp.content}    ${content-lookup}\r
66 \r
67 Verify LACP connector associated for aggregator\r
68     [Arguments]    ${resp.content}    ${node}    ${agg-connector-id}\r
69     [Documentation]    Will check for the LACP connector info for each aggregator\r
70     Should Contain    ${resp.content}    ${node}:${agg-connector-id}\r
71 \r
72 Verify specific LACP node connector data for node\r
73     [Arguments]    ${resp.content}    ${agg-id}    ${connector}\r
74     [Documentation]    Will check for node connectory info for node\r
75     Should Contain    ${resp.content}    ${connector}='${agg-id}'\r
76 \r
77 Verify LACP Tags Are Formed\r
78     [Documentation]    Fundamental Check That LACP is working\r
79     ${resp}    Get    session    ${OPERATIONAL_NODES_API}\r
80     Verify LACP RESTAPI Response Code for node\r
81     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    non-lag-groupid\r
82     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    lacp-aggregators\r
83 \r
84 LACP Inventory Suite Setup\r
85     [Documentation]    If these basic checks fail, there is no need to continue any of the other test cases\r
86     Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}\r
87     Wait Until Keyword Succeeds    10s    1s    Verify LACP Tags Are Formed\r