-*** Settings ***
-Documentation Test suite for RESTCONF LACP inventory
-Suite Setup Create Session session http://${CONTROLLER}:8181 auth=${AUTH} headers=${HEADERS}
-Suite Teardown Delete All Sessions
-Library SSHLibrary
-Library Collections
-Library ../../../libraries/RequestsLibrary.py
-Library ../../../libraries/Common.py
-Library robot.libraries.XML
-Variables ../../../variables/Variables.py
-
-
-*** Variables ***
-${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
-${node1} openflow:1
-${agg-id1} 1
-${agg-id2} 2
-${agg1-connector-id1} 1
-${agg1-connector-id2} 2
-${agg2-connector-id1} 3
-${agg2-connector-id2} 4
-${lacp-mac} 01:80:c2:00:00:02
-${lacp-ether-type} 0x8809
-
-*** Test Cases ***
-Get list of nodes and LACP reference on Inventory
- [Documentation] Get the nodes data
- ${resp} Get session ${REST_CONTEXT}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${node1}
- Should Contain ${resp.content} non-lag-groupid
- Should Contain ${resp.content} lacp-aggregators
-
-Get the Specific Node Inventory and Lacp aggregator details
- [Documentation] Get the lacp-aggregator data for specific node
- ${resp} Get session ${REST_CONTEXT}/node/${node1}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${node1}
- Should Contain ${resp.content} <agg-id>${agg-id1}</agg-id>
- Should Contain ${resp.content} <agg-id>${agg-id2}</agg-id>
- ${non-lag-group-id}= Get_Element ${resp} non-lag-groupid
-
-Get information of each lacp-aggregator for a node
- [Documentation] Get each lacp-aggregator data for a node
- ${resp} Get session ${REST_CONTEXT}/node/${node1}/lacp-aggregators/${agg-id1}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${agg-id1}
- Should Contain ${resp.content} ${node1}
- Should Contain ${resp.content} ${node1}:${agg1-connector-id1}
- Should Contain ${resp.content} ${node1}:${agg1-connector-id2}
- Should Contain ${resp.content} lag-groupid
- ${lag-group-id1}= Get_Element ${resp} lag-groupid
-
- ${resp} Get session ${REST_CONTEXT}/node/${node1}/lacp-aggregators/${agg-id2}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${agg-id2}
- Should Contain ${resp.content} ${node1}
- Should Contain ${resp.content} ${node1}:${agg2-connector-id1}
- Should Contain ${resp.content} ${node1}:${agg2-connector-id2}
- Should Contain ${resp.content} lag-groupid
- ${lag-group-id2}= Get_Element ${resp} lag-groupid
-
-Get node connector data for node 1
- [Documentation] Get the node connector inventory for node 1
- ${resp} Get session ${REST_CONTEXT}/node/${node1}/node-connector/${node1}:${agg1-connector-id1}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${node1}
- Should Contain ${resp.content} agg-id='${agg-id1}'
-
- ${resp} Get session ${REST_CONTEXT}/node/${node1}/node-connector/${node1}:${agg1-connector-id2}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${node1}
- Should Contain ${resp.content} agg-id='${agg-id1}'
-
- ${resp} Get session ${REST_CONTEXT}/node/${node1}/node-connector/${node1}:${agg2-connector-id1}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${node1}
- Should Contain ${resp.content} agg-id='${agg-id2}'
-
- ${resp} Get session ${REST_CONTEXT}/node/${node1}/node-connector/${node1}:${agg2-connector-id2}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain ${resp.content} ${node1}
- Should Contain ${resp.content} agg-id='${agg-id2}'
-
-Verification of Switch(S1) Flow and Group tables
- [Documentation] Verification of Switch(S1) Flow and Group tables
- Verify Switch S1 Flow Table
- Verify Switch S1 Group Table
-
-*** Keywords ***
-Verify Switch S1 Flow Table for LACP flow
- Log OVS Switch(S1) Flow table Verification
- Open Connection ${MININET} prompt=>
- Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
- Sleep 15
- Write clear
- Sleep 5
- Write sudo ovs-ofctl dump-flows s1 -O OpenFlow13
- Sleep 5
- ${s1_flow}= Read
- Should Contain ${s1_flow} dl_dst=${lacp-mac},dl_type=${lacp-ether-type} actions=CONTROLLER:65535
-
-Verify Switch S1 Group Table
- Log OVS Switch(S1) Group table Verification
- Open Connection ${MININET} prompt=>
- Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
- Sleep 15
- Write clear
- Sleep 5
- Write sudo ovs-ofctl dump-groups s1 -O OpenFlow13
- Sleep 5
- $(s1_group}= Read
- Should Contain ${s1_group} group_id=${lag-group-id1},type=select
- Should Contain ${s1_group} group_id=${lag-group-id2},type=select
- Should Contain ${s1_group} group_id=${non-lag-group-id},type=all
-