${flows}= String.Get RegExp Matches ${output} (?<=flow_count\=).*?(?=\r)
${total_flows}= BuiltIn.Evaluate sum(map(int, ${flows}))
Should Be Equal As Numbers ${total_flows} ${flow_count}
+
+Verify Mininet Ping
+ [Arguments] ${host1} ${host2}
+ [Documentation] Send ping from mininet and verify connectivity.
+ Write ${host1} ping -w 3 ${host2}
+ ${result}= Read Until mininet>
+ Should Contain ${result} 64 bytes
+
+Verify Mininet No Ping
+ [Arguments] ${host1} ${host2}
+ [Documentation] Send ping from mininet and verify no conectivity.
+ Write ${host1} ping -w 3 ${host2}
+ ${result}= Read Until mininet>
+ Should Contain ${result} 100% packet loss
--- /dev/null
+*** Settings ***
+Documentation Test suite for legato topology of 1 switch
+Suite Setup Setup Test Environment
+Suite Teardown Delete All Sessions
+Library RequestsLibrary
+Library SSHLibrary
+Library Collections
+Library OperatingSystem
+Resource ../../../libraries/Utils.robot
+Resource ../../../libraries/MininetKeywords.robot
+Resource ../../../libraries/TemplatedRequests.robot
+Resource ../../../variables/Variables.robot
+
+*** Variables ***
+${UniMgr_variables_DIR} ${CURDIR}/../../../variables/unimgr
+${options} --topo single,2 --switch ovsk,protocols=OpenFlow13
+
+*** Test Cases ***
+Check no connectivity before creating service
+ [Documentation] Verify no connectivity before creating the service between h1 to h2
+ MininetKeywords.Verify Mininet No Ping h1 h2
+
+Create epl service
+ [Documentation] Create point to point service between the eth ports
+ ${interface} Create List s1-eth1 s1-eth2
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${CONFIG_API}/mef-interfaces:mef-interfaces/ ${interface}
+ ${body}= OperatingSystem.Get File ${UniMgr_variables_DIR}/add_epl.json
+ ${resp} RequestsLibrary.Put Request session ${CONFIG_API}/mef-services:mef-services/ headers=${HEADERS_YANG_JSON} data=${body}
+ Log ${resp.content}
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
+ ${elements} Create List eth1 eth2
+ Wait Until Keyword Succeeds 24s 2s Check For Elements At URI ${CONFIG_API}/elan:elan-interfaces/ ${elements}
+
+Check ping between h1-h2 after service creation
+ [Documentation] Verify ping between the hosts h1 - h2
+ MininetKeywords.Verify Mininet Ping h1 h2
+ Wait Until Keyword Succeeds 8s 2s MininetKeywords.Verify Mininet Ping h1 h2
+
+Delete epl service
+ [Documentation] Delete the evc point to point & verify no ping
+ ${resp} RequestsLibrary.Delete Request session ${CONFIG_API}/mef-services:mef-services/ headers=${HEADERS_YANG_JSON}
+ Log ${resp.content}
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
+
+Check no connectivity after deleting service
+ [Documentation] Verify no ping after deleteing the eplan service
+ Wait Until Keyword Succeeds 8s 2s MininetKeywords.Verify Mininet No Ping h1 h2
+
+*** Keywords ***
+Setup Test Environment
+ [Documentation] Establish the Opendayligh session and prepair 1 Mininet VMs
+ Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+ Mininetkeywords.Start Mininet Single Controller options=${options}
--- /dev/null
+*** Settings ***
+Documentation Test suite for legato topology of 1 switch
+Suite Setup Setup Test Environment
+Suite Teardown Delete All Sessions
+Library RequestsLibrary
+Library SSHLibrary
+Library Collections
+Library OperatingSystem
+Resource ../../../libraries/Utils.robot
+Resource ../../../libraries/MininetKeywords.robot
+Resource ../../../libraries/TemplatedRequests.robot
+Resource ../../../variables/Variables.robot
+
+*** Variables ***
+${UniMgr_variables_DIR} ${CURDIR}/../../../variables/unimgr
+${options} --topo single,5 --switch ovsk,protocols=OpenFlow13
+
+*** Test Cases ***
+Check no connectivity before creating service
+ [Documentation] Verify packet loss before creating the service between h3 to h4
+ MininetKeywords.Verify Mininet No Ping h3 h4
+
+Create epl service
+ [Documentation] Create multi point to multi point service between the eth ports
+ ${interface} Create List s1-eth1 s1-eth2
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${CONFIG_API}/mef-interfaces:mef-interfaces/ ${interface}
+ ${body}= OperatingSystem.Get File ${UniMgr_variables_DIR}/add_eplan.json
+ ${resp} RequestsLibrary.Put Request session ${CONFIG_API}/mef-services:mef-services/ headers=${HEADERS_YANG_JSON} data=${body}
+ Log ${resp.content}
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
+ ${elements} Create List eth3 eth4 eth5
+ Wait Until Keyword Succeeds 24s 8s Check For Elements At URI ${CONFIG_API}/elan:elan-interfaces/ ${elements}
+
+Check ping between h3-h4 after service creation
+ [Documentation] Verify ping between the hosts h3 - h4
+ MininetKeywords.Verify Mininet Ping h3 h4
+ Wait Until Keyword Succeeds 8s 2s MininetKeywords.Verify Mininet Ping h3 h4
+
+Check ping between h4-h5 after service creation
+ [Documentation] Verify ping between the hosts h4 - h5
+ MininetKeywords.Verify Mininet Ping h4 h5
+ Wait Until Keyword Succeeds 8s 2s MininetKeywords.Verify Mininet Ping h4 h5
+
+Check ping between h3-h5 after service creation
+ [Documentation] Verify ping between the hosts h3 - h5
+ MininetKeywords.Verify Mininet Ping h3 h5
+ Wait Until Keyword Succeeds 8s 2s MininetKeywords.Verify Mininet Ping h3 h5
+
+Delete epl service
+ [Documentation] Delete the evc multi point to multi point & verify no ping
+ ${resp} RequestsLibrary.Delete Request session ${CONFIG_API}/mef-services:mef-services/ headers=${HEADERS_YANG_JSON}
+ Log ${resp.content}
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
+
+Check no connectivity after deleting service
+ [Documentation] Verify no ping after deleteing the eplan service
+ Wait Until Keyword Succeeds 8s 2s MininetKeywords.Verify Mininet No Ping h3 h4
+
+*** Keywords ***
+Setup Test Environment
+ [Documentation] Establish the Opendayligh session and prepair 1 Mininet VMs
+ Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+ Mininetkeywords.Start Mininet Single Controller options=${options}
--- /dev/null
+# Place the suites in run order:
+integration/test/csit/suites/unimgr/uni_legato
--- /dev/null
+{
+"mef-services": {
+ "mef-service": [
+ {
+ "svc-id": 1,
+ "svc-type": "epl",
+ "evc": {
+ "evc-id": "1",
+ "unis": {
+ "uni": [
+ {
+ "uni-id": "1:s1-eth1",
+ "role": "root"
+ },
+ {
+ "uni-id": "1:s1-eth2",
+ "role": "root"
+ }
+ ]
+ },
+ "evc-type": "point-to-point"
+ }
+ }
+ ]
+ }
+}
--- /dev/null
+{
+"mef-services": {
+ "mef-service": [
+ {
+ "svc-id": 2,
+ "svc-type": "eplan",
+ "evc": {
+ "evc-id": "2",
+ "unis": {
+ "uni": [
+ {
+ "uni-id": "1:s1-eth3",
+ "role": "root"
+ },
+ {
+ "uni-id": "1:s1-eth4",
+ "role": "root"
+ },
+ {
+ "uni-id": "1:s1-eth5",
+ "role": "root"
+ }
+ ]
+ },
+ "evc-type": "multipoint-to-multipoint"
+ }
+ }
+ ]
+ }
+}