Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / tsdr / H2 / 050_GroupMetrics.robot
1 *** Settings ***
2 Documentation     Test suite for H2 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    120s    1s    Verify the Metric is Collected?    ${TSDR_FLOWGROUPSTATS}    ByteCount
22     ${output}=    Issue Command On Karaf Console    ${TSDR_FLOWGROUPSTATS}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    30
23     FOR    ${list}    IN    @{FLOWGROUP_METRICS}
24         Should Contain    ${output}    ${list}
25     END
26
27 Verification of FlowGroupStats-ByteCount on Karaf Console
28     [Documentation]    Verify the FlowGroupStats has been updated thru tsdr:list command on karaf console
29     ${tsdr_cmd}=    Concatenate the String    ${TSDR_FLOWGROUPSTATS}    | grep ByteCount | head
30     ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    90
31     Should Contain    ${output}    ByteCount
32     Should Contain    ${output}    FLOWGROUPSTATS
33     Should not Contain    ${output}    null
34     FOR    ${list}    IN    @{FLOWGROUP_HEADER}
35         Should Contain    ${output}    ${list}
36     END
37
38 Verify FlowGroupStats-Attributes on H2 Datastore using JDBC Client
39     [Documentation]    Verify the GroupStats,attributes on H2 Datastore using JDBC Client
40     FOR    ${list}    IN    @{FLOWGROUP_METRICS}
41         ${output}=    Query Metrics on H2 Datastore    FLOWGROUPSTATS    ${list}
42         Should Contain    ${output}    ${list}
43     END
44
45 *** Keyword ***
46 Start TSDR suite with CPqD Switch
47     Start Tsdr Suite    user
48
49 Configuration of FlowGroup on Switch
50     [Documentation]    FlowGroup configuration on CPqD
51     Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo dpctl unix:/tmp/s1 group-mod cmd=add,group=1,type=all
52     Run Command On Remote System    ${TOOLS_SYSTEM_IP}    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
53     Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo dpctl unix:/tmp/s1 ping 10
54     Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo dpctl unix:/tmp/s2 ping 10