some switches return the instruction list of flow_mod messages in the different
order.
for example, when a flow entry was installed with the instructions as:
[
OFPInstructionMeter(meter_id=1),
OFPInstructionActions(actions=[OFPActionOutput(port=2)])
]
the flow_stats message may return the flow entry with the instructions as:
[
OFPInstructionActions(actions=[OFPActionOutput(port=2)]),
OFPInstructionMeter(meter_id=1)
]
this patch makes tester.py ignore the order different.
Signed-off-by: Yuichi Ito <[email protected]>
---
ryu/tests/switch/tester.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py
index 519a763..73d14e0 100644
--- a/ryu/tests/switch/tester.py
+++ b/ryu/tests/switch/tester.py
@@ -547,6 +547,9 @@ class OfTester(app_manager.RyuApp):
for attr in attr_list:
value1 = getattr(stats1, attr)
value2 = getattr(stats2, attr)
+ if isinstance(value1, list) and isinstance(value2, list):
+ value1 = sorted(value1)
+ value2 = sorted(value2)
if str(value1) != str(value2):
flow_stats = []
for attr in attr_list:
--
1.7.10.4
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel