Fixing a variable for HBase scripts to run . 16/34116/4
authorpremnath <prem.annauniv@gmail.com>
Fri, 5 Feb 2016 06:44:18 +0000 (12:14 +0530)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 6 Feb 2016 01:35:33 +0000 (01:35 +0000)
Changed Cassandra procedures to fix failures due to metricpath table removal.

Change-Id: I80275bb4a43b4c5b87fed6a522ef6d2a9ee40158
Signed-off-by: premnath <prem.annauniv@gmail.com>
csit/libraries/TsdrUtils.robot
csit/suites/tsdr/Cassandra/010_InterfaceMetrics.robot
csit/suites/tsdr/Cassandra/020_FlowMetrics.robot
csit/suites/tsdr/Cassandra/030_FlowTableMetrics.robot
csit/suites/tsdr/Cassandra/040_QueueMetrics.robot

index cb08c4528d10b1f9999b94b69a2018acd9e6cfb9..0e30f450f3a6175f0c25311804bb8c15b9fbe177 100644 (file)
@@ -11,7 +11,7 @@ Library           json
 Library           HttpLibrary.HTTP
 
 *** Variables ***
-${HBASE_CLIENT}    /usr/lib/hbase/hbase-0.94.15/bin
+${HBASE_CLIENT}    /tmp/Hbase/hbase-0.94.15/bin
 ${CASSANDRA_CLIENT}    /tmp/cassandra/apache-cassandra-2.1.12/bin
 ${final}          ${EMPTY}
 ${prompt_timeout}    ${EMPTY}
@@ -63,6 +63,7 @@ Iperf All Hosts
     Write    iperf ${host1} ${host2}
     Read Until    mininet>
 
+
 Iperf All Hosts Hbase
     [Arguments]    ${pattern}
     [Documentation]    Iperf between h1 and h2 and check Hbase
@@ -81,7 +82,7 @@ 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
+    ${query_output}=   Issue Command On Karaf Console    tsdr:list NETFLOW | wc -l
     Should Match Regexp    ${query_output}    ${pattern}
 
 Stop Tsdr Suite
@@ -263,6 +264,7 @@ Verify the Metrics Attributes on Cassandra Client
     ${metric_count}=    Get From List    ${split_line}    3
     [Return]    ${metric_count}
 
+
 Form Portstats Query Pattern
     [Arguments]    ${metric}    ${node}    ${port}    ${attribute}
     [Documentation]    Used for geneating openflow metrics Queries for Cassandra.
@@ -283,6 +285,7 @@ Create Temporary Key Info
     ${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
     @{metricval}=    Read File and Return Split Lines    ${CASSANDRA_DB_PATH}${temp_metric_val}
@@ -294,12 +297,13 @@ Verify Metric Val File
     [Return]    ${metric_count}
 
 Verify Metric log File
-    [Arguments]    ${pattern}
-    [Documentation]    Returns Value for lines in Metriclog file matching the pattern
+    [Arguments]    ${metric_log}    ${pattern}
+    [Documentation]    Returns Value for lines in Metriclog matching the 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}
@@ -308,11 +312,9 @@ Grep From File
 Find Metricval Keys
     [Arguments]    ${pattern}    ${file}
     [Documentation]    Return list element which has the particular 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}
     [Return]    @{split_line}
 
 Copy TSDR tables
@@ -416,7 +418,8 @@ Verify the Metrics Syslog 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}    val_table=${metric_log}
+    ${metric_log}=    Create Temporary Key Info    ${keya} ${keyb}    val_table=metriclog
+    [Return]    ${metric_log}
 
 Iterating over metricpath
     [Documentation]    Used to traverse over metricpath file and traverse over metricpath file and get the keys
@@ -607,6 +610,15 @@ Write SNMP config
     Append To File    snmp.cfg    \n
     Move File    snmp.cfg    ${SNMP_PATH}
 
+Bringup Netflow
+    [Documentation]    Brings up basic netflow setup .
+    Verify Feature Is Installed    odl-tsdr-netflow-statistics-collector
+    Wait Until Keyword Succeeds    24x    10 sec    Check Karaf Log Has Messages     NetFlow Data Colletor Initialized
+    Start Tsdr Suite
+    Ping All Hosts
+    Configure Netflow
+
+
 Collect Data from SNMP Agent
     [Arguments]    ${SNMP_IP}=127.0.0.1    ${SNMP_AGENT_COMM}=${SNMP_COMMUNITY}
     [Documentation]    Poll for SNMP Agent OID
