Correctly space expected_status
[integration/test.git] / csit / suites / openflowplugin / Bug_Validation / 7349.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 ${flowfile1}        f162.xml
18 ${flowfile2}        f164.xml
19 ${switch_idx}       1
20 ${switch_name}      s${switch_idx}
21
22
23 *** Test Cases ***
24 Add Flow And Check It Is In Operational DS
25     [Documentation]    Add flow match IP and Ethertype IP
26     FlowLib.Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile1}
27     FlowLib.Add Flow Via Restconf    ${switch_idx}    ${table_id}    ${data}
28     BuiltIn.Wait Until Keyword Succeeds
29     ...    10s
30     ...    1s
31     ...    FlowLib.Check Datastore Presence
32     ...    ${flowfile1}
33     ...    ${True}
34     ...    ${True}
35     ...    ${False}
36     ...    ${True}
37
38 Delete and Add Flow Same Match With Different ID
39     [Documentation]    Delete flow and add flow with same body and different ID. New ID should be shown in operational.
40     FlowLib.Delete Flow Via Restconf    ${switch_idx}    ${table_id}    ${flow_id}
41     FlowLib.Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile2}
42     FlowLib.Add Flow Via Restconf    ${switch_idx}    ${table_id}    ${data}
43     BuiltIn.Wait Until Keyword Succeeds
44     ...    10s
45     ...    1s
46     ...    FlowLib.Check Datastore Presence
47     ...    ${flowfile2}
48     ...    ${True}
49     ...    ${True}
50     ...    ${False}
51     ...    ${True}
52     [Teardown]    Report_Failure_Due_To_Bug    7349
53
54
55 *** Keywords ***
56 Initialization Phase
57     [Documentation]    Starts mininet and verify if topology is in operational datastore.
58     ${mininet_conn_id}=    MininetKeywords.Start Mininet Single Controller
59     BuiltIn.Set Suite Variable    ${mininet_conn_id}
60     RequestsLibrary.Create Session
61     ...    session
62     ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
63     ...    auth=${AUTH}
64     ...    headers=${HEADERS_XML}
65     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Switches In Topology    1
66
67 Final Phase
68     [Documentation]    Stops mininet.
69     BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${RFC8040_NODES_API}
70     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
71     RequestsLibrary.Delete All Sessions