Replace direct ovs-vsctl ofport queries with wait_and_get_ofport,
which retries until a valid ofport is assigned.
Also add "ovn-nbctl --wait=hv sync" to ensure ovn-controller has
installed the output flows referencing that ofport before running
any trace.
Fixes: 79302556d472 ("controller: Add experimental flow-based tunnel support.")
Signed-off-by: Xavier Simonart <[email protected]>
---
tests/ovn.at | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/tests/ovn.at b/tests/ovn.at
index 4f4fb8c03..d7a3a2adb 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -31985,10 +31985,13 @@ check_packet_tunnel() {
as $hv
echo "vif$src -> vif$dst should go through tunnel $local_encap_ip ->
$remote_encap_ip"
if test x$flow_based_tunnel == xtrue; then
- tunnel_ofport=$(ovs-vsctl --bare --column=ofport list interface
ovn-geneve)
+ tunnel_ofport=$(wait_and_get_ofport name=ovn-geneve)
else
- tunnel_ofport=$(ovs-vsctl --bare --column=ofport find interface
options:local_ip=$local_encap_ip options:remote_ip=$remote_encap_ip)
+ tunnel_ofport=$(wait_and_get_ofport "options:local_ip=$local_encap_ip
options:remote_ip=$remote_encap_ip")
fi
+ # Once ofport is in ovs db, ensure ovn-controller handles it.
+ check ovn-nbctl --wait=hv sync
+
AT_CHECK([test $(ovs-appctl ofproto/trace br-int in_port=vif$src $packet |
grep "output:" | awk -F ':' '{ print $2 }') == $tunnel_ofport])
if test x$flow_based_tunnel == xtrue; then
trace_output=$(ovs-appctl ofproto/trace br-int in_port=vif$src $packet)
@@ -32091,10 +32094,12 @@ check_packet_tunnel() {
echo "vif$src -> vif$dst should go through tunnel $local_encap_ip ->
$remote_encap_ip"
if test x$flow_based_tunnel == xtrue; then
- tunnel_ofport=$(ovs-vsctl --bare --column=ofport list interface
ovn-geneve)
+ tunnel_ofport=$(wait_and_get_ofport name=ovn-geneve)
else
- tunnel_ofport=$(ovs-vsctl --bare --column=ofport find interface
options:local_ip=$local_encap_ip options:remote_ip=$remote_encap_ip)
+ tunnel_ofport=$(wait_and_get_ofport "options:local_ip=$local_encap_ip
options:remote_ip=$remote_encap_ip")
fi
+ check ovn-nbctl --wait=hv sync
+
AT_CHECK([test $(ovs-appctl ofproto/trace br-int in_port=vif$src $packet |
grep "output:" | awk -F ':' '{ print $2 }') == $tunnel_ofport])
if test x$flow_based_tunnel == xtrue; then
trace_output=$(ovs-appctl ofproto/trace br-int in_port=vif$src $packet)
@@ -32241,9 +32246,9 @@ check_packet_tunnel() {
as $hv
echo "vif$src -> vif$dst should go through tunnel $local_encap_ip ->
$remote_encap_ip"
if test x$flow_based_tunnel == xtrue; then
- tunnel_ofport=$(ovs-vsctl --bare --column=ofport list interface
ovn-geneve)
+ tunnel_ofport=$(wait_and_get_ofport name=ovn-geneve)
else
- tunnel_ofport=$(ovs-vsctl --bare --column=ofport find interface
options:local_ip=$local_encap_ip options:remote_ip=$remote_encap_ip)
+ tunnel_ofport=$(wait_and_get_ofport "options:local_ip=$local_encap_ip
options:remote_ip=$remote_encap_ip")
fi
ovs-appctl ofproto/trace br-ext in_port=vif$src $packet
AT_CHECK([test $(ovs-appctl ofproto/trace br-ext in_port=vif$src $packet |
grep "output:" | awk -F ':' '{ print $2 }') == $tunnel_ofport])
--
2.47.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev