Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / lacp / Lacp_Feature_OF13 / 030__lacp_flow_entry_stats.robot
1 *** Settings ***
2 Documentation       Test suite to verify if the PDU count for the LACP flow entry is getting updated
3
4 Library             SSHLibrary
5 Library             Collections
6 Library             String
7 Library             RequestsLibrary
8 Library             ../../../libraries/Common.py
9 Resource            ../../../libraries/Utils.robot
10 Variables           ../../../variables/Variables.py
11
12 Suite Setup         LACP Inventory Suite Setup
13 Suite Teardown      Delete All Sessions
14
15
16 *** Variables ***
17 ${node1}    openflow:1
18
19
20 *** Test Cases ***
21 Verify Switch S1 LACP flow entry packet hit doesn't display zero value
22     [Documentation]    Verify the LACP flow entry packet hit stats doesn't display zero value on the Switch S1
23     ${result}=    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-ofctl dump-flows s1 -O OpenFlow13
24     Comment    ${result}    Read Until    mininet>
25     Should Not Contain    ${result}    n_packets=0
26     Should Not Contain    ${result}    n_bytes=0
27
28 Verify Switch S1 Port stats doesn't display zero value
29     [Documentation]    Verify the port stats for the Switch S1 doesn't display value with zero
30     #
31     ${result}=    Run Command On Remote System
32     ...    ${TOOLS_SYSTEM_IP}
33     ...    sudo ovs-ofctl dump-ports s1 -O OpenFlow13
34     ...    ${TOOLS_SYSTEM_USER}
35     Comment    ${result}    Read Until    mininet>
36     ${port1}=    Get Lines Containing String    ${result}    1:
37     Should Not Contain    ${port1}    rx pkts=0
38     Should Not Contain    ${port1}    bytes=0
39     ${port2}=    Get Lines Containing String    ${result}    2:
40     Should Not Contain    ${port2}    rx pkts=0
41     Should Not Contain    ${port2}    bytes=0
42     ${port3}=    Get Lines Containing String    ${result}    3:
43     Should Not Contain    ${port3}    rx pkts=0
44     Should Not Contain    ${port3}    bytes=0
45     ${port4}=    Get Lines Containing String    ${result}    4:
46     Should Not Contain    ${port4}    rx pkts=0
47     Should Not Contain    ${port4}    bytes=0
48
49
50 *** Keywords ***
51 Verify LACP RESTAPI Response Code for node
52     [Documentation]    Will check for the response code of the REST query
53     [Arguments]    ${resp}
54     Should Be Equal As Strings    ${resp.status_code}    200
55     Should Contain    ${resp.content}    ${node1}
56
57 Verify LACP RESTAPI Aggregator and Tag Contents
58     [Documentation]    Will check for the LACP Specific tags or Aggregator ID for node
59     [Arguments]    ${resp.content}    ${content-lookup}
60     Should Contain    ${resp.content}    ${content-lookup}
61
62 Verify LACP Tags Are Formed
63     [Documentation]    Fundamental Check That LACP is working
64     ${resp}=    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}
65     Verify LACP RESTAPI Response Code for node    ${resp}
66     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    non-lag-groupid
67     Verify LACP RESTAPI Aggregator and Tag Contents    ${resp.content}    lacp-aggregators
68
69 LACP Inventory Suite Setup
70     [Documentation]    If these basic checks fail, there is no need to continue any of the other test cases
71     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
72     Wait Until Keyword Succeeds    15s    1s    Verify LACP Tags Are Formed