Hi

I made test scenario using BPDU.
But I got the following error log.

----------------------------------------------------------------

hub: uncaught exception: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line
52, in _launch
    func(*args, **kwargs)
  File "/root/ryu-master/ryu/tests/switch/tester.py", line 413, in
_test_sequential_execute
    tests = TestPatterns(test_dir, self.logger)
  File "/root/ryu-master/ryu/tests/switch/tester.py", line 1272, in __init__
    self._get_tests(test_dir)
  File "/root/ryu-master/ryu/tests/switch/tester.py", line 1289, in _get_tests
    test = TestFile(path, self.logger)
  File "/root/ryu-master/ryu/tests/switch/tester.py", line 1300, in __init__
    self._get_tests(path)
  File "/root/ryu-master/ryu/tests/switch/tester.py", line 1333, in _get_tests
    self.tests.append(Test(test_json))
  File "/root/ryu-master/ryu/tests/switch/tester.py", line 1345, in __init__
    self.tests) = self._parse_test(test_json)
  File "/root/ryu-master/ryu/tests/switch/tester.py", line 1455, in _parse_test
    test_pkt[KEY_INGRESS] = __test_pkt_from_json(test[KEY_INGRESS])
  File "/root/ryu-master/ryu/tests/switch/tester.py", line 1349, in
__test_pkt_from_json
    data = eval('/'.join(test))
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/bpdu.py",
line 181, in __init__
    assert hasattr(self, 'VERSION_ID')
AssertionError

----------------------------------------------------------------

So, I modified bpdu.py

$ git diff
diff --git a/ryu/lib/packet/bpdu.py b/ryu/lib/packet/bpdu.py
index 8926b2a..1c397c4 100644
--- a/ryu/lib/packet/bpdu.py
+++ b/ryu/lib/packet/bpdu.py
@@ -169,6 +169,9 @@ class bpdu(packet_base.PacketBase):

     _MIN_LEN = _PACK_LEN

+    VERSION_ID = PROTOCOLVERSION_ID_BPDU
+    BPDU_TYPE = TYPE_CONFIG_BPDU
+
     @staticmethod
     def register_bpdu_type(sub_cls):
         bpdu._BPDU_TYPES.setdefault(sub_cls.VERSION_ID, {})

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to