Remove remnants of sfc project
[integration/test.git] / csit / suites / tsdr / Elasticsearch / 030_FlowTableMetrics.robot
1 *** Settings ***
2 Documentation       Test suite for ElasticSearch DataStore PortStats Verification
3
4 Library             SSHLibrary
5 Library             Collections
6 Library             String
7 Library             RequestsLibrary
8 Library             ../../../libraries/Common.py
9 Resource            ../../../libraries/KarafKeywords.robot
10 Resource            ../../../libraries/TsdrUtils.robot
11 Resource            ../../../variables/Variables.robot
12
13 Suite Teardown      Stop Tsdr Suite
14
15
16 *** Variables ***
17 @{tsdr_pl}
18 @{tsdr_af}
19 @{tsdr_pm}
20 ${packetlookup}                 flow-table-statistics/packets-looked-up
21 ${activeflows}                  flow-table-statistics/active-flows
22 ${packetmatched}                flow-table-statistics/packets-matched
23 @{openflow_packetlookup}
24 @{openflow_activeflows}
25 @{openflow_packetmatched}
26
27
28 *** Test Cases ***
29 Verification of TSDR ElasticSearch Feature Installation
30     [Documentation]    Install and Verify the Elastic Search Features
31     COMMENT    Install a Feature    odl-tsdr-elasticsearch    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
32     Install a Feature    odl-tsdr-elasticsearch    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    60
33     Install a Feature    odl-tsdr-openflow-statistics-collector    ${ODL_SYSTEM_IP}    ${KARAF_SHELL_PORT}    260
34     COMMENT    Wait Until Keyword Succeeds    24x    10 sec    Check Karaf Log Has Messages    tsdr.openflow
35     Verify Feature Is Installed    odl-tsdr-elasticsearch
36     Verify Feature Is Installed    odl-tsdr-openflow-statistics-collector
37     Start Tsdr Suite
38     Ping All Hosts
39     Clear Elasticsearch Datastore
40     Wait Until Keyword Succeeds    30x    1 sec    Check Available values from Elasticsearch    FLOWTABLESTATS    4571
41
42 Comparing Flow Table Metrics
43     [Documentation]    Comparing Flow table values between Elasticsearch and openflow plugin.
44     Getting all Tables from Openflow Plugin
45     Getting all Tables from ElasticSearch datastore
46     Should Be Equal As Strings    ${tsdr_pl}    ${openflow_packetlookup}
47     Should Be Equal As Strings    ${tsdr_af}    ${openflow_activeflows}
48     Should Be Equal As Strings    ${tsdr_pm}    ${openflow_packetmatched}
49
50
51 *** Keywords ***
52 Getting all Tables from Openflow Plugin
53     [Documentation]    Getting Flow Table Stats Values from Openflow plugin
54     ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/    ${packetlookup}
55     Append To List    ${openflow_packetlookup}    ${ret}
56     ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/table/0/    ${packetlookup}
57     Append To List    ${openflow_packetlookup}    ${ret}
58     ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:3/table/0/    ${packetlookup}
59     Append To List    ${openflow_packetlookup}    ${ret}
60     Set Suite Variable    @{openflow_packetlookup}
61     ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/    ${activeflows}
62     Append To List    ${openflow_activeflows}    ${ret}
63     ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/table/0/    ${activeflows}
64     Append To List    ${openflow_activeflows}    ${ret}
65     ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:3/table/0/    ${activeflows}
66     Append To List    ${openflow_activeflows}    ${ret}
67     Set Suite Variable    @{openflow_activeflows}
68     ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/    ${packetmatched}
69     Append To List    ${openflow_packetmatched}    ${ret}
70     ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:2/table/0/    ${packetmatched}
71     Append To List    ${openflow_packetmatched}    ${ret}
72     ${ret}=    Get Stats XML    ${OPERATIONAL_NODES_API}/node/openflow:3/table/0/    ${packetmatched}
73     Append To List    ${openflow_packetmatched}    ${ret}
74     Set Suite Variable    @{openflow_packetmatched}
75
76 Getting all Tables from ElasticSearch datastore
77     [Documentation]    Getting Flow Table Stats Values from ELK plugin
78     ${ret}=    Retrieve Value From Elasticsearch    FLOWTABLESTATS    PacketLookup    openflow:1    openflow:1
79     Append To List    ${tsdr_pl}    ${ret}
80     ${ret}=    Retrieve Value From Elasticsearch    FLOWTABLESTATS    PacketLookup    openflow:2    openflow:2
81     Append To List    ${tsdr_pl}    ${ret}
82     ${ret}=    Retrieve Value From Elasticsearch    FLOWTABLESTATS    PacketLookup    openflow:3    openflow:3
83     Append To List    ${tsdr_pl}    ${ret}
84     Set Suite Variable    @{tsdr_pl}
85     ${ret}=    Retrieve Value From Elasticsearch    FLOWTABLESTATS    ActiveFlows    openflow:1    openflow:1
86     Append To List    ${tsdr_af}    ${ret}
87     ${ret}=    Retrieve Value From Elasticsearch    FLOWTABLESTATS    ActiveFlows    openflow:2    openflow:2
88     Append To List    ${tsdr_af}    ${ret}
89     ${ret}=    Retrieve Value From Elasticsearch    FLOWTABLESTATS    ActiveFlows    openflow:3    openflow:3
90     Append To List    ${tsdr_af}    ${ret}
91     Set Suite Variable    @{tsdr_af}
92     ${ret}=    Retrieve Value From Elasticsearch    FLOWTABLESTATS    PacketMatch    openflow:1    openflow:1
93     Append To List    ${tsdr_pm}    ${ret}
94     ${ret}=    Retrieve Value From Elasticsearch    FLOWTABLESTATS    PacketMatch    openflow:2    openflow:2
95     Append To List    ${tsdr_pm}    ${ret}
96     ${ret}=    Retrieve Value From Elasticsearch    FLOWTABLESTATS    PacketMatch    openflow:3    openflow:3
97     Append To List    ${tsdr_pm}    ${ret}
98     Set Suite Variable    @{tsdr_pm}