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