@@ -644,32 +656,33 @@ 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},ifName:Iso88023Csmacd,SnmpMetric:IfOutDiscards*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutDiscards | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfInDiscards*
+    \    Append To List    ${SNMP_ENTRY}     grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInDiscards | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfInOctets*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInOctets | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfOutQLen*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutQLen | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfOutErrors*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutErrors | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfInUcastPkts*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInUcastPkts | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfOutNUcastPkts*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutNUcastPkts | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfInErrors*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInErrors | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfOutOctets*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutOctets | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfAdminStatus*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfAdminStatus | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfInUnknownProtos*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInUnknownProtos | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfOutUcastPkts*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutUcastPkts | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfInNUcastPkts*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInNUcastPkts | grep 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},ifName:Iso88023Csmacd,SnmpMetric:IfOperStatus*
+    \    Append To List    ${SNMP_ENTRY}    grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOperStatus | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOperStatus
     \    Append To List    ${SNMP_VALUES}    ${ifOperStatus}
     [Return]    ${SNMP_ENTRY}    ${SNMP_VALUES}
+
index 824cc913e93e84c343ac4e8318f378637b00dcae..26909df9b9de06fad8fa923479257d2c4438bed8 100644 (file)
@@ -13,14 +13,14 @@ 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
+${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_path}     metric_path
 ${metric_val}     metric_val
 @{xml_list}
 @{tsdr_list}
@@ -34,10 +34,10 @@ Verification of TSDR Cassandra Feature Installation
     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}
+    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
@@ -73,11 +73,13 @@ Storing Statistics from Openflow REST
     \    ${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
+    \    ${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}
@@ -99,9 +101,12 @@ Verification of InterfaceMetrics-Attributes on Cassandra Client
     \    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}
+    \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
+
+
 
 Verify Configuration Interval-change
     [Documentation]    Verify the TSDR Collection configuration changes
@@ -114,6 +119,7 @@ Verify Configuration Interval-change
     Delete All Sessions
 
 *** Keywords ***
+
 Verify TSDR Configuration Interval
     [Arguments]    ${interval}
     [Documentation]    Verify Configuration interval of TSDR Collection
@@ -137,3 +143,4 @@ Extract From DB Table
     ${ret_val1}=    Set Variable    -100
     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    ${pattern}
     [Return]    ${ret_val1}
+
index 0cdf5934c180ad82fc2ea93f43a5d9f217ae04cf..48887be1eec72a567d40a29907f8789af1891c3e 100644 (file)
@@ -11,10 +11,11 @@ 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
+${byte_count}    flow/flow-statistics/byte-count
 @{tsdr_op1}
 @{tsdr_op2}
 @{tsdr_op3}
@@ -25,33 +26,42 @@ ${byte_count}     flow/flow-statistics/byte-count
 @{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}
+    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_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}
@@ -60,23 +70,29 @@ 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}
+    \   ${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}
+    \   ${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}
+    \   ${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}
+    \   ${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}
+    \   ${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}
+    \   ${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}
@@ -84,24 +100,37 @@ Verification of FlowStats-Attributes on Cassandra Data Store
     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
+
index ec62e7f1a31485200e361eed29462e8baf9c9e77..2055c5e58befb12a42fa1c5d7885c7af9aac7a05 100644 (file)
@@ -23,6 +23,7 @@ ${packetmatched}    flow-table-statistics/packets-matched
 @{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
@@ -31,8 +32,8 @@ Verification of TSDR Cassandra Feature Installation
     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}
+    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
@@ -42,54 +43,77 @@ Getting all Tables from Openflow Plugin
     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
+    ${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
+    ${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
+    ${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
+
+
+
+    ${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
+    ${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
+    ${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
+
+
+    ${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
+    ${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
+    ${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
+
index 8b1ed17aa69cf491ee6cf204b950208d126c8ab8..2adaa5719227c27b87d22198f2f171218c9fa11e 100644 (file)
@@ -1,6 +1,6 @@
 *** Settings ***
 Documentation     Test suite for Cassandra DataStore Queue Stats Verification
-Suite Setup       Initialize Cassandra Tables Metricval
+Suite Setup           Initialize Cassandra Tables Metricval
 Suite Teardown    Stop Tsdr Suite
 Library           SSHLibrary
 Library           Collections
@@ -13,7 +13,7 @@ Variables         ../../../variables/Variables.py
 *** Variables ***
 @{QUEUE_METRICS}    TransmittedPackets    TransmittedBytes    TransmissionErrors
 ${TSDR_QUEUESTATS}    tsdr:list QueueStats
-${QUERY_HEAD}     ${OPERATIONAL_NODES_API}/node
+${QUERY_HEAD}    ${OPERATIONAL_NODES_API}/node
 ${query_head1}    ${QUERY_HEAD}/openflow:2/node-connector/openflow:2:2/queue/
 @{tsdr_q0}
 @{tsdr_q2}
@@ -26,6 +26,7 @@ ${transmittederrors}    flow-capable-node-connector-queue-statistics/transmissio
 @{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
@@ -35,33 +36,40 @@ Verification of TSDR Cassandra Feature Installation
     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}
+    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}
+    ${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}
+
+
+    ${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}
+
+
+    ${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
@@ -71,11 +79,18 @@ Verification of FlowStats-Attributes on Cassandra Data Store
     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
@@ -83,15 +98,21 @@ Verification of FlowStats-Attributes on Cassandra Data Store
     ${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