summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYuichi Ito <ito.yuichi0@gmail.com>2014-02-07 12:41:50 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-02-07 19:53:12 +0900
commit29027c2db4f060daf1f1e522a0210831f6de8a72 (patch)
tree5dcf72f0367c32b3146a3eb3fe8f2c64e738b1d6
parent0a2a4b400800173e2cf6aa1c2a4d5a5b1773b649 (diff)
sw test tool: correct the comparison method to treat instructions as the set
according to OF spec, the instruction is treated as the set. this means that the order of instructions which flow_stat message returns is inconstant. this patch corrects the comparison method of instructions by sorting in a particular order before comparison. Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/tests/switch/tester.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py
index de39b774..50f7fc79 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 attr == 'instructions':
+ value1 = sorted(value1)
+ value2 = sorted(value2)
if str(value1) != str(value2):
flow_stats = []
for attr in attr_list: