Upgrade RF syntax for v3.2 compatibility
[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/CompareStream.robot
10 Resource          ../../../libraries/KarafKeywords.robot
11 Resource          ../../../libraries/TsdrUtils.robot
12 Variables         ../../../variables/Variables.py
13
14 *** Variables ***
15 @{FLOW_METRICS}    PacketCount    ByteCount
16
17 *** Test Cases ***
18 Init Variables
19     [Documentation]    Initialize ODL version specific variables using resource CompareStream.
20     Init Variables Master
21
22 Verification of TSDR FlowMetrics
23     [Documentation]    Verify the TSDR FlowStats
24     Wait Until Keyword Succeeds    120s    1s    Verify the Metric is Collected?    ${TSDR_FLOWSTATS}    PacketCount
25     ${output}=    Issue Command On Karaf Console    ${TSDR_FLOWSTATS}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    30
26     FOR    ${list}    IN    @{FLOW_METRICS}
27         Should Contain    ${output}    ${list}
28     END
29
30 Verification of FlowMetrics-PacketCount on HBase Client
31     [Documentation]    Verify the FlowStats-Packetcount on both Karaf console and Hbase client
32     ${tsdr_cmd}=    Concatenate the String    ${TSDR_FLOWSTATS}    | grep PacketCount | head
33     ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    90
34     ${Line1}=    Get Line    ${output}    0
35     Should Contain    ${Line1}    PacketCount
36     Verify the Metrics Attributes on Hbase Client    PacketCount    ${node_connector}    ${flowstats}
37
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 Init Variables Master
48     [Documentation]    Sets variables specific to latest(master) version
49     Set Suite Variable    ${TSDR_FLOWSTATS}    tsdr:list FLOWSTATS
50     set Suite Variable    ${node_connector}    Node:openflow:1,Table:0
51     set suite Variable    ${flowstats}    FLOWSTATS