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