From 29027c2db4f060daf1f1e522a0210831f6de8a72 Mon Sep 17 00:00:00 2001 From: Yuichi Ito Date: Fri, 7 Feb 2014 12:41:50 +0900 Subject: [PATCH] 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 Reviewed-by: Simon Horman Signed-off-by: FUJITA Tomonori --- 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 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: