diff options
author | Minoru TAKAHASHI <takahashi.minoru7@gmail.com> | 2014-09-25 13:39:37 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-09-27 18:28:20 +0900 |
commit | 2674a272f257c5f8c1cbf1ec997908b156c69256 (patch) | |
tree | 111e163722ccf2e1bffe0bc4c58a3a1b05cb0168 | |
parent | 52393362069735aaaf5e51302420d5eec8210eb5 (diff) |
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 <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/tests/switch/tester.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 |