2adaa5719227c27b87d22198f2f171218c9fa11e
[integration/test.git] / csit / suites / tsdr / Cassandra / 040_QueueMetrics.robot
1 *** Settings ***
2 Documentation     Test suite for Cassandra DataStore Queue Stats Verification
3 Suite Setup           Initialize Cassandra Tables Metricval
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_QUEUESTATS}    tsdr:list QueueStats
16 ${QUERY_HEAD}    ${OPERATIONAL_NODES_API}/node
17 ${query_head1}    ${QUERY_HEAD}/openflow:2/node-connector/openflow:2:2/queue/
18 @{tsdr_q0}
19 @{tsdr_q2}
20 @{tsdr_q1}
21 ${transmittedpackets}    flow-capable-node-connector-queue-statistics/transmitted-packets
22 ${transmittedbytes}    flow-capable-node-connector-queue-statistics/transmitted-bytes
23 ${transmittederrors}    flow-capable-node-connector-queue-statistics/transmission-errors
24 @{openflow_q0}
25 @{openflow_q2}
26 @{openflow_q1}
27
28 *** Test Cases ***
29
30 Verification of TSDR Cassandra Feature Installation
31     [Documentation]    Install and Verify the TSDR Cassandra Features
32     COMMENT    Install a Feature    odl-tsdr-cassandra-all    ${CONTROLLER}    ${KARAF_SHELL_PORT}    60
33     Verify Feature Is Installed    odl-tsdr-cassandra
34     COMMENT    Verify Feature Is Installed    odl-tsdr-cassandra-persistence
35     Verify Feature Is Installed    odl-tsdr-openflow-statistics-collector
36     Start Tsdr Suite
37     Configuration of Queue on Switch
38     Ping All Hosts
39     Wait Until Keyword Succeeds    5x    30 sec    Check Metric val     \\d{5}
40
41 Getting all Tables from Openflow Plugin
42     [Documentation]    Getting Queue Stats from openflow plugin
43     ${ret}=    Get Stats XML    ${query_head1}0/   ${transmittederrors}
44     Append To List    ${openflow_q0}    ${ret}
45     ${ret}=    Get Stats XML    ${query_head1}0/    ${transmittedpackets}
46     Append To List    ${openflow_q0}    ${ret}
47     ${ret}=    Get Stats XML    ${query_head1}0/    ${transmittedbytes}
48     Append To List    ${openflow_q0}    ${ret}
49
50     Set Suite Variable    @{openflow_q0}
51
52
53     ${ret}=    Get Stats XML    ${query_head1}1/   ${transmittederrors}
54     Append To List    ${openflow_q1}    ${ret}
55     ${ret}=    Get Stats XML    ${query_head1}1/    ${transmittedpackets}
56     Append To List    ${openflow_q1}    ${ret}
57     ${ret}=    Get Stats XML    ${query_head1}1/    ${transmittedbytes}
58     Append To List    ${openflow_q1}    ${ret}
59
60     Set Suite Variable    @{openflow_q1}
61
62
63     ${ret}=    Get Stats XML    ${query_head1}2/   ${transmittederrors}
64     Append To List    ${openflow_q2}    ${ret}
65     ${ret}=    Get Stats XML    ${query_head1}2/    ${transmittedpackets}
66     Append To List    ${openflow_q2}    ${ret}
67     ${ret}=    Get Stats XML    ${query_head1}2/    ${transmittedbytes}
68     Append To List    ${openflow_q2}    ${ret}
69
70     Set Suite Variable    @{openflow_q2}
71
72
73 Verification of FlowStats-Attributes on Cassandra Data Store
74     [Documentation]    Verify the InterfaceMetrics has been updated on Cassandra Data Store
75     Copy TSDR tables
76     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmissionErrors | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:0
77     Append To List    ${tsdr_q0}    ${ret_val1}
78     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedPackets | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:0
79     Append To List    ${tsdr_q0}    ${ret_val1}
80     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedBytes | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:0
81     Append To List    ${tsdr_q0}    ${ret_val1}
82
83
84
85     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmissionErrors | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:1
86     Append To List    ${tsdr_q1}    ${ret_val1}
87     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedPackets | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:1
88     Append To List    ${tsdr_q1}    ${ret_val1}
89     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedBytes | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:1
90
91
92
93
94     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmissionErrors | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:2
95     Append To List    ${tsdr_q2}    ${ret_val1}
96     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedPackets | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:2
97     Append To List    ${tsdr_q2}    ${ret_val1}
98     ${ret_val1}=    Verify the Metrics Attributes on Cassandra Client    grep NID=openflow:2 | grep DC=QUEUESTATS | grep MN=TransmittedBytes | grep RK=Node:openflow:2,NodeConnector:openflow:2:2,Queue:2
99     Append To List    ${tsdr_q2}    ${ret_val1}
100
101
102 Comparing Queue Metrics
103     [Documentation]    Comparing Queue metrics between Cassandra and OF plugin
104
105     : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_q0}    ${tsdr_q0}
106     \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
107
108     : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_q1}    ${tsdr_q1}
109     \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
110
111     : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_q2}    ${tsdr_q2}
112     \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
113
114
115
116 *** Keyword ***
117 Configuration of Queue on Switch
118     [Documentation]    Queue configuration on openvswitch
119     Configure the Queue on Switch    s2-eth2