Tidied new and updated test suites
[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    ${resp}
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    ${resp}
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    ${resp}
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    ${resp}
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    ${resp}
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    ${resp}
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    ${resp}
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     [Arguments]    ${resp}
59     [Documentation]    Will check for the response code of the REST query
60     Should Be Equal As Strings    ${resp.status_code}    200
61     Should Contain    ${resp.content}    ${node1}
62
63 Verify LACP RESTAPI Aggregator and Tag Contents
64     [Arguments]    ${resp.content}    ${content-lookup}
65     [Documentation]    Will check for the LACP Specific tags or Aggregator ID for node
66     Should Contain    ${resp.content}    ${content-lookup}
67
68 Verify LACP connector associated for aggregator
69     [Arguments]    ${resp.content}    ${node}    ${agg-connector-id}
70     [Documentation]    Will check for the LACP connector info for each aggregator
71     Should Contain    ${resp.content}    ${node}:${agg-connector-id}
72
73 Verify specific LACP node connector data for node
74     [Arguments]    ${resp.content}    ${agg-id}    ${connector}
75     [Documentation]    Will check for node connectory info for node
76     Should Contain    ${resp.content}    ${connector}='${agg-id}'
77
78 Verify LACP Tags Are Formed
79     [Documentation]    Fundamental Check That LACP is working
80     ${resp}    Get    session    ${OPERATIONAL_NODES_API}
81     Verify LACP RESTAPI Response Code for node    ${resp}
82     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    non-lag-groupid
83     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    lacp-aggregators
84
85 LACP Inventory Suite Setup
86     [Documentation]    If these basic checks fail, there is no need to continue any of the other test cases
87     Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
88     Wait Until Keyword Succeeds    10s    1s    Verify LACP Tags Are Formed