Step 1: Move vm scripts to the right place
[integration/test.git] / csit / suites / tsdr / H2 / 040_QueueMetrics.robot
1 *** Settings ***
2 Documentation     Test suite for H2 DataStore Queue Metrics Verification
3 Suite Setup       Run Keywords    Start Tsdr Suite    Configuration of Queue on Switch
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 @{QUEUE_METRICS}    TransmittedPackets    TransmittedBytes    TransmissionErrors
15 ${TSDR_QUEUE_STATS}    tsdr:list QueueStats
16 @{CMD_LIST}       FlowGroupStats    FlowMeterStats    FlowStats    FlowTableStats    PortStats    QueueStats
17
18 *** Test Cases ***
19 Verify the Queue Stats attributes exist thru Karaf console
20     [Documentation]    Verify the QueueMetrics attributes exist on Karaf Console
21     Wait Until Keyword Succeeds    60s    1s    Verify the Metric is Collected?    ${TSDR_QUEUE_STATS}    Transmitted
22     ${output}=    Issue Command On Karaf Console    ${TSDR_QUEUE_STATS}    ${CONTROLLER}    ${KARAF_SHELL_PORT}    30
23     : FOR    ${list}    IN    @{QUEUE_METRICS}
24     \    Should Contain    ${output}    ${list}
25
26 Verify QueueStats-Attributes on H2 Datastore using JDBC Client
27     [Documentation]    Verify the QueueStats,attributes on H2 Datastore using JDBC Client
28     : FOR    ${list}    IN    @{QUEUE_METRICS}
29     \    ${output}=    Query Metrics on H2 Datastore    QUEUESTATS    ${list}
30     \    Should Contain    ${output}    ${list}
31
32 Verify tsdr:purgeall command
33     [Documentation]    Verify the tsdr:purgeall command
34     Issue Command On Karaf Console    tsdr:purgeall    ${CONTROLLER}    ${KARAF_SHELL_PORT}
35     : FOR    ${list}    IN    @{CMD_LIST}
36     \    ${out}=    Issue Command On Karaf Console    tsdr:list ${list}    ${CONTROLLER}    ${KARAF_SHELL_PORT}
37     \    Should Contain    ${out}    no data of this category
38     : FOR    ${list}    IN    @{QUEUE_METRICS}
39     \    ${out}=    Query Metrics on H2 Datastore    QUEUESTATS    ${list}
40     \    Should not Contain    ${out}    ${list}
41
42 *** Keyword ***
43 Configuration of Queue on Switch
44     [Documentation]    Queue configuration on openvswitch
45     Configure the Queue on Switch    s2-eth2