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