Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / tsdr / H2 / 010_InterfaceMetrics.robot
1 *** Settings ***
2 Documentation     Test suite for H2 DataStore InterfaceMetrics Verification
3 Suite Setup       Start Tsdr Suite
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 @{INTERFACE_METRICS}    TransmittedPackets    TransmittedBytes    TransmitErrors    TransmitDrops    ReceivedPackets    ReceivedBytes    ReceiveOverRunError
15 ...               ReceiveFrameError    ReceiveErrors    ReceiveDrops    ReceiveCrcError    CollisionCount
16 @{CATEGORY}       FlowGroupStats    FlowMeterStats    FlowStats    FlowTableStats    PortStats    QueueStats
17 ${TSDR_PORTSTATS}    tsdr:list PortStats
18
19 *** Test Cases ***
20 Verification of TSDR H2 Feature Installation
21     [Documentation]    Install and Verify the TSDR H2 Datastore and JDBC
22     Install a Feature    jdbc    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
23     Verify Feature Is Installed    jdbc
24     COMMENT    Install a Feature    odl-tsdr-all    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
25     Verify Feature Is Installed    odl-tsdr-all
26     Verify Feature Is Installed    odl-tsdr-H2-persistence
27     Verify Feature Is Installed    odl-tsdr-core
28     Wait Until Keyword Succeeds    120s    1s    Verify the Metric is Collected?    log:display | grep "TSDR H2"    TSDR H2
29
30 Verification TSDR Command is exist in Help
31     [Documentation]    Verify the TSDR List command on Help
32     ${output}=    Issue Command On Karaf Console    tsdr\t
33     Should Contain    ${output}    tsdr:list
34     Should Contain    ${output}    tsdr:purgeall
35     ${output}=    Issue Command On Karaf Console    tsdr:list\t\t
36     FOR    ${list}    IN    @{CATEGORY}
37         Should Contain    ${output}    ${list}
38     END
39     Wait Until Keyword Succeeds    60s    1s    Verify the Metric is Collected?    ${TSDR_PORTSTATS}    openflow
40
41 Verify PortStats On Karaf console
42     [Documentation]    Verify the InterfaceMetrics(PortStats),attributes using ${TSDR_PORTSTATS}
43     FOR    ${list}    IN    @{INTERFACE_METRICS}
44         ${tsdr_cmd}=    Concatenate the String    ${TSDR_PORTSTATS}    | grep ${list} | head
45         ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    30
46         Should Contain    ${output}    ${list}
47     END
48
49 Verify PortStats-Attributes on H2 Datastore using JDBC Client
50     [Documentation]    Verify the PortStats,attributes on H2 Datastore using JDBC Client
51     FOR    ${list}    IN    @{INTERFACE_METRICS}
52         ${output}=    Query Metrics on H2 Datastore    PORTSTATS    ${list}
53         Should Contain    ${output}    ${list}
54     END