2 Documentation Test suite for verifying Bundle based reconciliation with switch(OVS)
3 Suite Setup Start Suite
4 Suite Teardown End Suite
6 Library ${CURDIR}/../../../../csit/libraries/XmlComparator.py
7 Resource ../../../libraries/Utils.robot
8 Resource ../../../libraries/OVSDB.robot
9 Resource ../../../libraries/KarafKeywords.robot
10 Resource ../../../libraries/FlowLib.robot
11 Resource ../../../variables/Variables.robot
12 Resource ../../../variables/netvirt/Variables.robot
13 Resource ../../../libraries/DataModels.robot
16 ${XMLSDIR} ${CURDIR}/../../../../csit/variables/openflowplugin
17 @{FLOWFILE} f279.xml f280.xml f281.xml f282.xml f283.xml f284.xml f278.xml
18 @{GROUPFILE} g279.xml g280.xml g281.xml
20 ${FLAG_MSG} "bundle-based-reconciliation-enabled configuration property was changed to 'true'"
21 ${STATIC_FLOW} table=91
22 @{DATA_MODELS} config/opendaylight-inventory:nodes operational/opendaylight-inventory:nodes
25 TC01_Reconciliation check after switch restart
26 [Documentation] Verify the Bundle based reconciliation with switch(OVS) restart scenario
27 Push Static Flow ${TOOLS_SYSTEM_IP}
28 ${switch_idx} OVSDB.Get DPID ${TOOLS_SYSTEM_IP}
29 Push Flow Via Restcall ${switch_idx} ${FLOWFILE[6]}
30 Utils.Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo service openvswitch-switch restart
31 Wait Until Keyword Succeeds 5s 1s FlowLib.Check Operational Flow ${True} ${data}
32 Log Check if static flow is removed in the switch
33 ${Ovs1Flow} Utils.Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenflow13
34 Should Not Contain ${Ovs1Flow} ${STATIC_FLOW}
35 Log Check if flows are pushed as bundle messages
36 ${Resyncdone_msg}= BuiltIn.Set Variable "Completing bundle based reconciliation for device ID:${switch_idx}"
37 Check_Karaf_Log_Message_Count ${Resyncdone_msg} 1
39 TC02_Reconcilation check with new switch added
40 [Documentation] Verify the Bundle based reconciliation pushing a group dependent flow in the new switch added
41 Push Static Flow ${TOOLS_SYSTEM_2_IP}
42 ${switch_idx} OVSDB.Get DPID ${TOOLS_SYSTEM_2_IP}
43 Push Groups Via Restcall ${switch_idx} 0
44 Push Flow Via Restcall ${switch_idx} ${FLOWFILE[0]}
45 Utils.Run Command On Remote System ${TOOLS_SYSTEM_2_IP} sudo service openvswitch-switch restart
46 Wait Until Keyword Succeeds 5s 1s FlowLib.Check Operational Flow ${True} ${data}
47 Log Check if static flow is removed in the switch
48 ${Ovs1Flow} Utils.Run Command On Remote System ${TOOLS_SYSTEM_2_IP} sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenflow13
49 Should Not Contain ${Ovs1Flow} ${STATIC_FLOW}
50 Log Check if flows are pushed as bundle messages
51 ${Resyncdone_msg}= BuiltIn.Set Variable "Completing bundle based reconciliation for device ID:${switch_idx}"
52 Check_Karaf_Log_Message_Count ${Resyncdone_msg} 1
54 TC03_Reconciliation check by pushing group dependent flows
55 [Documentation] Verify the Bundle based reconciliation by pushing multiple group dependent flows
56 ${switch_idx} OVSDB.Get DPID ${TOOLS_SYSTEM_2_IP}
57 : FOR ${index} IN RANGE 1 3
58 \ Push Groups Via Restcall ${switch_idx} ${index}
59 : FOR ${index} IN RANGE 1 6
60 \ Push Flow Via Restcall ${switch_idx} ${FLOWFILE[${index}]}
61 \ Set Test Variable ${flowbody[${index}]} ${data}
62 Utils.Run Command On Remote System ${TOOLS_SYSTEM_2_IP} sudo service openvswitch-switch restart
63 : FOR ${index} IN RANGE 1 6
64 \ Wait Until Keyword Succeeds 5s 1s FlowLib.Check Operational Flow ${True} ${flowbody[${index}]}
65 Log Check if flows are pushed as bundle messages
66 ${Resyncdone_msg}= BuiltIn.Set Variable "Completing bundle based reconciliation for device ID:${switch_idx}"
67 Check_Karaf_Log_Message_Count ${Resyncdone_msg} 2
71 [Documentation] Run at start of the suite
72 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
73 KarafKeywords.Issue_Command_On_Karaf_Console log:set DEBUG org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeReconciliationImpl
74 Check_Karaf_Log_Message_Count ${FLAG_MSG} 1
75 Configure DPN ${TOOLS_SYSTEM_IP}
76 Configure DPN ${TOOLS_SYSTEM_2_IP}
79 [Documentation] Run at end of the suite
80 RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
81 KarafKeywords.Issue_Command_On_Karaf_Console log:set INFO org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeReconciliationImpl
82 SSHLibrary.Close All Connections
86 [Documentation] Add the bridge in the DPN specified and set manager,controller for the bridge
87 Utils.Run Command On Remote System ${ip} sudo ovs-vsctl add-br ${INTEGRATION_BRIDGE}
88 Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
89 Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set-controller ${INTEGRATION_BRIDGE} tcp:${ODL_SYSTEM_IP}:6653
90 Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set bridge ${INTEGRATION_BRIDGE} protocols=OpenFlow13
91 Wait Until Keyword Succeeds 20s 2s DataModels.Get Model Dump ${ODL_SYSTEM_IP} ${DATA_MODELS}
95 [Documentation] Add Static Flow in the DPN specified
96 Utils.Run Command On Remote System ${ip} sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenflow13
97 Utils.Run Command On Remote System ${ip} sudo ovs-ofctl add-flow ${INTEGRATION_BRIDGE} table=91,ipv6,actions=dec_ttl -OOpenflow13
99 Push Flow Via Restcall
100 [Arguments] ${switch_idx} ${flowfile}
101 [Documentation] Adds Flow to the specified DPN via Restcall
102 FlowLib.Create Flow Variables For Suite From XML File ${XMLSDIR}/${flowfile}
103 FlowLib.Add Flow Via Restconf ${switch_idx} ${table_id} ${data}
104 BuiltIn.Set Test Variable ${switch_idx}
105 FlowLib.Check Config Flow ${True} ${data}
106 Wait Until Keyword Succeeds 5s 1s FlowLib.Check Operational Flow ${True} ${data}
108 Push Groups Via Restcall
109 [Arguments] ${switch_idx} ${index}
110 ${GROUP_BODY} OperatingSystem.Get File ${XMLSDIR}/${GROUPFILE[${index}]}
111 ${node_id} BuiltIn.Set Variable openflow:${switch_idx}
112 ${group_id} BuiltIn.Set Variable ${GROUP_ID[${index}]}
113 FlowLib.Add Group To Controller And Verify ${GROUP_BODY} ${node_id} ${group_id}
114 Wait Until Keyword Succeeds 5s 1s Utils.Get URI And Verify ${OPERATIONAL_NODES_API}/node/${node_id}/group/${group_id}