From d08389596189689505109dceb70075423eda9c8e Mon Sep 17 00:00:00 2001 From: Yuichi Ito Date: Tue, 15 Apr 2014 14:53:12 +0900 Subject: sw test tool: Correct the comparison method to treat matches as the set OF 1.3.3 spec (3 Glossary) says: Flow Entry: an element in a flow table used to match and process packets. It contains a set of match fields for matching packets, a priority for matching precedence, a set of counters to track packets, and a set of instructions to apply (see 5.2). According to OF spec, the match fields are treated as the set. This means that the order of matches which flow_stats message returns is inconsistant. This patch corrects the comparison method of matches by sorting in a particular order before comparison. Signed-off-by: Yuichi Ito Signed-off-by: FUJITA Tomonori --- ryu/tests/switch/tester.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py index 4b12e291..8954b211 100644 --- a/ryu/tests/switch/tester.py +++ b/ryu/tests/switch/tester.py @@ -810,8 +810,8 @@ class OfTester(app_manager.RyuApp): value1 = sorted(value1) value2 = sorted(value2) elif attr == 'match': - value1 = __reasm_match(value1) - value2 = __reasm_match(value2) + value1 = sorted(__reasm_match(value1)) + value2 = sorted(__reasm_match(value2)) if str(value1) != str(value2): flow_stats = [] for attr in attr_list: -- cgit v1.2.3