Tidy new and updated test suites
[integration/test.git] / csit / suites / tsdr / HBase / 020_FlowMetrics.robot
index 03f351912b9d8137d70558708a6f36cfffc3c750..bf5edf932275b33ffc4014836339a16b990a55e0 100644 (file)
@@ -12,33 +12,46 @@ Variables         ../../../variables/Variables.py
 
 *** Variables ***
 @{FLOW_METRICS}    PacketCount    ByteCount
-${TSDR_FLOWSTATS}    tsdr:list FlowStats
 
 *** Test Cases ***
+Init Variables
+    [Documentation]    Initialize ODL version specific variables
+    log    ${ODL_VERSION}
+    Run Keyword If    '${ODL_VERSION}' == 'stable-lithium'    Init Variables Lithium
+    ...    ELSE    Init Variables Master
+
 Verification of TSDR FlowMetrics
     [Documentation]    Verify the TSDR FlowStats
     Wait Until Keyword Succeeds    120s    1s    Verify the Metric is Collected?    ${TSDR_FLOWSTATS}    PacketCount
-    ${output}=    Issue Command On Karaf Console    ${TSDR_FLOWSTATS}    ${CONTROLLER}    ${KARAF_SHELL_PORT}    30
+    ${output}=    Issue Command On Karaf Console    ${TSDR_FLOWSTATS}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    30
     : FOR    ${list}    IN    @{FLOW_METRICS}
     \    Should Contain    ${output}    ${list}
 
 Verification of FlowMetrics-PacketCount on HBase Client
     [Documentation]    Verify the FlowStats-Packetcount on both Karaf console and Hbase client
     ${tsdr_cmd}=    Concatenate the String    ${TSDR_FLOWSTATS}    | grep PacketCount | head
-    ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${CONTROLLER}    ${KARAF_SHELL_PORT}    90
+    ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    90
     ${Line1}=    Get Line    ${output}    0
     Should Contain    ${Line1}    PacketCount
-    ${q1}=    Generate HBase Query    FlowMetrics    PacketCount_openflow:1_0
-    ${out}=    Query the Data from HBaseClient    ${q1}
-    Comment    ${output}=    Get Metrics Value    ${Line1}
-    Should Match Regexp    ${out}    (?mui)PacketCount_openflow
+    Verify the Metrics Attributes on Hbase Client    PacketCount    ${node_connector}    ${flowstats}
 
 Verification of FlowMetrics-BytesCount on HBase Client
     [Documentation]    Verify the FlowStats-ByteCount on both Karaf Console and Hbase Client
     ${tsdr_cmd}=    Concatenate the String    ${TSDR_FLOWSTATS}    | grep ByteCount | head
-    ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${CONTROLLER}    ${KARAF_SHELL_PORT}    90
+    ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    90
     ${Line1}=    Get Line    ${output}    0
     Should Contain    ${Line1}    ByteCount
-    ${q1}=    Generate HBase Query    FlowMetrics    ByteCount_openflow:1_0
-    ${out}=    Query the Data from HBaseClient    ${q1}
-    Should Match Regexp    ${out}    (?mui)ByteCount_openflow
+    Verify the Metrics Attributes on Hbase Client    ByteCount    ${node_connector}    ${flowstats}
+
+*** Keywords ***
+Init Variables Master
+    [Documentation]    Sets variables specific to latest(master) version
+    Set Suite Variable    ${TSDR_FLOWSTATS}    tsdr:list FLOWSTATS
+    set Suite Variable    ${node_connector}    Node:openflow:1,Table:0
+    set suite Variable    ${flowstats}    FLOWSTATS
+
+Init Variables Lithium
+    [Documentation]    Sets variables specific to Lithium version
+    Set Suite Variable    ${TSDR_FLOWSTATS}    tsdr:list FlowStats
+    set Suite Variable    ${node_connector}    openflow:1_0
+    set suite Variable    ${flowstats}    FlowMetrics