Step 1: Move vm scripts to the right place
[integration/test.git] / csit / suites / tsdr / HBase / 050_GroupMetrics.robot
1 *** Settings ***
2 Documentation     Test suite for Hbase DataStore FlowGroup Stats Verification
3 Suite Setup       Run Keywords    Start TSDR suite with CPqD Switch    Configuration of FlowGroup on Switch
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 @{FLOWGROUP_METRICS}    ByteCount    PacketCount    RefCount
15 ${TSDR_FLOWGROUPSTATS}    tsdr:list FlowGroupStats
16 @{FLOWGROUP_HEADER}    MetricName    MetricValue    MetricCategory    MetricDetails
17
18 *** Test Cases ***
19 Verify the FlowGroup Stats attributes exist thru Karaf console
20     [Documentation]    Verify the FlowGroupStats attributes exist on Karaf Console
21     Wait Until Keyword Succeeds    180s    1s    Verify the Metric is Collected?    ${TSDR_FLOWGROUPSTATS}    ByteCount
22     ${output}=    Issue Command On Karaf Console    ${TSDR_FLOWGROUPSTATS}    ${CONTROLLER}    ${KARAF_SHELL_PORT}    30
23     : FOR    ${list}    IN    @{FLOWGROUP_METRICS}
24     \    Should Contain    ${output}    ${list}
25
26 Verification of FlowGroupStats-ByteCount on Karaf Console
27     [Documentation]    Verify the FlowGroupStats has been updated thru tsdr:list command on karaf console
28     ${tsdr_cmd}=    Concatenate the String    ${TSDR_FLOWGROUPSTATS}    | grep ByteCount | head
29     ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${CONTROLLER}    ${KARAF_SHELL_PORT}    90
30     Should Contain    ${output}    ByteCount
31     Should Contain    ${output}    FlowGroupStats
32     Should not Contain    ${output}    null
33     : FOR    ${list}    IN    @{FLOWGROUP_HEADER}
34     \    Should Contain    ${output}    ${list}
35
36 Verification of FlowGroupStats-ByteCount on HBase Client
37     [Documentation]    Verify the FlowGroupStats has been updated on HBase Datastore
38     ${query}=    Generate HBase Query    GroupMetrics    ByteCount_openflow:1
39     ${out}=    Query the Data from HBaseClient    ${query}
40     Should Match Regexp    ${out}    (?mui)ByteCount
41
42 Verification of FlowGroupStats-PacketCount on HBase Client
43     [Documentation]    Verify the FlowGroupStats has been updated on HBase Datastore
44     ${query}=    Generate HBase Query    GroupMetrics    PacketCount_openflow:1
45     ${out}=    Query the Data from HBaseClient    ${query}
46     Should Match Regexp    ${out}    (?mui)PacketCount
47
48 Verification of FlowGroupStats-RefCount on HBase Client
49     [Documentation]    Verify the FlowGroupStats has been updated on HBase Datastore
50     ${query}=    Generate HBase Query    GroupMetrics    RefCount_openflow:1
51     ${out}=    Query the Data from HBaseClient    ${query}
52     Should Match Regexp    ${out}    (?mui)RefCount
53
54 *** Keyword ***
55 Start TSDR suite with CPqD Switch
56     Start Tsdr Suite    user
57
58 Configuration of FlowGroup on Switch
59     [Documentation]    FlowGroup configuration on CPqD
60     Run Command On Remote System    ${MININET}    sudo dpctl unix:/tmp/s1 group-mod cmd=add,group=1,type=all
61     Run Command On Remote System    ${MININET}    sudo dpctl unix:/tmp/s1 flow-mod table=0,cmd=add eth_type=0x800,eth_src=00:01:02:03:04:05 apply:group=1
62     Run Command On Remote System    ${MININET}    sudo dpctl unix:/tmp/s1 ping 10
63     Run Command On Remote System    ${MININET}    sudo dpctl unix:/tmp/s2 ping 10