Modified HBase scripts to run in Lithium Branch.
[integration/test.git] / csit / suites / tsdr / HBase / 020_FlowMetrics.robot
1 *** Settings ***
2 Documentation     Test suite for Hbase DataStore Flow Stats Verification
3 Suite Setup       Start Tsdr Suite
4 Suite Teardown    Stop Tsdr Suite
5 Library           SSHLibrary
6 Library           Collections
7 Library           String
8 Library           ../../../libraries/Common.py
9 Resource          ../../../libraries/KarafKeywords.robot
10 Resource          ../../../libraries/TsdrUtils.robot
11 Variables         ../../../variables/Variables.py
12
13 *** Variables ***
14 @{FLOW_METRICS}    PacketCount    ByteCount
15
16 *** Test Cases ***
17
18 Init Variables
19     [Documentation]    Initialize ODL version specific variables
20     log    ${ODL_VERSION}
21     Run Keyword If    '${ODL_VERSION}' == 'stable-lithium'    Init Variables Lithium
22     ...    ELSE    Init Variables Master
23
24 Verification of TSDR FlowMetrics
25     [Documentation]    Verify the TSDR FlowStats
26     Wait Until Keyword Succeeds    120s    1s    Verify the Metric is Collected?    ${TSDR_FLOWSTATS}    PacketCount
27     ${output}=    Issue Command On Karaf Console    ${TSDR_FLOWSTATS}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    30
28     : FOR    ${list}    IN    @{FLOW_METRICS}
29     \    Should Contain    ${output}    ${list}
30
31 Verification of FlowMetrics-PacketCount on HBase Client
32     [Documentation]    Verify the FlowStats-Packetcount on both Karaf console and Hbase client
33     ${tsdr_cmd}=    Concatenate the String    ${TSDR_FLOWSTATS}    | grep PacketCount | head
34     ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    90
35     ${Line1}=    Get Line    ${output}    0
36     Should Contain    ${Line1}    PacketCount
37     Verify the Metrics Attributes on Hbase Client    PacketCount    ${node_connector}    ${flowstats}
38 Verification of FlowMetrics-BytesCount on HBase Client
39     [Documentation]    Verify the FlowStats-ByteCount on both Karaf Console and Hbase Client
40     ${tsdr_cmd}=    Concatenate the String    ${TSDR_FLOWSTATS}    | grep ByteCount | head
41     ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    90
42     ${Line1}=    Get Line    ${output}    0
43     Should Contain    ${Line1}    ByteCount
44     Verify the Metrics Attributes on Hbase Client    ByteCount    ${node_connector}    ${flowstats}
45
46 *** Keywords ***
47
48 Init Variables Master
49     [Documentation]    Sets variables specific to latest(master) version
50     Set Suite Variable    ${TSDR_FLOWSTATS}    tsdr:list FLOWSTATS
51     set Suite Variable    ${node_connector}    Node:openflow:1,Table:0
52     set suite Variable    ${flowstats}    FLOWSTATS
53
54 Init Variables Lithium
55     [Documentation]    Sets variables specific to Lithium version
56     Set Suite Variable    ${TSDR_FLOWSTATS}    tsdr:list FlowStats
57     set Suite Variable    ${node_connector}    openflow:1_0
58     set suite Variable    ${flowstats}    FlowMetrics
59