I believe that it makes sense to treat a missing mask
as not being an all-zero bit mask.

The motivation for this change is to resolve the following problem
that I observed when running Open vSwtich's make check-ryu target.

--- Running ryu/tests/integrated/test_add_flow_v12_matches.py...

loading app ryu/tests/integrated/test_add_flow_v12_matches.py
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
instantiating app None of DPSet
creating context dpset
instantiating app ryu.controller.ofp_handler of OFPHandler
instantiating app ryu/tests/integrated/test_add_flow_v12_matches.py of RunTest
TEST_START: test_rule_set_arp_opcode
TEST_START: test_rule_set_arp_sha
hub: uncaught exception: Traceback (most recent call last):
  File "/home/horms/projects/ryu/ryu/ryu/lib/hub.py", line 48, in _launch
    func(*args, **kwargs)
  File "/home/horms/projects/ryu/ryu/ryu/base/app_manager.py", line 198, in 
_event_loop
    handler(ev)
  File "/home/horms/projects/ryu/ryu/ryu/tests/integrated/tester.py", line 149, 
in stats_reply_handler
    self.run_verify(ev)
  File "/home/horms/projects/ryu/ryu/ryu/tests/integrated/tester.py", line 160, 
in run_verify
    result = verify_func(dp, msg.body)
  File 
"/home/horms/projects/ryu/ryu/ryu/tests/integrated/test_add_flow_v12_matches.py",
 line 71, in verify_default
    if self._is_all_zero_bit(type_, mask):
  File 
"/home/horms/projects/ryu/ryu/ryu/tests/integrated/test_add_flow_v12_matches.py",
 line 107, in _is_all_zero_bit
    for v in val:
TypeError: 'NoneType' object is not iterable

Signed-off-by: Simon Horman <[email protected]>
---
 ryu/tests/integrated/test_add_flow_v12_matches.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ryu/tests/integrated/test_add_flow_v12_matches.py 
b/ryu/tests/integrated/test_add_flow_v12_matches.py
index 507a1a4..92ce1a4 100644
--- a/ryu/tests/integrated/test_add_flow_v12_matches.py
+++ b/ryu/tests/integrated/test_add_flow_v12_matches.py
@@ -101,6 +101,8 @@ class RunTest(tester.TestFlowBase):
         return v
 
     def _is_all_zero_bit(self, type_, val):
+        if val is None:
+             return False
         if type_ == 'int' or type_ == 'ipv4':
             return val == 0
         elif type_ == 'mac':
-- 
1.8.5.2


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to