Added Scripts for Openflow Validation in Cassandra DB 61/33461/38
authorpremnath <prem.annauniv@gmail.com>
Mon, 25 Jan 2016 09:29:22 +0000 (14:59 +0530)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 1 Feb 2016 21:35:40 +0000 (21:35 +0000)
Modified TsdrUtils to fix some minor comments

Change-Id: If6d20009c45cea16561b4c8fb7be7b1dff90ce4b
Signed-off-by: premnath <prem.annauniv@gmail.com>
csit/libraries/TsdrUtils.robot
csit/scriptplans/tsdr-cassandra-datastore.txt [new file with mode: 0644]
csit/suites/tsdr/Cassandra/010_InterfaceMetrics.robot [new file with mode: 0644]
csit/suites/tsdr/Cassandra/020_FlowMetrics.robot [new file with mode: 0644]
csit/suites/tsdr/Cassandra/030_FlowTableMetrics.robot [new file with mode: 0644]
csit/suites/tsdr/Cassandra/040_QueueMetrics.robot [new file with mode: 0644]
csit/suites/tsdr/Cassandra/scripts/cassandra-startup.sh [new file with mode: 0755]
csit/suites/tsdr/HBase/010_InterfaceMetrics.robot
csit/testplans/tsdr-cassandra-datastore.txt [new file with mode: 0644]
csit/testplans/tsdr-h2-datastore.txt [deleted file]

index 34c6d00fc4cce9e9c51aa3f32cce83f88a783b5c..80acb36574c45f123608691d89d874df11fed27d 100644 (file)
@@ -11,7 +11,7 @@ Library           json
 Library           HttpLibrary.HTTP
 
 *** Variables ***
-${HBASE_CLIENT}    /tmp/Hbase/hbase-0.94.15/bin
+${HBASE_CLIENT}    /usr/lib/hbase/hbase-0.94.15/bin
 ${CASSANDRA_CLIENT}    /tmp/cassandra/apache-cassandra-2.1.12/bin
 ${final}          ${EMPTY}
 ${prompt_timeout}    ${EMPTY}
@@ -57,23 +57,34 @@ Ping All Hosts
     Read Until    mininet>
 
 Iperf All Hosts
-    [Arguments]    ${pattern}
-    [Documentation]    Iperf between h1 and h2 and check Hbase
+    [Arguments]    ${host1}    ${host2}
+    [Documentation]    Iperf between ${host1} and ${host2}
     Switch Connection    ${mininet_conn_id1}
-    Write    iperf h1 h2
+    Write    iperf ${host1} ${host2}
     Read Until    mininet>
+
+
+Iperf All Hosts Hbase
+    [Arguments]    ${pattern}
+    [Documentation]    Iperf between h1 and h2 and check Hbase
+    Iperf All Hosts    h1    h2
     ${query_output}=    Query the Data from HBaseClient    count 'NETFLOW'
     Should Match Regexp    ${query_output}    ${pattern}
 
 Iperf All Hosts Cassandra
     [Arguments]    ${pattern}
     [Documentation]    Iperf between h1 and h2 and check Cassandra
-    Switch Connection    ${mininet_conn_id1}
-    Write    iperf h1 h2
-    Read Until    mininet>
+    Iperf All Hosts    h1    h2
     ${query_output}=    Count Cassandra rows    select count(*) from tsdr.metriclog;
     Should Match Regexp    ${query_output}    ${pattern}
 
+Iperf All Hosts HSQLDB
+    [Arguments]    ${pattern}
+    [Documentation]    Iperf between h1 and h2 and check Cassandra
+    Iperf All Hosts    h1    h2
+    ${query_output}=   Issue Command On Karaf Console    tsdr:list NETFLOW | wc -l
+    Should Match Regexp    ${query_output}    ${pattern}
+
 Stop Tsdr Suite
     [Documentation]    Cleanup/Shutdown work that should be done at the completion of all
     ...    tests
@@ -170,8 +181,8 @@ Initialize Cassandra Tables
     [Arguments]    ${remote}=${ODL_SYSTEM_IP}    ${user}=${TOOLS_SYSTEM_USER}    ${prompt_timeout}=120s    ${key_table}=metricpath    ${val_table}=metricval
     [Documentation]    Truncate Existing tables in Cassandra to Start it fresh.
     Log    Attempting to truncate tables in Cassandra
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    rm -rf ${CASSANDRA_DB_PATH}${key_table}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    rm -rf ${CASSANDRA_DB_PATH}${val_table}
+    Run Command On Remote System    ${ODL_SYSTEM_IP}    sudo rm -rf ${CASSANDRA_DB_PATH}${key_table}
+    Run Command On Remote System    ${ODL_SYSTEM_IP}    sudo rm -rf ${CASSANDRA_DB_PATH}${val_table}
     ${conn_id}=    Open Connection    ${remote}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=${prompt_timeout}
     Login With Public Key    ${user}    ${USER_HOME}/.ssh/${SSH_KEY}    any
     Write    export JAVA_HOME=/usr
