Move bgp global api to BgpOperations library
[integration/test.git] / csit / suites / openflowplugin / Bug_Validation / 6917.robot
1 *** Settings ***
2 Documentation     Test suite for bug 6917 validation.
3 Suite Setup       Initialization Phase
4 Suite Teardown    Final Phase
5 Library           XML
6 Library           RequestsLibrary
7 Resource          ../../../libraries/MininetKeywords.robot
8 Resource          ../../../libraries/FlowLib.robot
9 Resource          ../../../variables/Variables.robot
10
11 *** Variables ***
12 ${XmlsDir}        ${CURDIR}/../../../variables/xmls
13 ${switch_idx}     1
14 ${switch_name}    s${switch_idx}
15 ${iteration}      4
16
17 *** Test Cases ***
18 Add Delete Same Flow
19     [Documentation]    Iterate on add and delete flow until alien ID is found in Operational Datastore.
20     : FOR    ${i}    IN RANGE    ${iteration}
21     \    Run Keyword And Continue On Failure    Add And Delete Flow    f21.xml
22     [Teardown]    Report_Failure_Due_To_Bug    6917
23
24 Add Multiple Flows
25     [Documentation]    Iterate on add and delete flow until alien ID is found in Operational Datastore.
26     Run Keyword And Continue On Failure    Add Flow    f20.xml
27     Run Keyword And Continue On Failure    Add Flow    f21.xml
28     Run Keyword And Continue On Failure    Add Flow    f22.xml
29     Run Keyword And Continue On Failure    Add Flow    f23.xml
30     [Teardown]    Report_Failure_Due_To_Bug    6917
31
32 *** Keywords ***
33 Initialization Phase
34     [Documentation]    Starts mininet and verify if topology is in operational datastore.
35     ${mininet_conn_id}=    MininetKeywords.Start Mininet Single Controller
36     BuiltIn.Set Suite Variable    ${mininet_conn_id}
37     RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
38     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Switches In Topology    1
39
40 Final Phase
41     [Documentation]    Stops mininet.
42     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
43     RequestsLibrary.Delete All Sessions
44
45 Add And Delete Flow
46     [Arguments]    ${flowfile}
47     [Documentation]    Add a Delete a Flow and verify presence in Datastore. The 5 sec sleep is required to reproduce the bug.
48     FlowLib.Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
49     FlowLib.Add Flow Via Restconf    ${switch_idx}    ${table_id}    ${data}
50     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Operational Flow    ${True}    ${data}
51     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Datastore Presence    ${flowfile}    ${True}    ${True}
52     ...    ${False}    ${True}
53     FlowLib.Delete Flow Via Restconf    ${switch_idx}    ${table_id}    ${flow_id}
54     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Operational Flow    ${False}    ${data}
55     FlowLib.Check Datastore Presence    ${flowfile}    ${False}    ${False}    ${True}
56     Sleep    5
57     [Teardown]    BuiltIn.Run Keyword And Ignore Error    FlowLib.Delete Flow Via Restconf    ${switch_idx}    ${table_id}    ${flow_id}
58
59 Add Flow
60     [Arguments]    ${flowfile}
61     [Documentation]    Add a Delete a Flow and verify presence in Datastore. The 5 sec sleep is required to reproduce the bug.
62     FlowLib.Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
63     FlowLib.Add Flow Via Restconf    ${switch_idx}    ${table_id}    ${data}
64     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Operational Flow    ${True}    ${data}
65     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Datastore Presence    ${flowfile}    ${True}    ${True}
66     ...    ${False}    ${True}
67     Sleep    8
68     [Teardown]    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}