2 Documentation Test suite for bug 6917 validation.
3 Suite Setup Initialization Phase
4 Suite Teardown Final Phase
6 Library RequestsLibrary
7 Resource ../../../libraries/MininetKeywords.robot
8 Resource ../../../libraries/FlowLib.robot
9 Variables ../../../variables/Variables.py
12 ${XmlsDir} ${CURDIR}/../../../variables/xmls
15 ${switch_name} s${switch_idx}
20 [Documentation] Iterate on add and delete flow until alien ID is found in Operational Datastore.
21 : FOR ${i} IN RANGE ${iteration}
23 [Teardown] Report_Failure_Due_To_Bug 6917
27 [Documentation] Starts mininet and verify if topology is in operational datastore.
28 ${mininet_conn_id}= MininetKeywords.Start Mininet Single Controller
29 BuiltIn.Set Suite Variable ${mininet_conn_id}
30 RequestsLibrary.Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
31 BuiltIn.Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
34 [Documentation] Stops mininet.
35 MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
36 RequestsLibrary.Delete All Sessions
38 Are Switches Connected Topo
39 [Documentation] Checks wheather switches are connected to controller
40 ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
42 ${count}= XML.Get Element Count ${resp.content} xpath=node
43 BuiltIn.Should Be Equal As Numbers ${count} 1
46 [Documentation] Add a Delete a Flow and verify presence in Datastore. The 5 sec sleep is required to reproduce the bug.
48 FlowLib.Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile}
49 FlowLib.Add Flow Via Restconf ${switch_idx} ${table_id} ${data}
50 BuiltIn.Wait Until Keyword Succeeds 10s 1s FlowLib.Check Operational Flow ${True} ${data}
51 FlowLib.Check Datastore Presence ${flowfile} ${True} ${True} ${False} ${True}
52 FlowLib.Delete Flow Via Restconf ${switch_idx} ${table_id} ${flow_id}
53 BuiltIn.Wait Until Keyword Succeeds 10s 1s FlowLib.Check Operational Flow ${False} ${data}
54 FlowLib.Check Datastore Presence ${flowfile} ${False} ${False} ${True}
55 [Teardown] BuiltIn.Run Keyword And Ignore Error FlowLib.Delete Flow Via Restconf ${switch_idx} ${table_id} ${flow_id}