@@ -188,8 +199,8 @@ Initialize Cassandra Tables Metricval
     [Arguments]    ${remote}=${ODL_SYSTEM_IP}    ${user}=${TOOLS_SYSTEM_USER}    ${prompt_timeout}=120s    ${key_table}=metricpath    ${val_table}=metricval
     [Documentation]    Truncate Existing tables in Cassandra to Start it fresh
     Log    Attempting to truncate tables in Cassandra
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    rm -rf ${CASSANDRA_DB_PATH}${key_table}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    rm -rf ${CASSANDRA_DB_PATH}${val_table}
+    Run Command On Remote System    ${ODL_SYSTEM_IP}    sudo rm -rf ${CASSANDRA_DB_PATH}${key_table}
+    Run Command On Remote System    ${ODL_SYSTEM_IP}    sudo rm -rf ${CASSANDRA_DB_PATH}${val_table}
     ${conn_id}=    Open Connection    ${remote}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=${prompt_timeout}
     Login With Public Key    ${user}    ${USER_HOME}/.ssh/${SSH_KEY}    any
     Write    export JAVA_HOME=/usr
@@ -244,9 +255,15 @@ Verify the Metrics Attributes on Cassandra Client
     ${keya_bool}=    Evaluate    ${keya} < 0
     ${keya}=    Run Keyword If    '${keya_bool}' == 'True'    Catenate    SEPARATOR=    \\    ${keya}
     ...    ELSE    Catenate    ${keya}
-    Create Temporary Key Info    ${keya} ${keyb}
-    ${metric_value}=    Verify Metric Val File
-    [Return]    ${metric_value}
+    ${metricval}=    Create Temporary Key Info    ${keya} ${keyb}
+    @{lines}=    Split to lines    ${metricval}
+    ${mv_len}=    Get Length    ${lines}
+    ${mv_len}=    Evaluate    ${mv_len} - 1
+    ${found_line}=    Get From List    ${lines}    ${mv_len}
+    @{split_line}=    Split String    ${found_line}    ${SPACE}
+    ${metric_count}=    Get From List    ${split_line}    3
+    [Return]    ${metric_count}
+
 
 Form Portstats Query Pattern
     [Arguments]    ${metric}    ${node}    ${port}    ${attribute}
@@ -264,10 +281,10 @@ Form Portstats Query Pattern
 
 Create Temporary Key Info
     [Arguments]    ${pattern}    ${remote}=${ODL_SYSTEM_IP}    ${user}=${TOOLS_SYSTEM_USER}    ${prompt_timeout}=120s    ${val_table}=metricval
-    [Documentation]    Creates a temporary File with matching keya,keyb values.
-    Log    Removing existing file
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    rm -rf ${CASSANDRA_DB_PATH}${temp_metric_val}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    cat ${CASSANDRA_DB_PATH}${val_table}|grep "${pattern}" > ${CASSANDRA_DB_PATH}${temp_metric_val}
+    [Documentation]    Return rows matching keya and keyb
+    ${output}=    Run Command On Remote System    ${ODL_SYSTEM_IP}    cat ${CASSANDRA_DB_PATH}${val_table}|grep "${pattern}"
+    [Return]    ${output}
+
 
 Verify Metric Val File
     [Documentation]    Returns Value for metric matching particular keya,keyb
@@ -282,14 +299,21 @@ Verify Metric Val File
 Verify Metric log File
     [Arguments]    ${pattern}
     [Documentation]    Returns Value for lines in Metriclog file matching the pattern
-    ${contents}=    Grep File    ${CASSANDRA_DB_PATH}${temp_metric_val}    ${pattern}
+    ${contents}=    Grep From File    ${CASSANDRA_DB_PATH}${temp_metric_val}    ${pattern}
     [Return]    ${contents}
 
+Grep From File
+
+    [Arguments]    ${file}    ${pattern}
+    [Documentation]    Use cat to grep from the file and return the output
+    ${output}=    Run Command On Remote System    ${ODL_SYSTEM_IP}    cat ${file} | ${pattern}
+    [Return]    ${output}
+
 Find Metricval Keys
     [Arguments]    ${pattern}    ${file}
     [Documentation]    Return list element which has the particular pattern.
-    ${db_grep}=    Grep File    ${CASSANDRA_DB_PATH}${file}    ${pattern}
-    ${metric_grep}=    Grep File    ${TSDR_PATH}/tsdrKeyCache.txt    ${pattern}
+    ${db_grep}=    Grep From File    ${CASSANDRA_DB_PATH}${file}    ${pattern}
+    ${metric_grep}=    Grep From File    ${TSDR_PATH}/tsdrKeyCache.txt    ${pattern}
     @{split_line}=    Split String    ${metric_grep}    |
     ${keypath}=    Get From List    ${split_line}    0
     Should Contain    ${db_grep}    ${keypath}
@@ -302,7 +326,7 @@ Copy TSDR tables
     ${conn_id}=    Open Connection    ${remote}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=${prompt_timeout}
     Login With Public Key    ${user}    ${USER_HOME}/.ssh/${SSH_KEY}    any
     Write    export JAVA_HOME=/usr
-    Write    ${CASSANDRA_CLIENT}/cqlsh
+    Write    sudo ${CASSANDRA_CLIENT}/cqlsh
     Read Until    cqlsh>
     Write    COPY tsdr.${key_table} TO '${CASSANDRA_DB_PATH}${key_table}' WITH DELIMITER = ' ';
     Read Until    cqlsh>
@@ -343,7 +367,7 @@ Count Cassandra rows
 Read File and Return Split Lines
     [Arguments]    ${filename}
     [Documentation]    Reads the file and returns each line as list
-    ${contents}=    OperatingSystem.Get File    ${filename}
+    ${contents}=    Run Command On Remote System    ${ODL_SYSTEM_IP}    cat ${filename}
     @{lines}=    Split to lines    ${contents}
     [Return]    @{lines}
 
