Unmgr/Legato: epl and eplan tests 25/46625/46
authorAmir Abudi <amir.abudi@hpe.com>
Mon, 26 Sep 2016 22:14:54 +0000 (15:14 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Mon, 14 Nov 2016 17:41:10 +0000 (17:41 +0000)
Change-Id: Icb00393ec0f9e4d728a9c573d683f4cf5e31d626
Signed-off-by: Amir Abudi <amir.abudi@hpe.com>
csit/libraries/MininetKeywords.robot
csit/suites/unimgr/uni_legato/010_unimanager_epl.robot [new file with mode: 0644]
csit/suites/unimgr/uni_legato/020_unimanager_eplan.robot [new file with mode: 0644]
csit/testplans/unimgr-legato.txt [new file with mode: 0644]
csit/variables/unimgr/add_epl.json [new file with mode: 0644]
csit/variables/unimgr/add_eplan.json [new file with mode: 0644]

index 1114b2213a0b407463ac55f2c55593680e15542d..14187b0837be07bf3f6e2d8cb6c782b2ccdf6434 100644 (file)
@@ -98,3 +98,17 @@ Mininet Sync Status
     ${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
diff --git a/csit/suites/unimgr/uni_legato/010_unimanager_epl.robot b/csit/suites/unimgr/uni_legato/010_unimanager_epl.robot
new file mode 100644 (file)
index 0000000..86a4833
--- /dev/null
@@ -0,0 +1,53 @@
+*** 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}
diff --git a/csit/suites/unimgr/uni_legato/020_unimanager_eplan.robot b/csit/suites/unimgr/uni_legato/020_unimanager_eplan.robot
new file mode 100644 (file)
index 0000000..e241f16
--- /dev/null
@@ -0,0 +1,63 @@
+*** 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}
diff --git a/csit/testplans/unimgr-legato.txt b/csit/testplans/unimgr-legato.txt
new file mode 100644 (file)
index 0000000..99b0e60
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/unimgr/uni_legato
diff --git a/csit/variables/unimgr/add_epl.json b/csit/variables/unimgr/add_epl.json
new file mode 100644 (file)
index 0000000..aa7e58f
--- /dev/null
@@ -0,0 +1,26 @@
+{
+"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"
+        }
+      }
+    ]
+  }
+}
diff --git a/csit/variables/unimgr/add_eplan.json b/csit/variables/unimgr/add_eplan.json
new file mode 100644 (file)
index 0000000..ceddf51
--- /dev/null
@@ -0,0 +1,30 @@
+{
+"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"
+        }
+      }
+    ]
+  }
+}