complete project telemetry system test job 84/79084/14
authorwsx25289 <10200860@zte.com.cn>
Fri, 28 Dec 2018 02:34:27 +0000 (21:34 -0500)
committerJamo Luhrsen <jluhrsen@redhat.com>
Tue, 8 Jan 2019 19:48:15 +0000 (19:48 +0000)
Change-Id: I1ce405ff31dee6a001dc4a83f5345d3df0473b7e
Signed-off-by: Wsx25289 <10200860@zte.com.cn>
22 files changed:
csit/suites/telemetry/basic/010_TelemetryIntergrationTest.robot [new file with mode: 0644]
csit/testplans/telemetry.txt [new file with mode: 0644]
csit/variables/telemetry/response/success_response.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_destination_configuration/configure_destination/location.uri [new file with mode: 0755]
csit/variables/telemetry/telemetry_destination_configuration/configure_destination/post_data.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_destination_configuration/delete_destination/location.uri [new file with mode: 0755]
csit/variables/telemetry/telemetry_destination_configuration/delete_destination/post_data.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_destination_configuration/query_destination/location.uri [new file with mode: 0755]
csit/variables/telemetry/telemetry_destination_configuration/query_destination/post_data.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_destination_configuration/query_destination/response.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_sensor_configuration/configure_sensor/location.uri [new file with mode: 0755]
csit/variables/telemetry/telemetry_sensor_configuration/configure_sensor/post_data.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_sensor_configuration/delete_sensor/location.uri [new file with mode: 0755]
csit/variables/telemetry/telemetry_sensor_configuration/delete_sensor/post_data.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_sensor_configuration/query_sensor/location.uri [new file with mode: 0755]
csit/variables/telemetry/telemetry_sensor_configuration/query_sensor/post_data.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_sensor_configuration/query_sensor/response.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_subscription_configuration/configure_subscription/location.uri [new file with mode: 0755]
csit/variables/telemetry/telemetry_subscription_configuration/configure_subscription/post_data.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_subscription_configuration/query_subscription/location.uri [new file with mode: 0755]
csit/variables/telemetry/telemetry_subscription_configuration/query_subscription/post_data.json [new file with mode: 0755]
csit/variables/telemetry/telemetry_subscription_configuration/query_subscription/response.json [new file with mode: 0755]

