On 6/29/26 2:40 PM, Xavier Simonart via dev wrote:
> Macro can be used to wait for ofport creation in ovsdb and
> to retrieve its value.
> 
> Signed-off-by: Xavier Simonart <[email protected]>
> ---
>  tests/ovn-macros.at | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at
> index 8879c2fa1..2636b34cd 100644
> --- a/tests/ovn-macros.at
> +++ b/tests/ovn-macros.at
> @@ -1485,6 +1485,16 @@ wake_up_nb() {
>    AT_CHECK([kill -CONT $(cat ovn-nb/ovsdb-server.pid)])
>  }
>  
> +wait_and_get_ofport() {
> +    local ofport
> +    local condition=$1
> +    OVS_WAIT_UNTIL([
> +        ofport=$(ovs-vsctl --bare --columns ofport find Interface $condition)
> +        echo "$condition port=$ofport" >&2
> +        test -n "$ofport" && test "$ofport" -ge 0])

Can we use something like:

  AT_CHECK([ovs-vsctl wait-until interface $1 'ofport>0'])
  AT_CEHCK([ovs-vsctl get interface $1 ofport], [0], [stdout])
  cat stdout

?

Or are you using some more complex conditions somewhere?

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to