From 2674a272f257c5f8c1cbf1ec997908b156c69256 Mon Sep 17 00:00:00 2001 From: Minoru TAKAHASHI Date: Thu, 25 Sep 2014 13:39:37 +0900 Subject: sw test tool: fix an error caused by changing enum name in of1.4 In of1.4 spec, enum name has been changed as follows: of1.3.4 spec: OFPR_NO_MATCH = 0, / * No matching flow (table-miss flow entry). * / of1.4 spec: OFPR_TABLE_MISS = 0, / * No matching flow (table-miss flow entry). * / Along with this change, AttributeError has occurred in the process of comparison of the received message. This patch fixes this problem. Signed-off-by: Minoru TAKAHASHI Signed-off-by: FUJITA Tomonori --- ryu/tests/switch/tester.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py index 1f14b89d..82120f8f 100644 --- a/ryu/tests/switch/tester.py +++ b/ryu/tests/switch/tester.py @@ -706,10 +706,15 @@ class OfTester(app_manager.RyuApp): model_pkt = (pkt[KEY_EGRESS] if KEY_EGRESS in pkt else pkt[KEY_PKT_IN]) + if hasattr(msg.datapath.ofproto, "OFPR_NO_MATCH"): + table_miss_value = msg.datapath.ofproto.OFPR_NO_MATCH + else: + table_miss_value = msg.datapath.ofproto.OFPR_TABLE_MISS + if msg.datapath.id != pkt_in_src_model.dp.id: pkt_type = 'packet-in' err_msg = 'SW[dpid=%s]' % dpid_lib.dpid_to_str(msg.datapath.id) - elif msg.reason == msg.datapath.ofproto.OFPR_NO_MATCH or \ + elif msg.reason == table_miss_value or \ msg.reason == msg.datapath.ofproto.OFPR_INVALID_TTL: pkt_type = 'packet-in' err_msg = 'OFPPacketIn[reason=%d]' % msg.reason -- cgit v1.2.3