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>
This commit is contained in:
Yuichi Ito 2014-02-07 12:41:50 +09:00 committed by FUJITA Tomonori
parent 0a2a4b4008
commit 29027c2db4

View File

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