6867db1adaad2f7ee36570e1b886949445c4d682
[integration/test.git] / csit / suites / tsdr / HBase / 010_InterfaceMetrics.robot
1 *** Settings ***
2 Documentation     Test suite for Hbase DataStore PortStats Verification
3 Suite Setup       Initialize the Tsdr Suite
4 Suite Teardown    Stop Tsdr Suite
5 Library           SSHLibrary
6 Library           Collections
7 Library           String
8 Library           RequestsLibrary
9 Library           ../../../libraries/Common.py
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 @{CATEGORY}       FLOWGROUPSTATS    FLOWMETERSTATS    FLOWSTATS    FLOWTABLESTATS    PORTSTATS    QUEUESTATS
18 ${TSDR_PORTSTATS}    tsdr:list PORTSTATS
19 ${CONFIG_INTERVAL}    /restconf/config/tsdr-openflow-statistics-collector:TSDRDCConfig
20 ${OPER_INTERVAL}    /restconf/operations/tsdr-openflow-statistics-collector:setPollingInterval
21
22 *** Test Cases ***
23 Verification of TSDR HBase Feature Installation
24     [Documentation]    Install and Verify the TSDR HBase Features
25     COMMENT    Install a Feature    odl-tsdr-hbase    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
26     Verify Feature Is Installed    odl-tsdr-hbase
27     Verify Feature Is Installed    odl-hbaseclient
28
29 Verification TSDR Command is exist in Help
30     [Documentation]    Verify the TSDR List command on Help
31     ${output}=    Issue Command On Karaf Console    tsdr\t
32     Should Contain    ${output}    tsdr:list
33     ${output}=    Issue Command On Karaf Console    tsdr:list\t\t
34     : FOR    ${list}    IN    @{CATEGORY}
35     \    Should Contain    ${output}    ${list}
36     Wait Until Keyword Succeeds    620s    1s    Verify the Metric is Collected?    ${TSDR_PORTSTATS}    openflow
37
38 Verification of TSDR PortStats
39     [Documentation]    Verify the TSDR InterfaceMetrics
40     : FOR    ${list}    IN    @{INTERFACE_METRICS}
41     \    ${tsdr_cmd}=    Concatenate the String    ${TSDR_PORTSTATS}    | grep ${list} | head
42     \    ${output}=    Issue Command On Karaf Console    ${tsdr_cmd}    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    30
43     \    Should Contain    ${output}    ${list}
44
45 Verification of InterfaceMetrics-Attributes on HBase Client
46     [Documentation]    Verify the InterfaceMetrics has been updated on HBase Datastore
47     : FOR    ${list}    IN    @{INTERFACE_METRICS}
48     \    Verify the Metrics Attributes on Hbase Client    ${list}    Node:openflow:1,NodeConnector:1    PORTSTATS
49
50 Verify Configuration Interval-change
51     [Documentation]    Verify the TSDR Collection configuration changes
52     Verify TSDR Configuration Interval    180
53     Post TSDR Configuration Interval    200
54     Verify TSDR Configuration Interval    200
55     Post TSDR Configuration Interval    180
56     Verify TSDR Configuration Interval    180
57
58 *** Keywords ***
59 Initialize the Tsdr Suite
60     COMMENT    Initialize the HBase for TSDR
61     Start Tsdr Suite
62     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
63
64 Verify TSDR Configuration Interval
65     [Arguments]    ${interval}
66     [Documentation]    Verify Configuration interval of TSDR Collection
67     ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_INTERVAL}
68     Should Be Equal As Strings    ${resp.status_code}    200
69     Should Contain    ${resp.content}    ${interval}
70
71 Post TSDR Configuration Interval
72     [Arguments]    ${interval}
73     [Documentation]    Configuration TSDR collection interval ${interval}
74     ${p1}    Create Dictionary    interval=${interval}
75     ${p2}    Create Dictionary    input=${p1}
76     ${post_data}    Create Dictionary    setPollingInterval=${p2}
77     Log    ${post_data}
78     ${resp}    RequestsLibrary.Post Request    session    ${OPER_INTERVAL}    ${post_data}
79     Should Be Equal As Strings    ${resp.status_code}    201