@@ -458,7 +482,7 @@ Severity Iterator For TSDR
 Severity Iterator For Syslog HBase
     [Arguments]    ${message}    ${value}    &{syslog_severity}
     [Documentation]    Simulating FOR loop for checking HBASE for each syslog_severity
-    ${output}=    Query the Data from HBaseClient    scan 'SysLog'
+    ${output}=    Query the Data from HBaseClient    scan 'SYSLOG'
     Should Contain X Times    ${output}    ${message}    8
     ${iterator}=    Evaluate    ${value} * 8
     : FOR    ${level}    IN ZIP    &{syslog_severity}
@@ -549,7 +573,6 @@ Extract Row Values from TSDR Query
     ...    ELSE IF    '${DATA_CATEGORY}'=='QUEUESTATS'    Extract QUEUESTATS RecordKeys    ${RK}
     ${epoch_time}=    Convert Date    ${time}    epoch    date_format=%a %b %d %H:%M:%S %Z %Y
     ${epoch_time_int}=    Convert To Integer    ${epoch_time}
-    LOG    [NID=${NID}][DC=${DC}][MN=${MN}][${RK_VAL}][TS=${epoch_time_int}][${MV}]
     Should Match    ${tsdr_row}    *${NID}*
     Should Match    ${tsdr_row}    *${DC}*
     Should Match    ${tsdr_row}    *${MN}*
@@ -625,32 +648,32 @@ Collect Data from SNMP Agent
     \    ${ifMtu}=    Get From Dictionary    ${int}    ifMtu
     \    ${ifOperStatus1}=    Get From Dictionary    ${int}    ifOperStatus
     \    ${ifOperStatus}=    Get From Dictionary    ${OPER_STATUS}    ${ifOperStatus1}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutDiscards*RK=ifIndex:${ifindex},SnmpMetric:IfOutDiscards*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutDiscards*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutDiscards*
     \    Append To List    ${SNMP_VALUES}    ${ifOutDiscards}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInDiscards*RK=ifIndex:${ifindex},SnmpMetric:IfInDiscards*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInDiscards*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInDiscards*
     \    Append To List    ${SNMP_VALUES}    ${ifInDiscards}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInOctets*RK=ifIndex:${ifindex},SnmpMetric:IfInOctets*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInOctets*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInOctets*
     \    Append To List    ${SNMP_VALUES}    ${ifInOctets}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutQLen*RK=ifIndex:${ifindex},SnmpMetric:IfOutQLen*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutQLen*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutQLen*
     \    Append To List    ${SNMP_VALUES}    ${ifOutQLen}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutErrors*RK=ifIndex:${ifindex},SnmpMetric:IfOutErrors*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutErrors*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutErrors*
     \    Append To List    ${SNMP_VALUES}    ${ifOutErrors}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInUcastPkts*RK=ifIndex:${ifindex},SnmpMetric:IfInUcastPkts*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInUcastPkts*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInUcastPkts*
     \    Append To List    ${SNMP_VALUES}    ${ifInUcastPkts}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutNUcastPkts*RK=ifIndex:${ifindex},SnmpMetric:IfOutNUcastPkts*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutNUcastPkts*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutNUcastPkts*
     \    Append To List    ${SNMP_VALUES}    ${ifOutNUcastPkts}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInErrors*RK=ifIndex:${ifindex},SnmpMetric:IfInErrors*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInErrors*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInErrors*
     \    Append To List    ${SNMP_VALUES}    ${ifInErrors}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutOctets*RK=ifIndex:${ifindex},SnmpMetric:IfOutOctets*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutOctets*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutOctets*
     \    Append To List    ${SNMP_VALUES}    ${ifOutOctets}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfAdminStatus*RK=ifIndex:${ifindex},SnmpMetric:IfAdminStatus*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfAdminStatus*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfAdminStatus*
     \    Append To List    ${SNMP_VALUES}    ${ifAdminStatus}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInUnknownProtos*RK=ifIndex:${ifindex},SnmpMetric:IfInUnknownProtos*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInUnknownProtos*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInUnknownProtos*
     \    Append To List    ${SNMP_VALUES}    ${ifInUnknownProtos}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutUcastPkts*RK=ifIndex:${ifindex},SnmpMetric:IfOutUcastPkts*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOutUcastPkts*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutUcastPkts*
     \    Append To List    ${SNMP_VALUES}    ${ifOutUcastPkts}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInNUcastPkts*RK=ifIndex:${ifindex},SnmpMetric:IfInNUcastPkts*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfInNUcastPkts*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInNUcastPkts*
     \    Append To List    ${SNMP_VALUES}    ${ifInNUcastPkts}
-    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOperStatus*RK=ifIndex:${ifindex},SnmpMetric:IfOperStatus*
+    \    Append To List    ${SNMP_ENTRY}    *NID=${SNMP_IP}*DC=SNMPINTERFACES*MN=IfOperStatus*RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOperStatus*
     \    Append To List    ${SNMP_VALUES}    ${ifOperStatus}
     [Return]    ${SNMP_ENTRY}    ${SNMP_VALUES}
