Hi Mark Thanks for looking into this. Yes and no... I do not think that the patch itself will help, but it pointed me to the existence of Logical_Switch_Port.up, which in this case should do the trick.
I will update the patch: instead of looking at the flows, I will use something like *wait_column "true" nb:Logical_Switch_Port up name=sw0-p1* Thanks Xavier On Thu, Sep 16, 2021 at 11:40 AM Mark Gray <[email protected]> wrote: > On 15/09/2021 09:52, Xavier Simonart wrote: > > Test was waiting for port to be up in SBDB before checking number of > flows > > Would this feature prevent this? > > 5c3371922994 ("if-status: Add OVS interface status management module.") > > > in OVS. However, there is no guarantee that all flows are installed > > in OVS when port is up. Test was randomly failing as some flows were > > installed, but not all. > > To fix this, we wait until the last flow (with actions=output) is > > installed. > > Also fixed small typo in logging (for the same test). > > > > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2004390 > > Fixes: f8a81693b0 ("ovn-controller: Fix the missing flows with > monitor-all set to True") > > Signed-off-by: Xavier Simonart <[email protected]> > > --- > > tests/ovn.at | 28 ++++++++++++++++++++++++++-- > > 1 file changed, 26 insertions(+), 2 deletions(-) > > > > diff --git a/tests/ovn.at b/tests/ovn.at > > index 30625ec37..18aeacd02 100644 > > --- a/tests/ovn.at > > +++ b/tests/ovn.at > > @@ -23448,6 +23448,12 @@ ovs-vsctl -- add-port br-int hv1-vif1 -- \ > > > > wait_for_ports_up sw0-p1 > > > > +# Wait for last flow to be installed > > +OVS_WAIT_UNTIL([ > > + test $(as hv1 ovs-ofctl dump-flows br-int | \ > > + grep "actions=output" -c) -eq 1 > > +]) > > + > > # Get the number of OF flows in hv1 and hv2 > > hv1_offlows=$(as hv1 ovs-ofctl dump-flows br-int | wc -l) > > echo "hv1 flows : $hv1_offlows" > > @@ -23462,6 +23468,12 @@ ovs-vsctl -- add-port br-int hv2-vif1 -- \ > > > > wait_for_ports_up sw0-p2 > > > > +# Wait for last flow to be installed > > +OVS_WAIT_UNTIL([ > > + test $(as hv2 ovs-ofctl dump-flows br-int | \ > > + grep "actions=output" -c) -eq 1 > > +]) > > + > > hv2_offlows=$(as hv2 ovs-ofctl dump-flows br-int | wc -l) > > echo "hv2 flows : $hv2_offlows" > > AT_CHECK([test $hv2_offlows -gt 0]) > > @@ -23500,9 +23512,15 @@ ovs-vsctl -- add-port br-int hv1-vif1 -- \ > > > > wait_for_ports_up sw0-p1 > > > > +# Wait for last flow to be installed > > +OVS_WAIT_UNTIL([ > > + test $(as hv1 ovs-ofctl dump-flows br-int | \ > > + grep "actions=output" -c) -eq 1 > > +]) > > + > > # Get the number of OF flows in hv1 and hv2 > > hv1_offlows_mon=$(as hv1 ovs-ofctl dump-flows br-int | wc -l) > > -echo "hv1 flows after monitor-all=true : $hv1_offlows" > > +echo "hv1 flows after monitor-all=true : $hv1_offlows_mon" > > AT_CHECK([test "$hv1_offlows" = "$hv1_offlows_mon"]) > > > > as hv2 > > @@ -23514,8 +23532,14 @@ ovs-vsctl -- add-port br-int hv2-vif1 -- \ > > > > wait_for_ports_up sw0-p2 > > > > +# Wait for last flow to be installed > > +OVS_WAIT_UNTIL([ > > + test $(as hv2 ovs-ofctl dump-flows br-int | \ > > + grep "actions=output" -c) -eq 1 > > +]) > > + > > hv2_offlows_mon=$(as hv2 ovs-ofctl dump-flows br-int | wc -l) > > -echo "hv2 flows after monitor-all=true : $hv2_offlows" > > +echo "hv2 flows after monitor-all=true : $hv2_offlows_mon" > > AT_CHECK([test "$hv2_offlows" = "$hv2_offlows_mon"]) > > > > OVN_CLEANUP([hv1], [hv2]) > > > > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
