Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / openflowplugin / Bug_Validation / 7335.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}        f163.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 Update Flow With Invalid Match And Check It Is Not In Operational DS
39     [Documentation]    Update flow removing Ethertype, this should remove flow from switch and operational DS
40     FlowLib.Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile2}
41     FlowLib.Update Flow Via Restconf    ${switch_idx}    ${table_id}    ${flow_id}    ${data}
42     FlowLib.Check Config Flow    ${True}    ${data}
43     BuiltIn.Wait Until Keyword Succeeds
44     ...    10s
45     ...    1s
46     ...    Utils.No Content From URI
47     ...    session
48     ...    ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=nonconfig
49     [Teardown]    Report_Failure_Due_To_Bug    7335
50
51
52 *** Keywords ***
53 Initialization Phase
54     [Documentation]    Starts mininet and verify if topology is in operational datastore.
55     ${mininet_conn_id}=    MininetKeywords.Start Mininet Single Controller
56     BuiltIn.Set Suite Variable    ${mininet_conn_id}
57     RequestsLibrary.Create Session
58     ...    session
59     ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
60     ...    auth=${AUTH}
61     ...    headers=${HEADERS_XML}
62     BuiltIn.Wait Until Keyword Succeeds    10s    1s    FlowLib.Check Switches In Topology    1
63
64 Final Phase
65     [Documentation]    Stops mininet.
66     BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.DELETE On Session    session    url=${RFC8040_NODES_API}
67     MininetKeywords.Stop Mininet And Exit    ${mininet_conn_id}
68     RequestsLibrary.Delete All Sessions