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