Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
 ryu/tests/unit/lib/test_ofp_pktinfilter.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/ryu/tests/unit/lib/test_ofp_pktinfilter.py 
b/ryu/tests/unit/lib/test_ofp_pktinfilter.py
index 61199f7..cd8e2f8 100644
--- a/ryu/tests/unit/lib/test_ofp_pktinfilter.py
+++ b/ryu/tests/unit/lib/test_ofp_pktinfilter.py
@@ -29,16 +29,12 @@ from ryu.lib.packet import vlan, ethernet, ipv4
 from ryu.lib.ofp_pktinfilter import packet_in_filter, RequiredTypeFilter
 from ryu.lib import mac
 from ryu.ofproto import ether, ofproto_v1_3, ofproto_v1_3_parser
+from ryu.ofproto.ofproto_protocol import ProtocolDesc
 
 
 LOG = logging.getLogger('test_pktinfilter')
 
 
-class _Datapath(object):
-    ofproto = ofproto_v1_3
-    ofproto_parser = ofproto_v1_3_parser
-
-
 class _PacketInFilterApp(object):
     @set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
     @packet_in_filter(RequiredTypeFilter, {'types': [
@@ -60,7 +56,7 @@ class Test_packet_in_filter(unittest.TestCase):
         pass
 
     def test_pkt_in_filter_pass(self):
-        datapath = _Datapath()
+        datapath = ProtocolDesc(version=ofproto_v1_3.OFP_VERSION)
         e = ethernet.ethernet(mac.BROADCAST_STR,
                               mac.BROADCAST_STR,
                               ether.ETH_TYPE_8021Q)
@@ -74,7 +70,7 @@ class Test_packet_in_filter(unittest.TestCase):
         ok_(self.app.packet_in_handler(ev))
 
     def test_pkt_in_filter_discard(self):
-        datapath = _Datapath()
+        datapath = ProtocolDesc(version=ofproto_v1_3.OFP_VERSION)
         e = ethernet.ethernet(mac.BROADCAST_STR,
                               mac.BROADCAST_STR,
                               ether.ETH_TYPE_IP)
@@ -87,7 +83,7 @@ class Test_packet_in_filter(unittest.TestCase):
         ok_(not self.app.packet_in_handler(ev))
 
     def test_pkt_in_filter_truncated(self):
-        datapath = _Datapath()
+        datapath = ProtocolDesc(version=ofproto_v1_3.OFP_VERSION)
         truncated_data = buffer('')
         pkt_in = ofproto_v1_3_parser.OFPPacketIn(datapath,
                                                  data=truncated_data)
-- 
1.8.3.1


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to