diff --git a/csit/suites/telemetry/basic/010_TelemetryIntergrationTest.robot b/csit/suites/telemetry/basic/010_TelemetryIntergrationTest.robot
new file mode 100644 (file)
index 0000000..3359298
--- /dev/null
@@ -0,0 +1,86 @@
+*** Settings ***
+Documentation     Basic tests for TELEMETRY information configuration and verification.
+...               Copyright (c) 2018-2019 Zte, Inc. All rights reserved.
+...               Test suite performs basic TELEMETRY information configuration and verification test cases for sensor, destination, and subscription as follows:
+...               Test Case 1: Configure sensor with add and delete operation
+...               Expected result: The Configure result with corresponding operation verified as expected
+...               Test Case 2: Configure destination with add and delete operation
+...               Expected result: The Configure result with corresponding operation verified as expected
+...               Test Case 3: Configure subscription with add and query operation
+...               Expected result: The Configure result with corresponding operation verified as expected
+...               Test Case 4: Delete all resource
+...               Expected result: The Configure result with corresponding operation verified as expected
+Suite Setup       RequestsLibrary.Create_Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_YANG_JSON}
+Resource          ../../../libraries/TemplatedRequests.robot
+Resource          ../../../variables/Variables.robot
+Library           RequestsLibrary
+
+*** Variables ***
+@{SENSOR_ID_LIST}    sensor1    sensor2
+@{PATH_LIST}      path1    path2
+@{FILTER_LIST}    filter1    filter2
+${TELEMETRY_VAR_FOLDER}    ${CURDIR}/../../../variables/telemetry
+@{DESTINATION_ID_LIST}    destination1    destination2
+@{ADDRESS_LIST}    10.42.89.15    10.96.33.30
+${PORT}           50051
+@{NODE_ID_LIST}    node1    node2
+@{SUBSCRIPTION_ID_LIST}    subscription1    subscription2
+@{PROTOCOL_TYPE_LIST}    STREAM_SSH    STREAM_GRPC    STREAM_JSON_RPC    STREAM_THRIFT_RPC    STREAM_WEBSOCKET_RPC
+@{ENCODING_TYPE_LIST}    ENC_XML    ENC_JSON_IETF    ENC_PROTO3
+${LOCAL_SOURCE_ADDRESS}    127.0.0.1
+@{QOS_MARKING_LIST}    0    1    2    3    4    5
+@{SAMPLE_INTERVAL_LIST}    100    200    300
+@{HEARTBEAT_INTERVAL_LIST}    30    60
+
+*** Test Cases ***
+TC1_Configure Sensor
+    [Documentation]    Configure two sensors with sensor id list ${SENSOR_ID_LIST}, sensor path list ${PATH_LIST}, and sensor exclude filter list ${FILTER_LIST}.
+    ${mapping} =    Create Dictionary    SENSOR1=${SENSOR_ID_LIST[0]}    SENSOR2=${SENSOR_ID_LIST[1]}    PATH1=${PATH_LIST[0]}    PATH2=${PATH_LIST[1]}    FILTER1=${FILTER_LIST[0]}
+    ...    FILTER2=${FILTER_LIST[1]}
+    ${resp} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_sensor_configuration/configure_sensor    ${mapping}    session
+    Verify_Response_As_Json_Templated    ${resp}    ${TELEMETRY_VAR_FOLDER}/response    success_response
+
+TC1_Delete Sensor
+    [Documentation]    Delete the second sensor created in the test case TC1_Configure Sensor.
+    ${mapping} =    Create Dictionary    SENSOR=${SENSOR_ID_LIST[1]}
+    ${resp} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_sensor_configuration/delete_sensor    ${mapping}    session
+    Verify_Response_As_Json_Templated    ${resp}    ${TELEMETRY_VAR_FOLDER}/response    success_response
+
+TC1_Query Sensor
+    [Documentation]    Query the sensor created in the datastore.
+    ${resp} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_sensor_configuration/query_sensor    {}    session    True
+
+TC2_Configure Destination
+    [Documentation]    Configure two destinations with destination id list ${DESTINATION_ID_LIST}, address list ${ADDRESS_LIST} and port ${PORT}.
+    ${mapping} =    Create Dictionary    DESTINATION1=${DESTINATION_ID_LIST[0]}    DESTINATION2=${DESTINATION_ID_LIST[1]}    ADDRESS1=${ADDRESS_LIST[0]}    ADDRESS2=${ADDRESS_LIST[1]}    PORT=${PORT}
+    ${resp} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_destination_configuration/configure_destination    ${mapping}    session
+    Verify_Response_As_Json_Templated    ${resp}    ${TELEMETRY_VAR_FOLDER}/response    success_response
+
+TC2_Delete Destination
+    [Documentation]    Delete the second destination created in the test case TC2_Configure Destination.
+    ${mapping} =    Create Dictionary    DESTINATION=${DESTINATION_ID_LIST[1]}
+    ${resp} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_destination_configuration/delete_destination    ${mapping}    session
+    Verify_Response_As_Json_Templated    ${resp}    ${TELEMETRY_VAR_FOLDER}/response    success_response
+
+TC2_Query Destination
+    [Documentation]    Query the destination created in the datastore.
+    ${resp} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_destination_configuration/query_destination    {}    session    True
+
+TC3_Configure Subscription
+    [Documentation]    Configure one node with two subscriptions with subscription id list ${SUBSCRIPTION_ID_LIST}, a series of parameters, and sensor destination configured in front.
+    ${mapping} =    Create Dictionary    NODE1=${NODE_ID_LIST[0]}    SUBSCRIPTION1=${SUBSCRIPTION_ID_LIST[0]}    PROTOCOLTYPE1=${PROTOCOL_TYPE_LIST[1]}    ENCODINGTYPE1=${ENCODING_TYPE_LIST[2]}    LOCALSOURCEADDRESS=${LOCAL_SOURCE_ADDRESS}
+    ...    QOS1=${QOS_MARKING_LIST[3]}    SENSOR1=${SENSOR_ID_LIST[0]}    SAMPLE1=${SAMPLE_INTERVAL_LIST[0]}    HEARTBEAT1=${HEARTBEAT_INTERVAL_LIST[0]}    DESTINATION1=${DESTINATION_ID_LIST[0]}    SUBSCRIPTION2=${SUBSCRIPTION_ID_LIST[1]}
+    ...    PROTOCOLTYPE2=${PROTOCOL_TYPE_LIST[0]}    ENCODINGTYPE2=${ENCODING_TYPE_LIST[0]}    QOS2=${QOS_MARKING_LIST[5]}    SAMPLE2=${SAMPLE_INTERVAL_LIST[1]}    HEARTBEAT2=${HEARTBEAT_INTERVAL_LIST[1]}
+    ${resp} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_subscription_configuration/configure_subscription    ${mapping}    session
+    Verify_Response_As_Json_Templated    ${resp}    ${TELEMETRY_VAR_FOLDER}/response    success_response
+
+TC3_Query Subscription
+    [Documentation]    Query the subscription created in the datastore.
+    ${resp} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_subscription_configuration/query_subscription    {}    session    True
+
+TC4_Delete Resource
+    [Documentation]    Delete all sensor, destination and subscription.
+    ${mapping1} =    Create Dictionary    DESTINATION=${DESTINATION_ID_LIST[0]}
+    ${resp1} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_destination_configuration/delete_destination    ${mapping1}    session
+    ${mapping2} =    Create Dictionary    SENSOR=${SENSOR_ID_LIST[0]}
+    ${resp2} =    TemplatedRequests.Post_As_Json_Templated    ${TELEMETRY_VAR_FOLDER}/telemetry_sensor_configuration/delete_sensor    ${mapping2}    session
diff --git a/csit/testplans/telemetry.txt b/csit/testplans/telemetry.txt
new file mode 100644 (file)
index 0000000..cf0f34c
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/telemetry/basic
diff --git a/csit/variables/telemetry/response/success_response.json b/csit/variables/telemetry/response/success_response.json
new file mode 100755 (executable)
index 0000000..1d8927a
--- /dev/null
@@ -0,0 +1,7 @@
+{
+  "output": {
+    "configure-result": {
+      "result": "SUCCESS"
+    }
+  }
+}
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_destination_configuration/configure_destination/location.uri b/csit/variables/telemetry/telemetry_destination_configuration/configure_destination/location.uri
new file mode 100755 (executable)
index 0000000..12b63cd
--- /dev/null
@@ -0,0 +1 @@
+restconf/operations/telemetry-configurator-api:add-telemetry-destination
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_destination_configuration/configure_destination/post_data.json b/csit/variables/telemetry/telemetry_destination_configuration/configure_destination/post_data.json
new file mode 100755 (executable)
index 0000000..bc21c6a
--- /dev/null
@@ -0,0 +1,19 @@
+{
+    input:
+    {
+           telemetry-destination-group:[{
+                                              destination-group-id:$DESTINATION1,
+                                              destination-profile:[{
+                                                                       destination-address:$ADDRESS1,
+                                                                       destination-port:$PORT
+                                                                  }]
+                                        },
+                                        {
+                                              destination-group-id:$DESTINATION2,
+                                              destination-profile:[{
+                                                                       destination-address:$ADDRESS2,
+                                                                       destination-port:$PORT
+                                                                  }]
+                                        }]
+       }
+}
diff --git a/csit/variables/telemetry/telemetry_destination_configuration/delete_destination/location.uri b/csit/variables/telemetry/telemetry_destination_configuration/delete_destination/location.uri
new file mode 100755 (executable)
index 0000000..fc7bec2
--- /dev/null
@@ -0,0 +1 @@
+restconf/operations/telemetry-configurator-api:delete-telemetry-destination
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_destination_configuration/delete_destination/post_data.json b/csit/variables/telemetry/telemetry_destination_configuration/delete_destination/post_data.json
new file mode 100755 (executable)
index 0000000..bc79fef
--- /dev/null
@@ -0,0 +1,8 @@
+{
+    input:
+    {
+             telemetry-destination-group:[{
+                                        destination-group-id:$DESTINATION
+                                     }]
+         }
+}
diff --git a/csit/variables/telemetry/telemetry_destination_configuration/query_destination/location.uri b/csit/variables/telemetry/telemetry_destination_configuration/query_destination/location.uri
new file mode 100755 (executable)
index 0000000..af731d6
--- /dev/null
@@ -0,0 +1 @@
+/restconf/operations/telemetry-configurator-api:query-telemetry-destination
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_destination_configuration/query_destination/post_data.json b/csit/variables/telemetry/telemetry_destination_configuration/query_destination/post_data.json
new file mode 100755 (executable)
index 0000000..778ad0c
--- /dev/null
@@ -0,0 +1,6 @@
+{
+    input:
+    {
+
+         }
+}
diff --git a/csit/variables/telemetry/telemetry_destination_configuration/query_destination/response.json b/csit/variables/telemetry/telemetry_destination_configuration/query_destination/response.json
new file mode 100755 (executable)
index 0000000..af94a9d
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "output": {
+    "telemetry-destination-group":[{
+                                     "destination-group-id":"destination1",
+                                     "destination-profile":[{
+                                            "destination-address":"10.42.89.15",
+                                            "destination-port":50051
+                                     }]
+                              }]
+  }
+}
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_sensor_configuration/configure_sensor/location.uri b/csit/variables/telemetry/telemetry_sensor_configuration/configure_sensor/location.uri
new file mode 100755 (executable)
index 0000000..508d334
--- /dev/null
@@ -0,0 +1 @@
+restconf/operations/telemetry-configurator-api:add-telemetry-sensor
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_sensor_configuration/configure_sensor/post_data.json b/csit/variables/telemetry/telemetry_sensor_configuration/configure_sensor/post_data.json
new file mode 100755 (executable)
index 0000000..78c6c27
--- /dev/null
@@ -0,0 +1,25 @@
+{
+    input:
+    {
+                telemetry-sensor-group:[{
+                                     telemetry-sensor-group-id:$SENSOR1,
+                                     telemetry-sensor-paths:[{
+                                            telemetry-sensor-path:$PATH1,
+                                            sensor-exclude-filter:$FILTER1
+                                     },
+                                     {      telemetry-sensor-path:$PATH2,
+                                            sensor-exclude-filter:$FILTER2
+                                     }]
+                              },
+                              {      telemetry-sensor-group-id:$SENSOR2,
+                                     telemetry-sensor-paths:[{
+                                            telemetry-sensor-path:$PATH1,
+                                            sensor-exclude-filter:$FILTER1
+                                     },
+                                     {      telemetry-sensor-path:$PATH2,
+                                            sensor-exclude-filter:$FILTER2
+                                     }]
+
+                             }]
+       }
+}
diff --git a/csit/variables/telemetry/telemetry_sensor_configuration/delete_sensor/location.uri b/csit/variables/telemetry/telemetry_sensor_configuration/delete_sensor/location.uri
new file mode 100755 (executable)
index 0000000..f2888e3
--- /dev/null
@@ -0,0 +1 @@
+restconf/operations/telemetry-configurator-api:delete-telemetry-sensor
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_sensor_configuration/delete_sensor/post_data.json b/csit/variables/telemetry/telemetry_sensor_configuration/delete_sensor/post_data.json
new file mode 100755 (executable)
index 0000000..5970473
--- /dev/null
@@ -0,0 +1,8 @@
+{
+    input:
+    {
+              telemetry-sensor-group:[{
+                                   sensor-group-id:$SENSOR
+                                }]
+         }
+}
diff --git a/csit/variables/telemetry/telemetry_sensor_configuration/query_sensor/location.uri b/csit/variables/telemetry/telemetry_sensor_configuration/query_sensor/location.uri
new file mode 100755 (executable)
index 0000000..a2e68bd
--- /dev/null
@@ -0,0 +1 @@
+/restconf/operations/telemetry-configurator-api:query-telemetry-sensor
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_sensor_configuration/query_sensor/post_data.json b/csit/variables/telemetry/telemetry_sensor_configuration/query_sensor/post_data.json
new file mode 100755 (executable)
index 0000000..bbe8256
--- /dev/null
@@ -0,0 +1,6 @@
+{
+    input:
+    {
+
+        }
+}
diff --git a/csit/variables/telemetry/telemetry_sensor_configuration/query_sensor/response.json b/csit/variables/telemetry/telemetry_sensor_configuration/query_sensor/response.json
new file mode 100755 (executable)
index 0000000..72159c2
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "output": {
+    "telemetry-sensor-group":[{
+                                     "telemetry-sensor-group-id":"sensor1",
+                                     "telemetry-sensor-paths":[{
+                                            "telemetry-sensor-path":"path1",
+                                            "sensor-exclude-filter":"filter1"
+                                     },
+                                     {      "telemetry-sensor-path":"path2",
+                                            "sensor-exclude-filter":"filter2"
+                                     }]
+                              }]
+  }
+}
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_subscription_configuration/configure_subscription/location.uri b/csit/variables/telemetry/telemetry_subscription_configuration/configure_subscription/location.uri
new file mode 100755 (executable)
index 0000000..d0fdca5
--- /dev/null
@@ -0,0 +1 @@
+restconf/operations/telemetry-configurator-api:configure-node-telemetry-subscription
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_subscription_configuration/configure_subscription/post_data.json b/csit/variables/telemetry/telemetry_subscription_configuration/configure_subscription/post_data.json
new file mode 100755 (executable)
index 0000000..497882a
--- /dev/null
@@ -0,0 +1,40 @@
+{
+    input:
+    {
+                telemetry-node:[{
+                                node-id:$NODE1,
+                                telemetry-subscription:[{
+                                                            subscription-name:$SUBSCRIPTION1,
+                                                            protocol-type:$PROTOCOLTYPE1,
+                                                            encoding-type:$ENCODINGTYPE1,
+                                                            local-source-address:$LOCALSOURCEADDRESS,
+                                                            originated-qos-marking:$QOS1,
+                                                            telemetry-sensor:[{
+                                                                                  sensor-group-id:$SENSOR1,
+                                                                                  sample-interval:$SAMPLE1,
+                                                                                  heartbeat-interval:$HEARTBEAT1,
+                                                                                  suppress-redundant:false
+                                                                             }],
+                                                            telemetry-destination:[{
+                                                                                      destination-group-id:$DESTINATION1
+                                                                                  }]
+                                                       },
+                                                       {
+                                                            subscription-name:$SUBSCRIPTION2,
+                                                            protocol-type:$PROTOCOLTYPE2,
+                                                            encoding-type:$ENCODINGTYPE2,
+                                                            local-source-address:$LOCALSOURCEADDRESS,
+                                                            originated-qos-marking:$QOS2,
+                                                            telemetry-sensor:[{
+                                                                                  sensor-group-id:$SENSOR1,
+                                                                                  sample-interval:$SAMPLE2,
+                                                                                  heartbeat-interval:$HEARTBEAT2,
+                                                                                  suppress-redundant:false
+                                                                             }],
+                                                            telemetry-destination:[{
+                                                                                      destination-group-id:$DESTINATION1
+                                                                                  }]
+                                                                                                           }]
+                           }]
+       }
+}
diff --git a/csit/variables/telemetry/telemetry_subscription_configuration/query_subscription/location.uri b/csit/variables/telemetry/telemetry_subscription_configuration/query_subscription/location.uri
new file mode 100755 (executable)
index 0000000..79f2a33
--- /dev/null
@@ -0,0 +1 @@
+/restconf/operations/telemetry-configurator-api:query-node-telemetry-subscription
\ No newline at end of file
diff --git a/csit/variables/telemetry/telemetry_subscription_configuration/query_subscription/post_data.json b/csit/variables/telemetry/telemetry_subscription_configuration/query_subscription/post_data.json
new file mode 100755 (executable)
index 0000000..bbe8256
--- /dev/null
@@ -0,0 +1,6 @@
+{
+    input:
+    {
+
+        }
+}
diff --git a/csit/variables/telemetry/telemetry_subscription_configuration/query_subscription/response.json b/csit/variables/telemetry/telemetry_subscription_configuration/query_subscription/response.json
new file mode 100755 (executable)
index 0000000..e52ea97
--- /dev/null
@@ -0,0 +1,51 @@
+{
+    "output": {
+        "telemetry-node": [
+            {
+                "node-id": "node1",
+                "telemetry-subscription": [
+                    {
+                        "subscription-name": "subscription1",
+                        "protocol-type": "STREAM_GRPC",
+                        "originated-qos-marking": 3,
+                        "telemetry-destination": [
+                            {
+                                "destination-group-id": "destination1"
+                            }
+                        ],
+                        "telemetry-sensor": [
+                            {
+                                "sensor-group-id": "sensor1",
+                                "sample-interval": 100,
+                                "heartbeat-interval": 30,
+                                "suppress-redundant": false
+                            }
+                        ],
+                        "local-source-address": "127.0.0.1",
+                        "encoding-type": "ENC_PROTO3"
+                    },
+                    {
+                        "subscription-name": "subscription2",
+                        "protocol-type": "STREAM_SSH",
+                        "originated-qos-marking": 5,
+                        "telemetry-destination": [
+                            {
+                                "destination-group-id": "destination1"
+                            }
+                        ],
+                        "telemetry-sensor": [
+                            {
+                                "sensor-group-id": "sensor1",
+                                "sample-interval": 200,
+                                "heartbeat-interval": 60,
+                                "suppress-redundant": false
+                            }
+                        ],
+                        "local-source-address": "127.0.0.1",
+                        "encoding-type": "ENC_XML"
+                    }
+                ]
+            }
+        ]
+    }
+}
\ No newline at end of file