At one point in the test, we expect that the output of `ovn-nbctl
copp-list` will produce:

arp: meter0
igmp: meter0

However, the output is created by walking a hashmap, and the ordering of
the items in the hashmap appears not to always be the same. On many
builds, I see the test fail, with the following error:

./ovn-northd.at:3287: ovn-nbctl copp-list copp0
--- -   2022-03-29 16:01:54.738558818 -0400
+++ /builddir/build/BUILD/ovn-22.03.0/tests/testsuite.dir/at-groups/897/stdout  
2022-03-29 16:01:54.730616276 -0400
@@ -1,3 +1,3 @@
-arp: meter0
 igmp: meter0
+arp: meter0

The data is correct, but the test is being too strict about the expected
ordering of the results.

This commit fixes the issue by running the results through `sort` to
ensure the ordering will be consistent.

Signed-off-by: Mark Michelson <[email protected]>
---
 tests/ovn-northd.at | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index 17d4f31b3..8b3e867c7 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -3447,7 +3447,7 @@ ls_copp_uuid=$(fetch_column nb:Logical_Switch copp)
 AT_CHECK([test "$ls_copp_uuid" = "$copp_uuid"])
 
 check ovn-nbctl --wait=hv copp-add $copp_uuid igmp meter0
-AT_CHECK([ovn-nbctl copp-list copp0], [0], [dnl
+AT_CHECK([ovn-nbctl copp-list copp0 | sort], [0], [dnl
 arp: meter0
 igmp: meter0
 ])
-- 
2.31.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to