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 <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Yuichi Ito 2014-04-15 14:53:12 +09:00 committed by FUJITA Tomonori
parent bff6008488
commit d083895961

View File

@ -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: