Added Scripts for Openflow Validation in Cassandra DB
[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 path    24\\d+|25\\d+|26\\d+|27\\d+
40     Wait Until Keyword Succeeds    5x    30 sec    Check Metric val     \\d{5}
41
42 Getting all Tables from Openflow Plugin
43     [Documentation]    Getting Queue Stats from openflow plugin
44     ${ret}=    Get Stats XML    ${query_head1}0/   ${transmittederrors}
45     Append To List    ${openflow_q0}    ${ret}
46     ${ret}=    Get Stats XML    ${query_head1}0/    ${transmittedpackets}
47     Append To List    ${openflow_q0}    ${ret}
48     ${ret}=    Get Stats XML    ${query_head1}0/    ${transmittedbytes}
49     Append To List    ${openflow_q0}    ${ret}
50
51     Set Suite Variable    @{openflow_q0}
52
53
54     ${ret}=    Get Stats XML    ${query_head1}1/   ${transmittederrors}
55     Append To List    ${openflow_q1}    ${ret}
56     ${ret}=    Get Stats XML    ${query_head1}1/    ${transmittedpackets}
57     Append To List    ${openflow_q1}    ${ret}
58     ${ret}=    Get Stats XML    ${query_head1}1/    ${transmittedbytes}
59     Append To List    ${openflow_q1}    ${ret}
60
61     Set Suite Variable    @{openflow_q1}
62
63
64     ${ret}=    Get Stats XML    ${query_head1}2/   ${transmittederrors}
65     Append To List    ${openflow_q2}    ${ret}
66     ${ret}=    Get Stats XML    ${query_head1}2/    ${transmittedpackets}
67     Append To List    ${openflow_q2}    ${ret}
68     ${ret}=    Get Stats XML    ${query_head1}2/    ${transmittedbytes}
69     Append To List    ${openflow_q2}    ${ret}
70
71     Set Suite Variable    @{openflow_q2}
72
73
74 Verification of FlowStats-Attributes on Cassandra Data Store
75     [Documentation]    Verify the InterfaceMetrics has been updated on Cassandra Data Store
76     Copy TSDR tables
77     ${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
78     Append To List    ${tsdr_q0}    ${ret_val1}
79     ${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
80     Append To List    ${tsdr_q0}    ${ret_val1}
81     ${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
82     Append To List    ${tsdr_q0}    ${ret_val1}
83
84
85
86     ${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
87     Append To List    ${tsdr_q1}    ${ret_val1}
88     ${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
89     Append To List    ${tsdr_q1}    ${ret_val1}
90     ${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
91
92
93
94
95     ${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
96     Append To List    ${tsdr_q2}    ${ret_val1}
97     ${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
98     Append To List    ${tsdr_q2}    ${ret_val1}
99     ${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
100     Append To List    ${tsdr_q2}    ${ret_val1}
101
102
103 Comparing Queue Metrics
104     [Documentation]    Comparing Queue metrics between Cassandra and OF plugin
105
106     : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_q0}    ${tsdr_q0}
107     \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
108
109     : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_q1}    ${tsdr_q1}
110     \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
111
112     : FOR    ${xml_val}    ${tsdr_val}    IN ZIP    ${openflow_q2}    ${tsdr_q2}
113     \    Compare Tsdr XML Metrics    ${xml_val}    ${tsdr_val}    20
114
115
116
117 *** Keyword ***
118 Configuration of Queue on Switch
119     [Documentation]    Queue configuration on openvswitch
120     Configure the Queue on Switch    s2-eth2