e891fb5f49c4f4215dc322c322b78ef496d9af68
[integration/test.git] / csit / suites / tsdr / H2 / 010_InterfaceMetrics.robot
1 *** Settings ***
2 Documentation       Test suite for H2 DataStore InterfaceMetrics Verification
3
4 Library             SSHLibrary
5 Library             Collections
6 Library             String
7 Library             ../../../libraries/Common.py
8 Resource            ../../../libraries/KarafKeywords.robot
9 Resource            ../../../libraries/TsdrUtils.robot
10 Variables           ../../../variables/Variables.py
11
12 Suite Setup         Start Tsdr Suite
13 Suite Teardown      Stop Tsdr Suite
14
15
16 *** Variables ***
17 @{INTERFACE_METRICS}
18 ...                     TransmittedPackets
19 ...                     TransmittedBytes
20 ...                     TransmitErrors
21 ...                     TransmitDrops
22 ...                     ReceivedPackets
23 ...                     ReceivedBytes
24 ...                     ReceiveOverRunError
25 ...                     ReceiveFrameError
26 ...                     ReceiveErrors
27 ...                     ReceiveDrops
28 ...                     ReceiveCrcError
29 ...                     CollisionCount
30 @{CATEGORY}             FlowGroupStats    FlowMeterStats    FlowStats    FlowTableStats    PortStats    QueueStats
31 ${TSDR_PORTSTATS}       tsdr:list PortStats
32
33
34 *** Test Cases ***
35 Verification of TSDR H2 Feature Installation
36     [Documentation]    Install and Verify the TSDR H2 Datastore and JDBC
37     Install a Feature    jdbc    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
38     Verify Feature Is Installed    jdbc
39     COMMENT    Install a Feature    odl-tsdr-all    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
40     Verify Feature Is Installed    odl-tsdr-all
41     Verify Feature Is Installed    odl-tsdr-H2-persistence
42     Verify Feature Is Installed    odl-tsdr-core
43     Wait Until Keyword Succeeds
44     ...    120s
45     ...    1s
46     ...    Verify the Metric is Collected?
47     ...    log:display | grep "TSDR H2"
48     ...    TSDR H2
49
50 Verification TSDR Command is exist in Help
51     [Documentation]    Verify the TSDR List command on Help
52     ${output}=    Issue Command On Karaf Console    tsdr\t
53     Should Contain    ${output}    tsdr:list
54     Should Contain    ${output}    tsdr:purgeall
55     ${output}=    Issue Command On Karaf Console    tsdr:list\t\t
56     FOR    ${list}    IN    @{CATEGORY}
57         Should Contain    ${output}    ${list}
58     END
59     Wait Until Keyword Succeeds    60s    1s    Verify the Metric is Collected?    ${TSDR_PORTSTATS}    openflow
60
61 Verify PortStats On Karaf console
62     [Documentation]    Verify the InterfaceMetrics(PortStats),attributes using ${TSDR_PORTSTATS}
63     FOR    ${list}    IN    @{INTERFACE_METRICS}
64         ${tsdr_cmd}=    Concatenate the String    ${TSDR_PORTSTATS}    | grep ${list} | head
65         ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    30
66         Should Contain    ${output}    ${list}
67     END
68
69 Verify PortStats-Attributes on H2 Datastore using JDBC Client
70     [Documentation]    Verify the PortStats,attributes on H2 Datastore using JDBC Client
71     FOR    ${list}    IN    @{INTERFACE_METRICS}
72         ${output}=    Query Metrics on H2 Datastore    PORTSTATS    ${list}
73         Should Contain    ${output}    ${list}
74     END