7d2aad3342038bede37c199978f49d7ec260a411
[integration/test.git] / csit / suites / tsdr / HSQLDB / 010_InterfaceMetrics.robot
1 *** Settings ***
2 Documentation     Test suite for HSQLDB 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/CompareStream.robot
10 Resource          ../../../libraries/KarafKeywords.robot
11 Resource          ../../../libraries/TsdrUtils.robot
12 Variables         ../../../variables/Variables.py
13
14 *** Variables ***
15 @{INTERFACE_METRICS}    TransmittedPackets    TransmittedBytes    TransmitErrors    TransmitDrops    ReceivedPackets    ReceivedBytes    ReceiveOverRunError
16 ...               ReceiveFrameError    ReceiveErrors    ReceiveDrops    ReceiveCrcError    CollisionCount
17
18 *** Test Cases ***
19 Init Variables
20     [Documentation]    Initialize ODL version specific variables
21     log    ${ODL_VERSION}
22     CompareStream.Run_Keyword_If_Less_Than_Beryllium    Init Variables Lithium
23     Init Variables Master
24
25 Verification of TSDR HSQLDB Feature Installation
26     [Documentation]    Install and Verify the TSDR HSQLDB Datastore and JDBC
27     COMMENT    Install a Feature    odl-tsdr-hsqldb    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
28     COMMENT    Install a Feature    odl-tsdr-openflow-statistics-collector    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
29     Verify Feature Is Installed    ${HSQLDB_INSTALL}
30     Verify Feature Is Installed    odl-tsdr-core
31
32 Verification TSDR Command exists in Help
33     [Documentation]    Verify the TSDR List command on Help
34     ${output}=    Issue Command On Karaf Console    tsdr\t
35     Should Contain    ${output}    tsdr:list
36     ${output}=    Issue Command On Karaf Console    tsdr:list\t\t
37     : FOR    ${list}    IN    @{CATEGORY}
38     \    Should Contain    ${output}    ${list}
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
48 *** Keywords ***
49 Init Variables Master
50     [Documentation]    Sets variables specific to latest(master) version
51     Set Suite Variable    @{CATEGORY}    FLOWGROUPSTATS    FLOWMETERSTATS    FLOWSTATS    FLOWTABLESTATS    PORTSTATS
52     ...    QUEUESTATS
53     Set Suite Variable    ${TSDR_PORTSTATS}    tsdr:list PORTSTATS
54     Set Suite Variable    ${HSQLDB_INSTALL}    odl-tsdr-hsqldb
55
56 Init Variables Lithium
57     [Documentation]    Sets variables specific to Lithium version
58     Set Suite Variable    @{CATEGORY}    FlowStats    FlowTableStats    PortStats    QueueStats
59     Set Suite Variable    ${TSDR_PORTSTATS}    tsdr:list PortStats
60     Set Suite Variable    ${HSQLDB_INSTALL}    odl-tsdr-HSQLDB