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