--- /dev/null
+*** 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
+
--- /dev/null
+"""Custom LACP topology for LACP Module testing
+
+1.Two hosts(H1,H2) two interface each connected with Switch(S1)
+2.Two hosts(H3,H4) one interface each connected with Switch(S1)
+
+
+ - - - -
+ | H2 |
+ | |
+ - - - -
+ | |
+ | |
+ - - - - -
+- - - eth1 | | - - -
+| H1 |- - - - - - -| S1 |- - - - -| H3 |
+| |- - - - - - -| | | |
+- - - eth2 - - - - - - - -
+ |
+ - - -
+ | H4 |
+ - - -
+
+Execute Custom topology:
+sudo mn --custom LACP_custom1.py --switch ovsk,protocols=OpenFlow13 --topo=lacp
+
+Note:
+ 1.remoteController IP will be replaced in LACP_custom1.py using sed command during the robot execution
+ 2.bonding.conf will be copied the mininet server under /etc/modprobe.d
+ 3.h1-bonding.sh h2-bonding.sh will be executed in respective h1,h2 host console
+"""
+
+from mininet.cli import CLI
+from mininet.net import Mininet
+from mininet.node import OVSController,RemoteController
+from mininet.topo import Topo
+from mininet.link import Link
+
+class LacpTopo( Topo):
+ net = Mininet(controller=RemoteController)
+ c0 = net.addController('c0',controller=RemoteController,ip='CONTROLLER')
+ s1 = net.addSwitch('s1')
+ h1 = net.addHost('h1',mac='00:00:00:00:00:11')
+ h2 = net.addHost('h2',mac='00:00:00:00:00:22')
+ h3 = net.addHost('h3',mac='00:00:00:00:00:33',ip='10.1.1.3')
+ h4 = net.addHost('h4',mac='00:00:00:00:00:44',ip='10.1.1.4')
+
+ Link(s1, h1)
+ Link(s1, h1)
+ Link(s1, h2)
+ Link(s1, h2)
+ Link(s1, h3)
+ Link(s1, h4)
+ net.build()
+ s1.start([c0])
+ s1.cmd('sudo ovs-vsctl set bridge s1 protocols=OpenFlow13')
+ print h1.cmd('./h1-bond0.sh')
+ print h2.cmd('./h2-bond0.sh')
+ CLI(net)
+ net.stop()
+
+topos = { 'lacp': (lambda: LacpTopo() ) }
+