On 2016/07/01 11:36, FUJITA Tomonori wrote: > On Wed, 29 Jun 2016 00:26:42 -0700 > "Kawai, Hiroaki" <[email protected]> wrote: > >> Some system will use padded paackets for ethernet frame that is at >> least 64 bytes long. > > This patch means that the tester sends an ethernet frame that is less > than 64B?
I tested again and confirmed that the tester was sending 60B frame with padding. The problem was that len(model_pkt) == 54 in ryu/tests/switch/of13/match/19_ICMPV4_TYPE.json for example, and the test is failing. # Without padding, the two packets were identical. >> Signed-off-by: Kawai, Hiroaki <[email protected]> >> --- >> ryu/tests/switch/tester.py | 16 ++++++++++------ >> 1 file changed, 10 insertions(+), 6 deletions(-) >> >> diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py >> index 22238b8..4191d0d 100644 >> --- a/ryu/tests/switch/tester.py >> +++ b/ryu/tests/switch/tester.py >> @@ -741,8 +741,16 @@ class OfTester(app_manager.RyuApp): >> err_msg = 'OFPPacketIn[reason=%d]' % msg.reason >> elif repr(msg.data) != repr(model_pkt): >> pkt_type = 'packet' >> - err_msg = self._diff_packets(packet.Packet(model_pkt), >> + diff = self._diff_packets(packet.Packet(model_pkt), >> packet.Packet(msg.data)) >> + if diff: >> + err_msg = diff >> + elif len(msg.data) < 64 and msg.data.startswith(model_pkt): >> + # Padding might be present because of ethernet frame size >> (64 bytes~). >> + return TEST_OK >> + else: >> + err_msg = ('Encounter an error during packet comparison.' >> + ' it is malformed.') >> else: >> return TEST_OK >> >> @@ -977,11 +985,7 @@ class OfTester(app_manager.RyuApp): >> break >> if model_p != rcv_p: >> msg.append('str(%s)' % repr(rcv_p)) >> - if msg: >> - return '/'.join(msg) >> - else: >> - return ('Encounter an error during packet comparison.' >> - ' it is malformed.') >> + return '/'.join(msg) >> >> def _test_get_throughput(self): >> xid = self.tester_sw.send_flow_stats() >> -- >> 2.7.4 >> >> >> ------------------------------------------------------------------------------ >> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San >> Francisco, CA to explore cutting-edge tech and listen to tech luminaries >> present their vision of the future. This family event has something for >> everyone, including kids. Get more information and register today. >> http://sdm.link/attshape >> _______________________________________________ >> Ryu-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/ryu-devel > > ------------------------------------------------------------------------------ > Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San > Francisco, CA to explore cutting-edge tech and listen to tech luminaries > present their vision of the future. This family event has something for > everyone, including kids. Get more information and register today. > http://sdm.link/attshape > _______________________________________________ > Ryu-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/ryu-devel > ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
