Test Cases for PacketCable PCMM Service
authorMohamed El-Serngawy <melserngawy@inocybe.com>
Thu, 18 Jun 2015 21:56:25 +0000 (17:56 -0400)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 19 Jun 2015 03:19:59 +0000 (03:19 +0000)
Change-Id: I42da2b83d884988d1d2af62053b22b978744ded1
Signed-off-by: Mohamed El-Serngawy <melserngawy@inocybe.com>
test/csit/suites/packetcable/PCMM/010__pcmm_rest_call.robot [new file with mode: 0644]
test/csit/testplans/packetcable-pcmm.txt [new file with mode: 0644]
test/csit/variables/packetcable/add_ccap.json [new file with mode: 0644]
test/csit/variables/packetcable/add_multi_ccaps.json [new file with mode: 0644]

diff --git a/test/csit/suites/packetcable/PCMM/010__pcmm_rest_call.robot b/test/csit/suites/packetcable/PCMM/010__pcmm_rest_call.robot
new file mode 100644 (file)
index 0000000..58b3eeb
--- /dev/null
@@ -0,0 +1,64 @@
+*** Settings ***
+Documentation     Checking Network created in OVSDB are pushed to OpenDaylight
+Suite Setup       Create Session    ODLSession    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown    Delete All Sessions
+Library           OperatingSystem
+Library           String
+Library           RequestsLibrary
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${ODLREST_CAPP}    /restconf/config/packetcable:ccap
+${PACKETCABLE_CONFIG_DIR}    ${CURDIR}/../../../variables/packetcable
+${CCAP_ID1}       93b7d8de-15fb-11e5-b60b-1697f925ec7b
+${CCAP_ID2}       dc13b3fc-15fe-11e5-b60b-1697f925ec7b
+${CCAP_IP1}       192.168.1.101
+${CCAP_IP2}       192.168.1.102
+
+*** Test Cases ***
+Add CCAP
+    [Documentation]    Add Single CCAP
+    [Tags]    PacketCable PCMM Reset Call
+    ${Data}    OperatingSystem.Get File    ${PACKETCABLE_CONFIG_DIR}/add_ccap.json
+    ${Data}    Replace String    ${Data}    {ccapId-1}    ${CCAP_ID1}
+    ${Data}    Replace String    ${Data}    {ccapIp-1}    ${CCAP_IP1}
+    log    ${Data}
+    ${resp}    RequestsLibrary.Put    ODLSession    ${ODLREST_CAPP}/ccaps/${CCAP_ID1}    data=${Data}    headers=${HEADERS}
+    Should be Equal As Strings    ${resp.status_code}    200
+
+Get CCAP
+    [Documentation]    Get Single CCAP
+    [Tags]    PacketCable PCMM Reset Call
+    ${resp}    RequestsLibrary.Get    ODLSession    ${ODLREST_CAPP}/ccaps/${CCAP_ID1}
+    Should be Equal As Strings    ${resp.status_code}    200
+
+Delete CAPP
+    [Documentation]    Delete Single CCAP
+    [Tags]    PacketCable PCMM Reset Call
+    ${resp}    RequestsLibrary.Delete    ODLSession    ${ODLREST_CAPP}/ccaps/${CCAP_ID1}
+    Should be Equal As Strings    ${resp.status_code}    200
+
+Add Multiple.CCAPs
+    [Documentation]    Add Multiple CCAPs
+    [Tags]    PacketCable PCMM Reset Call
+    ${Data}    OperatingSystem.Get File    ${PACKETCABLE_CONFIG_DIR}/add_multi_ccaps.json
+    ${Data}    Replace String    ${Data}    {ccapId-1}    ${CCAP_ID1}
+    ${Data}    Replace String    ${Data}    {ccapIp-1}    ${CCAP_IP1}
+    ${Data}    Replace String    ${Data}    {ccapId-2}    ${CCAP_ID2}
+    ${Data}    Replace String    ${Data}    {ccapIp-2}    ${CCAP_IP2}
+    log    ${Data}
+    ${resp}    RequestsLibrary.Put    ODLSession    ${ODLREST_CAPP}    data=${Data}    headers=${HEADERS}
+    Should be Equal As Strings    ${resp.status_code}    200
+
+Get ALL.CCAPs
+    [Documentation]    Get ALL CCAPs
+    [Tags]    PacketCable PCMM Reset Call
+    ${resp}    RequestsLibrary.Get    ODLSession    ${ODLREST_CAPP}
+    Should be Equal As Strings    ${resp.status_code}    200
+
+Delete All.CCAPs
+    [Documentation]    Delete ALL CCAPs
+    [Tags]    PacketCable PCMM Reset Call
+    ${resp}    RequestsLibrary.Delete    ODLSession    ${ODLREST_CAPP}
+    Should be Equal As Strings    ${resp.status_code}    200
diff --git a/test/csit/testplans/packetcable-pcmm.txt b/test/csit/testplans/packetcable-pcmm.txt
new file mode 100644 (file)
index 0000000..0b46058
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/packetcable/PCMM
\ No newline at end of file
diff --git a/test/csit/variables/packetcable/add_ccap.json b/test/csit/variables/packetcable/add_ccap.json
new file mode 100644 (file)
index 0000000..af72ddf
--- /dev/null
@@ -0,0 +1,22 @@
+{
+    "ccaps": [{
+        "ccapId": "{ccapId-1}",
+        "amId": {
+            "am-tag": "0xcada",
+            "am-type": "1"
+        },
+        "connection": {
+            "ipAddress": "{ccapIp-1}",
+            "port": "6060"
+        },
+        "subscriber-subnets": [
+            "10.32.110.1/24"
+        ],
+        "downstream-scns": [
+            "extrm_dn"
+        ],
+        "upstream-scns": [
+            "extrm_up"
+        ]
+    }]
+}
\ No newline at end of file
diff --git a/test/csit/variables/packetcable/add_multi_ccaps.json b/test/csit/variables/packetcable/add_multi_ccaps.json
new file mode 100644 (file)
index 0000000..d634232
--- /dev/null
@@ -0,0 +1,48 @@
+{ "ccap": {
+    "ccaps": [
+    {   "ccapId": "{ccapId-1}",
+        "amId": {
+            "am-tag": "0xcada",
+            "am-type": "1"
+        },
+        "connection": {
+            "ipAddress": "{ccapIp-1}",
+            "port": "6060"
+        },
+        "subscriber-subnets": [
+            "44.137.0.0/16",
+            "2001:4978:030d:1000:0:0:0:0/52"
+        ],
+        "downstream-scns": [
+            "ipvideo_dn",
+            "extrm_dn",
+            "SCNC"
+        ],
+        "upstream-scns": [
+            "SCNA",
+            "extrm_up"
+        ]
+    },
+    {   "ccapId": "{ccapId-2}",
+        "amId": {
+            "am-tag": "0xcada",
+            "am-type": "1"
+        },
+        "connection": {
+            "ipAddress": "{ccapIp-2}",
+            "port": "6060"
+        },
+        "subscriber-subnets": [
+            "44.133.0.0/19"
+        ],
+        "downstream-scns": [
+            "ipvideo_dn",
+            "extrm_dn",
+            "SCNC"
+        ],
+        "upstream-scns": [
+            "SCNA",
+            "extrm_up"
+        ]
+    }]
+}}