Folks,

As stated in the first email in this patch series:

"
4) Applications must now inform the core that they have "taken ownership" of a 
Datapath object.
Previously, Datapaths could “leak” if they did not make it through the OpenFlow 
handshake. I have addressed this by adding a timer that disconnects any 
Datapath that is not claimed by an application after a certain interval 
(currently statically defined at 20 seconds - but it could be made 
user-configurable).
An application that wishes to ensure that Datapaths are properly cleaned up 
(and do not disappear out from under them) should:
i) Have a structure keeping track of what Datapaths it “owns."
ii) When handling the an EventOFPSwitchFeatures in the CONFIG_DISPATCHER, or 
any event in the MAIN_DISPATCHER, the application should ensure that the 
datapath has been tracked in its internal record-keeping structure, and set the 
“assured” field of the Datapath object to “True”.
iii) When the application discovers duplicate records for a given Datapath 
(during handling of a new Datapath having the same DPID) in its internal 
structure, it should call the close() method of the old Datapath, after first 
recording the new Datapath in its internal record-keeping structure.

Applications that do not set the “assured” field of a Datapath will find that 
the Datapath will be closed underneath them by the Ryu core.
Applications using ryu.controller.dpset or ryu.topology.switches will find that 
this has been automatically handled for them.
Furthermore, another of the patches in this series ensures that all sample 
applications have been patched.
“

This patch fixes the tests shipped with Ryu to follow these new semantics.

Signed-off-by: Victor J. Orlikowski <[email protected]>

diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py
index f678663..ccd4f27 100644
--- a/ryu/tests/switch/tester.py
+++ b/ryu/tests/switch/tester.py
@@ -355,7 +355,7 @@ class OfTester(app_manager.RyuApp):
 
     @set_ev_cls(ofp_event.EventOFPStateChange,
                 [handler.MAIN_DISPATCHER, handler.DEAD_DISPATCHER])
-    def dispacher_change(self, ev):
+    def dispatcher_change(self, ev):
         assert ev.datapath is not None
         if ev.state == handler.MAIN_DISPATCHER:
             self._register_sw(ev.datapath)
@@ -375,6 +375,7 @@ class OfTester(app_manager.RyuApp):
                     vers[OfTester.target_ver]
             else:
                 self.target_sw.dp = dp
+                dp.assured = True
                 msg = 'Join target SW.'
         elif dp.id == self.tester_dpid:
             if dp.ofproto.OFP_VERSION != OfTester.tester_ver:
@@ -382,6 +383,7 @@ class OfTester(app_manager.RyuApp):
                     vers[OfTester.tester_ver]
             else:
                 self.tester_sw.dp = dp
+                dp.assured = True
                 msg = 'Join tester SW.'
         else:
             msg = 'Connect unknown SW.'


Best,
Victor
--
Victor J. Orlikowski <> vjo@[cs.]duke.edu

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to