Hi,
I'm sorry for the delayed response.
On 2015年03月25日 15:20, Hiroshi Sakoda wrote:
> 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, {})
Two of the above variables are defined in the subclass.
https://github.com/osrg/ryu/blob/master/ryu/lib/packet/bpdu.py#L246-L247
Please define by using the subclasses as follows.
"ingress":[
...
"ConfigurationBPDUs(...)"
...
],
thanks
>
> ------------------------------------------------------------------------------
> 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
>
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel