Upgrade RF syntax for v3.2 compatibility
[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     END
23     [Teardown]    Report_Failure_Due_To_Bug    6917
24
25 Add Multiple Flows
26     [Documentation]    Iterate on add and delete flow until alien ID is found in Operational Datastore.
27     Run Keyword And Continue On Failure    Add Flow    f20.xml
28     Run Keyword And Continue On Failure    Add Flow    f21.xml
29     Run Keyword And Continue On Failure    Add Flow    f22.xml
30     Run Keyword And Continue On Failure    Add Flow    f23.xml
31     [Teardown]    Report_Failure_Due_To_Bug    6917
32
33 *** Keywords ***
34 Initialization Phase
35     [Documentation]    Starts mininet and verify if topology is in operational datastore.
36     ${mininet_conn_id}=    MininetKeywords.Start Mininet Single Controller
37     BuiltIn.Set Suite Variable    ${mininet_conn_id}
38     RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
39     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Switches In Topology    1
40
41 Final Phase
42     [Documentation]    Stops mininet.
43     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
44     RequestsLibrary.Delete All Sessions
45
46 Add And Delete Flow
47     [Arguments]    ${flowfile}
48     [Documentation]    Add a Delete a Flow and verify presence in Datastore. The 5 sec sleep is required to reproduce the bug.
49     FlowLib.Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
50     FlowLib.Add Flow Via Restconf    ${switch_idx}    ${table_id}    ${data}
51     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Operational Flow    ${True}    ${data}
52     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Datastore Presence    ${flowfile}    ${True}    ${True}
53     ...    ${False}    ${True}
54     FlowLib.Delete Flow Via Restconf    ${switch_idx}    ${table_id}    ${flow_id}
55     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Operational Flow    ${False}    ${data}
56     FlowLib.Check Datastore Presence    ${flowfile}    ${False}    ${False}    ${True}
57     Sleep    5
58     [Teardown]    BuiltIn.Run Keyword And Ignore Error    FlowLib.Delete Flow Via Restconf    ${switch_idx}    ${table_id}    ${flow_id}
59
60 Add Flow
61     [Arguments]    ${flowfile}
62     [Documentation]    Add a Delete a Flow and verify presence in Datastore. The 5 sec sleep is required to reproduce the bug.
63     FlowLib.Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
64     FlowLib.Add Flow Via Restconf    ${switch_idx}    ${table_id}    ${data}
65     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Operational Flow    ${True}    ${data}
66     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Datastore Presence    ${flowfile}    ${True}    ${True}
67     ...    ${False}    ${True}
68     Sleep    8
69     [Teardown]    BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}