diff --git a/csit/scriptplans/tsdr-cassandra-datastore.txt b/csit/scriptplans/tsdr-cassandra-datastore.txt
new file mode 100644 (file)
index 0000000..e72f188
--- /dev/null
@@ -0,0 +1,3 @@
+# Place the scripts in run order:
+integration/test/csit/suites/tsdr/Cassandra/scripts/cassandra-startup.sh
+
diff --git a/csit/suites/tsdr/Cassandra/010_InterfaceMetrics.robot b/csit/suites/tsdr/Cassandra/010_InterfaceMetrics.robot
new file mode 100644 (file)
index 0000000..3ec12d8
--- /dev/null
@@ -0,0 +1,149 @@
+*** Settings ***
+Documentation     Test suite for Cassandra DataStore PortStats Verification
+Suite Teardown    Stop Tsdr Suite
+Library           SSHLibrary
+Library           Collections
+Library           String
+Library           RequestsLibrary
+Library           ../../../libraries/Common.py
+Resource          ../../../libraries/KarafKeywords.robot
+Resource          ../../../libraries/TsdrUtils.robot
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+@{INTERFACE_METRICS}    TransmittedPackets    TransmittedBytes    TransmitErrors    TransmitDrops    ReceivedPackets    ReceivedBytes    ReceiveOverRunError
+...               ReceiveFrameError    ReceiveErrors    ReceiveDrops    ReceiveCrcError    CollisionCount
+${root_path}    flow-capable-node-connector-statistics
+@{xpath}    ${root_path}/packets/transmitted    ${root_path}/bytes/transmitted    ${root_path}/transmit-errors    ${root_path}/transmit-drops    ${root_path}/packets/received    ${root_path}/bytes/received    ${root_path}/receive-over-run-error
+...                ${root_path}/receive-frame-error    ${root_path}/receive-errors    ${root_path}/receive-drops    ${root_path}/receive-crc-error    ${root_path}/collision-count
+@{CATEGORY}       FlowStats    FlowTableStats    PortStats    QueueStats
+${TSDR_PORTSTATS}    tsdr:list PortStats
+${CONFIG_INTERVAL}    /restconf/config/tsdr-openflow-statistics-collector:TSDRDCConfig
+${OPER_INTERVAL}    /restconf/operations/tsdr-openflow-statistics-collector:setPollingInterval
+${metric_path}     metric_path
+${metric_val}     metric_val
+@{xml_list}
+@{tsdr_list}
+
+*** Test Cases ***
+Verification of TSDR Cassandra Feature Installation
+    [Documentation]    Install and Verify the TSDR Cassandra Features
+    COMMENT    Install a Feature    odl-tsdr-cassandra-all    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
+    Wait Until Keyword Succeeds    24x    10 sec    Check Karaf Log Has Messages    tsdr.openflow
+    Verify Feature Is Installed    odl-tsdr-cassandra
+    Verify Feature Is Installed    odl-tsdr-openflow-statistics-collector
+    Start Tsdr Suite
+    Ping All Hosts
+    Wait Until Keyword Succeeds    5x    30 sec    Check Metric path    24\\d+|25\\d+
+    Wait Until Keyword Succeeds    5x    30 sec    Check Metric val     \\d{5}
+
+Storing Statistics from Openflow REST
+
+    [Documentation]    Store openflow PortStats metrics using REST.
+    : FOR    ${item}    IN    @{xpath}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:2    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:LOCAL    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:1    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:2    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:LOCAL    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:3/node-connector/openflow:3:1    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:3/node-connector/openflow:3:2    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    \    ${ret_val}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:3/node-connector/openflow:3:LOCAL    ${item}
+    \    Append To List    ${xml_list}    ${ret_val}
+    \    ${ret_val}=    Set Variable    -1
+    Log List    ${xml_list}
+
+
+
+Verification of InterfaceMetrics-Attributes on Cassandra Client
+    [Documentation]    Verify the InterfaceMetrics has been updated on Cassandra Data Store
+    Copy TSDR tables
+    : FOR    ${list}    IN    @{INTERFACE_METRICS}
+    \    ${ret_val1}=    Extract From DB Table     grep NID=openflow:1 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:1,NodeConnector:openflow:1:1
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+    \    ${ret_val1}=    Extract From DB Table    grep NID=openflow:1 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:1,NodeConnector:openflow:1:2
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+    \    ${ret_val1}=    Extract From DB Table    grep NID=openflow:1 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:1,NodeConnector:openflow:1:LOCAL
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+    \    ${ret_val1}=    Extract From DB Table    grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:1
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+    \    ${ret_val1}=    Extract From DB Table    grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:2
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+    \    ${ret_val1}=    Extract From DB Table    grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:3
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+    \    ${ret_val1}=    Extract From DB Table    grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:LOCAL
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+    \    ${ret_val1}=    Extract From DB Table    grep NID=openflow:3 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:3,NodeConnector:openflow:3:1
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+    \    ${ret_val1}=    Extract From DB Table    grep NID=openflow:3 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:3,NodeConnector:openflow:3:2
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+    \    ${ret_val1}=    Extract From DB Table    grep NID=openflow:3 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:3,NodeConnector:openflow:3:LOCAL
+    \    Append To List    ${tsdr_list}    ${ret_val1}
+
+Comparing Mertics
+
+    [Documentation]    Compare openflow Interface metrics between data collected from openflow Plugin and TSDR
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${xml_list}    ${tsdr_list}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}
+
+
+
+Verify Configuration Interval-change
+    [Documentation]    Verify the TSDR Collection configuration changes
+    ${session}=    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+    Verify TSDR Configuration Interval    180
+    Post TSDR Configuration Interval    200
+    Verify TSDR Configuration Interval    200
+    Post TSDR Configuration Interval    180
+    Verify TSDR Configuration Interval    180
+    Delete All Sessions
+
+*** Keywords ***
+
+Verify TSDR Configuration Interval
+    [Arguments]    ${interval}
+    [Documentation]    Verify Configuration interval of TSDR Collection
+    ${resp}    RequestsLibrary.Get    session    ${CONFIG_INTERVAL}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    ${interval}
+
+Post TSDR Configuration Interval
+    [Arguments]    ${interval}
+    [Documentation]    Configuration TSDR collection interval ${interval}
+    ${p1}    Create Dictionary    interval    ${interval}
+    ${p2}    Create Dictionary    input    ${p1}
+    ${post_data}    Create Dictionary    setPollingInterval    ${p2}
+    Log    ${post_data}
+    ${resp}    RequestsLibrary.Post    session    ${OPER_INTERVAL}    ${post_data}
+    Should Be Equal As Strings    ${resp.status_code}    201
+
+Extract From DB Table
+    [Arguments]    ${pattern}
+    [Documentation]    Extract from metricpath table and return the value
+    ${ret_val1}=    Set Variable    -100
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    ${pattern}
+    [Return]    ${ret_val1}
+
+
+
diff --git a/csit/suites/tsdr/Cassandra/020_FlowMetrics.robot b/csit/suites/tsdr/Cassandra/020_FlowMetrics.robot
new file mode 100644 (file)
index 0000000..b611bac
--- /dev/null
@@ -0,0 +1,137 @@
+*** Settings ***
+Documentation     Test suite for Cassandra DataStore Flow Stats Verification
+Suite Setup       Initialize the Tsdr Suite
+Suite Teardown    Stop Tsdr Suite
+Library           SSHLibrary
+Library           Collections
+Library           String
+Library           ../../../libraries/Common.py
+Resource          ../../../libraries/KarafKeywords.robot
+Resource          ../../../libraries/TsdrUtils.robot
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+
+@{FLOW_METRICS}    PacketCount    ByteCount
+${TSDR_FLOWSTATS}    tsdr:list FlowStats
+${packet_count}    flow/flow-statistics/packet-count
+${byte_count}    flow/flow-statistics/byte-count
+@{tsdr_op1}
+@{tsdr_op2}
+@{tsdr_op3}
+@{tsdr_op1_pc}
+@{tsdr_op2_pc}
+@{tsdr_op3_pc}
+@{tsdr_op1_bc}
+@{tsdr_op2_bc}
+@{tsdr_op3_bc}
+
+
+*** Test Cases ***
+
+Verification of TSDR Cassandra Feature Installation
+    [Documentation]    Install and Verify the TSDR Cassandra Features
+    Verify Feature Is Installed    odl-tsdr-cassandra
+    Verify Feature Is Installed    odl-tsdr-openflow-statistics-collector
+    Start Tsdr Suite
+    Ping All Hosts
+    Wait Until Keyword Succeeds    5x    30 sec    Check Metric path    24\\d+|25\\d+
+    Wait Until Keyword Succeeds    5x    30 sec    Check Metric val     \\d{5}
+
+
+Getting all Tables from Openflow Plugin
+    [Documentation]    Getting Flowstats from openflow plugin
+
+    @{openflow_1}=    Return all XML matches    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/    flow/id
+    @{openflow_2}=    Return all XML matches    ${OPERATIONAL_NODES_API}/node/openflow:2/table/0/    flow/id
+    @{openflow_3}=    Return all XML matches    ${OPERATIONAL_NODES_API}/node/openflow:3/table/0/    flow/id
+
+    Set Suite Variable           @{openflow_1}
+    Set Suite Variable    @{openflow_2}
+    Set Suite Variable    @{openflow_3}
+
+    @{openflow_1_packetcount}=    Return all XML matches    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/    ${packet_count}
+    @{openflow_2_packetcount}=    Return all XML matches    ${OPERATIONAL_NODES_API}/node/openflow:2/table/0/    ${packet_count}
+    @{openflow_3_packetcount}=    Return all XML matches    ${OPERATIONAL_NODES_API}/node/openflow:3/table/0/    ${packet_count}
+
+    Set Suite Variable    @{openflow_1_packetcount}
+    Set Suite Variable    @{openflow_2_packetcount}
+    Set Suite Variable    @{openflow_3_packetcount}
+
+
+    @{openflow_1_bytecount}=    Return all XML matches    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/    ${byte_count}
+    @{openflow_2_bytecount}=    Return all XML matches    ${OPERATIONAL_NODES_API}/node/openflow:2/table/0/    ${byte_count}
+    @{openflow_3_bytecount}=    Return all XML matches    ${OPERATIONAL_NODES_API}/node/openflow:3/table/0/    ${byte_count}
+
+    Set Suite Variable    @{openflow_1_bytecount}
+    Set Suite Variable    @{openflow_2_bytecount}
+    Set Suite Variable    @{openflow_3_bytecount}
+
+Verification of FlowStats-Attributes on Cassandra Data Store
+    [Documentation]    Verify the InterfaceMetrics has been updated on Cassandra Data Store
+    Copy TSDR tables
+    : FOR    ${flow}    IN    @{openflow_1}
+    \   ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:1 | grep DC=FLOWSTATS | grep MN=PacketCount | grep -F 'RK=Node:openflow:1,Table:0,Flow:${flow}'
+    \   Append To List    ${tsdr_op1_pc}    ${ret_val1}
+
+    : FOR    ${flow}    IN    @{openflow_2}
+    \   ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=FLOWSTATS | grep MN=PacketCount | grep -F 'RK=Node:openflow:2,Table:0,Flow:${flow}'
+    \   Append To List    ${tsdr_op2_pc}    ${ret_val1}
+
+    : FOR    ${flow}    IN    @{openflow_3}
+    \   ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:3 | grep DC=FLOWSTATS | grep MN=PacketCount | grep -F 'RK=Node:openflow:3,Table:0,Flow:${flow}'
+    \   Append To List    ${tsdr_op3_pc}    ${ret_val1}
+
+    : FOR    ${flow}    IN    @{openflow_1}
+    \   ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:1 | grep DC=FLOWSTATS | grep MN=ByteCount | grep -F 'RK=Node:openflow:1,Table:0,Flow:${flow}'
+    \   Append To List    ${tsdr_op1_bc}    ${ret_val1}
+
+    : FOR    ${flow}    IN    @{openflow_2}
+    \   ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=FLOWSTATS | grep MN=ByteCount | grep -F 'RK=Node:openflow:2,Table:0,Flow:${flow}'
+    \   Append To List    ${tsdr_op2_bc}    ${ret_val1}
+
+    : FOR    ${flow}    IN    @{openflow_3}
+    \   ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:3 | grep DC=FLOWSTATS | grep MN=ByteCount | grep -F 'RK=Node:openflow:3,Table:0,Flow:${flow}'
+    \   Append To List    ${tsdr_op3_bc}    ${ret_val1}
+
+    Set Suite Variable    @{tsdr_op1_pc}
+    Set Suite Variable    @{tsdr_op2_pc}
+    Set Suite Variable    @{tsdr_op3_pc}
+    Set Suite Variable    @{tsdr_op1_bc}
+    Set Suite Variable    @{tsdr_op2_bc}
+    Set Suite Variable    @{tsdr_op3_bc}
+
+
+Comparing Packet Count Metrics
+    [Documentation]    Comparing Packet count values between Cassandra and openflow plugin
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_1_packetcount}    ${tsdr_op1_pc}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_2_packetcount}    ${tsdr_op2_pc}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_3_packetcount}    ${tsdr_op3_pc}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+
+
+Comparing Byte Count Metrics
+    [Documentation]    Comparing byte count values between Cassandra and openflow plugin
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_1_bytecount}    ${tsdr_op1_bc}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_2_bytecount}    ${tsdr_op2_bc}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_3_bytecount}    ${tsdr_op3_bc}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+
+
+
+*** Keywords ***
+Initialize the Tsdr Suite
+    Initialize Cassandra Tables Metricval
+
diff --git a/csit/suites/tsdr/Cassandra/030_FlowTableMetrics.robot b/csit/suites/tsdr/Cassandra/030_FlowTableMetrics.robot
new file mode 100644 (file)
index 0000000..7ae2492
--- /dev/null
@@ -0,0 +1,120 @@
+*** Settings ***
+Documentation     Test suite for Cassandra DataStore Flow Table Stats Verification
+Suite Setup       Initialize the Tsdr Suite
+Suite Teardown    Stop Tsdr Suite
+Library           SSHLibrary
+Library           Collections
+Library           String
+Library           ../../../libraries/Common.py
+Resource          ../../../libraries/KarafKeywords.robot
+Resource          ../../../libraries/TsdrUtils.robot
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+${TSDR_FLOWTABLE_STATS}    tsdr:list FlowTableStats
+@{tsdr_pl}
+@{tsdr_af}
+@{tsdr_pm}
+${packetlookup}    flow-table-statistics/packets-looked-up
+${activeflows}    flow-table-statistics/active-flows
+${packetmatched}    flow-table-statistics/packets-matched
+@{openflow_packetlookup}
+@{openflow_activeflows}
+@{openflow_packetmatched}
+
+*** Test Cases ***
+
+Verification of TSDR Cassandra Feature Installation
+    [Documentation]    Install and Verify the TSDR Cassandra Features
+    COMMENT    Install a Feature    odl-tsdr-cassandra-all    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
+    Verify Feature Is Installed    odl-tsdr-cassandra
+    COMMENT    Verify Feature Is Installed    odl-tsdr-cassandra-persistence
+    Verify Feature Is Installed    odl-tsdr-openflow-statistics-collector
+    Start Tsdr Suite
+    Ping All Hosts
+    Wait Until Keyword Succeeds    5x    30 sec    Check Metric path    24\\d+|25\\d+
+    Wait Until Keyword Succeeds    5x    30 sec    Check Metric val     \\d{5}
+
+
+Getting all Tables from Openflow Plugin
+    [Documentation]    Getting Flow Table Stats Values from Openflow plugin
+    ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/    ${packetlookup}
+    Append To List    ${openflow_packetlookup}    ${ret}
+    ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/table/0/    ${packetlookup}
+    Append To List    ${openflow_packetlookup}    ${ret}
+    ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:3/table/0/    ${packetlookup}
+    Append To List    ${openflow_packetlookup}    ${ret}
+
+    Set Suite Variable    @{openflow_packetlookup}
+
+
+    ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/    ${activeflows}
+    Append To List    ${openflow_activeflows}    ${ret}
+    ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/table/0/    ${activeflows}
+    Append To List    ${openflow_activeflows}    ${ret}
+    ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:3/table/0/    ${activeflows}
+    Append To List    ${openflow_activeflows}    ${ret}
+
+    Set Suite Variable    @{openflow_activeflows}
+
+    ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/    ${packetmatched}
+    Append To List    ${openflow_packetmatched}    ${ret}
+    ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/table/0/    ${packetmatched}
+    Append To List    ${openflow_packetmatched}    ${ret}
+    ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:3/table/0/    ${packetmatched}
+    Append To List    ${openflow_packetmatched}    ${ret}
+
+    Set Suite Variable    @{openflow_packetmatched}
+
+
+
+
+Verification of FlowStats-Attributes on Cassandra Data Store
+    [Documentation]    Verify the InterfaceMetrics has been updated on Cassandra Data Store
+    Copy TSDR tables
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client     grep NID=openflow:1 | grep DC=FLOWTABLESTATS | grep MN=PacketLookup | grep RK=Node:openflow:1,Table:0
+    Append To List    ${tsdr_pl}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client     grep NID=openflow:2 | grep DC=FLOWTABLESTATS | grep MN=PacketLookup | grep RK=Node:openflow:2,Table:0
+    Append To List    ${tsdr_pl}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client     grep NID=openflow:3 | grep DC=FLOWTABLESTATS | grep MN=PacketLookup | grep RK=Node:openflow:3,Table:0
+    Append To List    ${tsdr_pl}    ${ret_val1}
+
+
+
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client     grep NID=openflow:1 | grep DC=FLOWTABLESTATS | grep MN=ActiveFlows | grep RK=Node:openflow:1,Table:0
+    Append To List    ${tsdr_af}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client     grep NID=openflow:2 | grep DC=FLOWTABLESTATS | grep MN=ActiveFlows | grep RK=Node:openflow:2,Table:0
+    Append To List    ${tsdr_af}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client     grep NID=openflow:3 | grep DC=FLOWTABLESTATS | grep MN=ActiveFlows | grep RK=Node:openflow:3,Table:0
+    Append To List    ${tsdr_af}    ${ret_val1}
+
+
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client     grep NID=openflow:1 | grep DC=FLOWTABLESTATS | grep MN=PacketMatch | grep RK=Node:openflow:1,Table:0
+    Append To List    ${tsdr_pm}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client     grep NID=openflow:2 | grep DC=FLOWTABLESTATS | grep MN=PacketMatch | grep RK=Node:openflow:2,Table:0
+    Append To List    ${tsdr_pm}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client     grep NID=openflow:3 | grep DC=FLOWTABLESTATS | grep MN=PacketMatch | grep RK=Node:openflow:3,Table:0
+    Append To List    ${tsdr_pm}    ${ret_val1}
+
+
+
+
+Comparing Flow Table Metrics
+    [Documentation]    Comparing Flow table values between Cassandra and openflow plugin.
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_packetlookup}    ${tsdr_pl}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    5
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_activeflows}    ${tsdr_af}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    5
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_packetmatched}    ${tsdr_pm}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    5
+
+
+
+*** Keywords ***
+Initialize the Tsdr Suite
+    COMMENT    Initialize the Cassandra for TSDR
+    Initialize Cassandra Tables Metricval
+
diff --git a/csit/suites/tsdr/Cassandra/040_QueueMetrics.robot b/csit/suites/tsdr/Cassandra/040_QueueMetrics.robot
new file mode 100644 (file)
index 0000000..691bf2f
--- /dev/null
@@ -0,0 +1,120 @@
+*** Settings ***
+Documentation     Test suite for Cassandra DataStore Queue Stats Verification
+Suite Setup           Initialize Cassandra Tables Metricval
+Suite Teardown    Stop Tsdr Suite
+Library           SSHLibrary
+Library           Collections
+Library           String
+Library           ../../../libraries/Common.py
+Resource          ../../../libraries/KarafKeywords.robot
+Resource          ../../../libraries/TsdrUtils.robot
+Variables         ../../../variables/Variables.py
+
+*** Variables ***
+@{QUEUE_METRICS}    TransmittedPackets    TransmittedBytes    TransmissionErrors
+${TSDR_QUEUESTATS}    tsdr:list QueueStats
+${QUERY_HEAD}    ${OPERATIONAL_NODES_API}/node
+${query_head1}    ${QUERY_HEAD}/openflow:2/node-connector/openflow:2:2/queue/
+@{tsdr_q0}
+@{tsdr_q2}
+@{tsdr_q1}
+${transmittedpackets}    flow-capable-node-connector-queue-statistics/transmitted-packets
+${transmittedbytes}    flow-capable-node-connector-queue-statistics/transmitted-bytes
+${transmittederrors}    flow-capable-node-connector-queue-statistics/transmission-errors
+@{openflow_q0}
+@{openflow_q2}
+@{openflow_q1}
+
+*** Test Cases ***
+
+Verification of TSDR Cassandra Feature Installation
+    [Documentation]    Install and Verify the TSDR Cassandra Features
+    COMMENT    Install a Feature    odl-tsdr-cassandra-all    ${CONTROLLER}    ${KARAF_SHELL_PORT}    60
+    Verify Feature Is Installed    odl-tsdr-cassandra
+    COMMENT    Verify Feature Is Installed    odl-tsdr-cassandra-persistence
+    Verify Feature Is Installed    odl-tsdr-openflow-statistics-collector
+    Start Tsdr Suite
+    Configuration of Queue on Switch
+    Ping All Hosts
+    Wait Until Keyword Succeeds    5x    30 sec    Check Metric path    24\\d+|25\\d+|26\\d+|27\\d+
+    Wait Until Keyword Succeeds    5x    30 sec    Check Metric val     \\d{5}
+
+Getting all Tables from Openflow Plugin
+    [Documentation]    Getting Queue Stats from openflow plugin
+    ${ret}=    Get Stats XML    ${query_head1}0/   ${transmittederrors}
+    Append To List    ${openflow_q0}    ${ret}
+    ${ret}=    Get Stats XML    ${query_head1}0/    ${transmittedpackets}
+    Append To List    ${openflow_q0}    ${ret}
+    ${ret}=    Get Stats XML    ${query_head1}0/    ${transmittedbytes}
+    Append To List    ${openflow_q0}    ${ret}
+
+    Set Suite Variable    @{openflow_q0}
+
+
+    ${ret}=    Get Stats XML    ${query_head1}1/   ${transmittederrors}
+    Append To List    ${openflow_q1}    ${ret}
+    ${ret}=    Get Stats XML    ${query_head1}1/    ${transmittedpackets}
+    Append To List    ${openflow_q1}    ${ret}
+    ${ret}=    Get Stats XML    ${query_head1}1/    ${transmittedbytes}
+    Append To List    ${openflow_q1}    ${ret}
+
+    Set Suite Variable    @{openflow_q1}
+
+
+    ${ret}=    Get Stats XML    ${query_head1}2/   ${transmittederrors}
+    Append To List    ${openflow_q2}    ${ret}
+    ${ret}=    Get Stats XML    ${query_head1}2/    ${transmittedpackets}
+    Append To List    ${openflow_q2}    ${ret}
+    ${ret}=    Get Stats XML    ${query_head1}2/    ${transmittedbytes}
+    Append To List    ${openflow_q2}    ${ret}
+
+    Set Suite Variable    @{openflow_q2}
+
+
+Verification of FlowStats-Attributes on Cassandra Data Store
+    [Documentation]    Verify the InterfaceMetrics has been updated on Cassandra Data Store
+    Copy TSDR tables
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmissionErrors | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:0
+    Append To List    ${tsdr_q0}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedPackets | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:0
+    Append To List    ${tsdr_q0}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedBytes | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:0
+    Append To List    ${tsdr_q0}    ${ret_val1}
+
+
+
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmissionErrors | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:1
+    Append To List    ${tsdr_q1}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedPackets | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:1
+    Append To List    ${tsdr_q1}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedBytes | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:1
+
+
+
+
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmissionErrors | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:2
+    Append To List    ${tsdr_q2}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedPackets | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:2
+    Append To List    ${tsdr_q2}    ${ret_val1}
+    ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedBytes | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:2
+    Append To List    ${tsdr_q2}    ${ret_val1}
+
+
+Comparing Queue Metrics
+    [Documentation]    Comparing Queue metrics between Cassandra and OF plugin
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_q0}    ${tsdr_q0}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_q1}    ${tsdr_q1}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+    : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_q2}    ${tsdr_q2}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+
+
+*** Keyword ***
+Configuration of Queue on Switch
+    [Documentation]    Queue configuration on openvswitch
+    Configure the Queue on Switch    s2-eth2
diff --git a/csit/suites/tsdr/Cassandra/scripts/cassandra-startup.sh b/csit/suites/tsdr/Cassandra/scripts/cassandra-startup.sh
new file mode 100755 (executable)
index 0000000..b2a559c
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Installation of Cassandra
+cat > ${WORKSPACE}/cassandrastartup.sh <<EOF
+cd /tmp/cassandra
+echo "Start the Cassandra Server"
+export JAVA_HOME=/usr
+sudo /tmp/cassandra/apache-cassandra-2.1.12/bin/cassandra
+ls -l /tmp/cassandra/apache-cassandra-2.1.12/bin/cassandra
+
+EOF
+echo "Copy the Cassanra startup script to ${ODL_SYSTEM_IP}"
+scp ${WORKSPACE}/cassandrastartup.sh ${ODL_SYSTEM_IP}:/tmp
+ssh ${ODL_SYSTEM_IP} 'bash /tmp/cassandrastartup.sh'
+ssh ${ODL_SYSTEM_IP} 'ps -ef | grep cassandra'
+# vim: ts=4 sw=4 sts=4 et ft=sh :
index 7a376d4d30d6bf5b8f1b3967078bb9668273c23b..6867db1adaad2f7ee36570e1b886949445c4d682 100755 (executable)
@@ -65,7 +65,6 @@ Verify TSDR Configuration Interval
     [Arguments]    ${interval}
     [Documentation]    Verify Configuration interval of TSDR Collection
     ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_INTERVAL}
-    LOG    ${resp.content}    WARN
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    ${interval}
 
diff --git a/csit/testplans/tsdr-cassandra-datastore.txt b/csit/testplans/tsdr-cassandra-datastore.txt
new file mode 100644 (file)
index 0000000..981fc79
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/tsdr/Cassandra
diff --git a/csit/testplans/tsdr-h2-datastore.txt b/csit/testplans/tsdr-h2-datastore.txt
deleted file mode 100644 (file)
index 19e3169..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Place the suites in run order:
-integration/test/csit/suites/tsdr/H2