Modified HBase scripts to run in Lithium Branch.
[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/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
17 *** Test Cases ***
18 Init Variables
19     [Documentation]    Initialize ODL version specific variables
20     log    ${ODL_VERSION}
21     Run Keyword If    '${ODL_VERSION}' == 'stable-lithium'    Init Variables Lithium
22     ...    ELSE    Init Variables Master
23
24 Verification of TSDR HSQLDB Feature Installation
25     [Documentation]    Install and Verify the TSDR HSQLDB Datastore and JDBC
26     COMMENT    Install a Feature    odl-tsdr-hsqldb    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
27     COMMENT    Install a Feature    odl-tsdr-openflow-statistics-collector    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
28     Verify Feature Is Installed    ${HSQLDB_INSTALL}
29     Verify Feature Is Installed    odl-tsdr-core
30
31 Verification TSDR Command exists in Help
32     [Documentation]    Verify the TSDR List command on Help
33     ${output}=    Issue Command On Karaf Console    tsdr\t
34     Should Contain    ${output}    tsdr:list
35     ${output}=    Issue Command On Karaf Console    tsdr:list\t\t
36     : FOR    ${list}    IN    @{CATEGORY}
37     \    Should Contain    ${output}    ${list}
38     Wait Until Keyword Succeeds    60s    1s    Verify the Metric is Collected?    ${TSDR_PORTSTATS}    openflow
39
40 Verify PortStats On Karaf console
41     [Documentation]    Verify the InterfaceMetrics(PortStats),attributes using ${TSDR_PORTSTATS}
42     : FOR    ${list}    IN    @{INTERFACE_METRICS}
43     \    ${tsdr_cmd}=    Concatenate the String    ${TSDR_PORTSTATS}    | grep ${list} | head
44     \    ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    30
45     \    Should Contain    ${output}    ${list}
46
47 *** Keywords ***
48 Init Variables Master
49     [Documentation]    Sets variables specific to latest(master) version
50     Set Suite Variable    @{CATEGORY}       FLOWGROUPSTATS    FLOWMETERSTATS    FLOWSTATS    FLOWTABLESTATS    PORTSTATS    QUEUESTATS
51     Set Suite Variable    ${TSDR_PORTSTATS}    tsdr:list PORTSTATS
52     Set Suite Variable    ${HSQLDB_INSTALL}    odl-tsdr-hsqldb
53
54 Init Variables Lithium
55     [Documentation]    Sets variables specific to Lithium version
56     Set Suite Variable    @{CATEGORY}       FlowStats    FlowTableStats    PortStats    QueueStats
57     Set Suite Variable    ${TSDR_PORTSTATS}    tsdr:list PortStats
58     Set Suite Variable    ${HSQLDB_INSTALL}    odl-tsdr-HSQLDB