Added scripts to start HBase server before controller
[integration/test.git] / test / csit / suites / tsdr / HBase / 060_FlowMeterMetrics.robot
1 *** Settings ***\r
2 Documentation     Test suite for Hbase DataStore FlowMeter Stats Verification\r
3 Suite Setup       Run Keywords    Start TSDR suite with CPqD Switch    Configuration of FlowMeter 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 @{FLOWMETER_METRICS}    ByteInCount    PacketInCount    FlowCount\r
15 ${TSDR_FLOWMETERSTATS}    tsdr:list FlowMeterStats\r
16 @{FLOWMETER_HEADER}    MetricName    MetricValue    MetricCategory    MetricDetails\r
17 \r
18 *** Test Cases ***\r
19 Verify the FlowMeter Stats attributes exist thru Karaf console\r
20     [Documentation]    Verify the FlowMeterStats attributes exist on Karaf Console\r
21     Wait Until Keyword Succeeds    180s    1s    Verify the Metric is Collected?    ${TSDR_FLOWMETERSTATS}    ByteInCount\r
22     ${output}=    Issue Command On Karaf Console    ${TSDR_FLOWMETERSTATS}    ${CONTROLLER}    ${KARAF_SHELL_PORT}    30\r
23     : FOR    ${list}    IN    @{FLOWMETER_METRICS}\r
24     \    Should Contain    ${output}    ${list}\r
25 \r
26 Verification of FlowMeterStats-ByteInCount on Karaf Console\r
27     [Documentation]    Verify the FlowMeterStats has been updated thru tsdr:list command on karaf console\r
28     ${tsdr_cmd}=    Concatenate the String    ${TSDR_FLOWMETERSTATS}    | grep ByteInCount | head\r
29     ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${CONTROLLER}    ${KARAF_SHELL_PORT}    90\r
30     Should Contain    ${output}    ByteInCount\r
31     Should Contain    ${output}    FlowMeterStats\r
32     Should not Contain    ${output}    null\r
33     : FOR    ${list}    IN    @{FLOWMETER_HEADER}\r
34     \    Should Contain    ${output}    ${list}\r
35 \r
36 Verification of FlowMeterStats-ByteInCount on HBase Client\r
37     [Documentation]    Verify the FlowMeterStats has been updated on HBase Datastore\r
38     ${query}=    Generate HBase Query    MeterMetrics    ByteInCount_openflow:1\r
39     ${out}=    Query the Data from HBaseClient    ${query}\r
40     Should Match Regexp    ${out}    (?mui)ByteInCount\r
41 \r
42 Verification of FlowMeterStats-PacketInCount on HBase Client\r
43     [Documentation]    Verify the FlowMeterStats has been updated on HBase Datastore\r
44     ${query}=    Generate HBase Query    MeterMetrics    PacketInCount_openflow:1\r
45     ${out}=    Query the Data from HBaseClient    ${query}\r
46     Should Match Regexp    ${out}    (?mui)PacketInCount\r
47 \r
48 Verification of FlowMeterStats-FlowCount on HBase Client\r
49     [Documentation]    Verify the FlowMeterStats has been updated on HBase Datastore\r
50     ${query}=    Generate HBase Query    MeterMetrics    FlowCount_openflow:1\r
51     ${out}=    Query the Data from HBaseClient    ${query}\r
52     Should Match Regexp    ${out}    (?mui)FlowCount\r
53 \r
54 Uninstall all TSDR HBase Feature\r
55     [Documentation]    UnInstall all TSDR HBase Features\r
56     Uninstall a Feature    odl-tsdr-hbase-persistence odl-hbaseclient odl-tsdr-core odl-tsdr-hbase\r
57     Verify Feature Is Not Installed    odl-tsdr-hbase-persistence\r
58     Verify Feature Is Not Installed    odl-hbaseclient\r
59     Verify Feature Is Not Installed    odl-tsdr-core\r
60     Verify Feature Is Not Installed    odl-tsdr-hbase\r
61 \r
62 Verification TSDR Command shouldnot exist in help\r
63     [Documentation]    Verify the TSDR List command on help\r
64     ${output}=    Issue Command On Karaf Console    tsdr\t    ${CONTROLLER}    ${KARAF_SHELL_PORT}\r
65     Should not Contain    ${output}    tsdr:list\r
66 \r
67 *** Keyword ***\r
68 Start TSDR suite with CPqD Switch\r
69     Start Tsdr Suite    user\r
70 \r
71 Configuration of FlowMeter on Switch\r
72     [Documentation]    FlowMeter configuration on CPqD\r
73     Run Command On Remote System    ${MININET}    sudo dpctl unix:/tmp/s1 meter-mod cmd=add,flags=1,meter=1 drop:rate=100\r
74     Run Command On Remote System    ${MININET}    sudo dpctl unix:/tmp/s1 flow-mod table=0,cmd=add in_port=1 meter:1 apply:output=2\r
75     Run Command On Remote System    ${MININET}    sudo dpctl unix:/tmp/s1 ping 10\r
76     Run Command On Remote System    ${MININET}    sudo dpctl unix:/tmp/s2 ping 10\r