diff mbox series

[ovs-dev,v3,11/11] test: Use check for ovn-sbctl wherever possible.

Message ID 300961b87e16ebe645bff012e10482d3ce09fac7.1730917155.git.lorenzo.bianconi@redhat.com
State Accepted
Headers show
Series Use check for ovn-nbctl/ovn-sbctl wherever possible. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Lorenzo Bianconi Nov. 6, 2024, 6:21 p.m. UTC
Reported-at: https://issues.redhat.com/browse/FDP-875
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 tests/ovn-controller.at | 16 +++++------
 tests/ovn-ic.at         |  2 +-
 tests/ovn-northd.at     | 62 ++++++++++++++++++++---------------------
 tests/ovn.at            | 16 +++++------
 tests/system-ovn.at     |  4 +--
 5 files changed, 50 insertions(+), 50 deletions(-)
diff mbox series

Patch

diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at
index 8d2b51ea3..5a78ac455 100644
--- a/tests/ovn-controller.at
+++ b/tests/ovn-controller.at
@@ -190,7 +190,7 @@  AT_CHECK([test "${expected_iface_types}" = "${chassis_iface_types}"])
 
 # Change the value of other_config:iface-types using ovn-sbctl.
 # ovn-controller should again set it back to proper one.
-ovn-sbctl set Chassis ${sysid} other_config:iface-types="foo"
+check ovn-sbctl set Chassis ${sysid} other_config:iface-types="foo"
 OVS_WAIT_UNTIL([
     chassis_iface_types=$(ovn-sbctl get Chassis ${sysid} other_config:iface-types | sed -e 's/\"//g')
     echo "chassis_iface_types = ${chassis_iface_types}"
@@ -290,7 +290,7 @@  check_tunnel_property () {
 }
 
 # create "empty" chassis. vxlan is used here as a stub
-ovn-sbctl chassis-add fakechassis vxlan 192.168.0.2
+check ovn-sbctl chassis-add fakechassis vxlan 192.168.0.2
 
 # See if we switch to Geneve as the first choice when it is available
 # With multi-VTEP support we support tunnels with different IPs to the
@@ -305,15 +305,15 @@  OVS_WAIT_UNTIL([check_tunnel_property type geneve])
 
 # change geneve to stt and check that tun interface was deleted and there is
 # no stt encap on the second chassis, only vxlan
-ovn-sbctl set encap ${encap_uuid} type=stt
+check ovn-sbctl set encap ${encap_uuid} type=stt
 OVS_WAIT_WHILE([check_tunnel_property type stt])
 OVS_WAIT_UNTIL([check_tunnel_property type vxlan])
 
 # change back to geneve
-ovn-sbctl set encap ${encap_uuid} type=geneve
+check ovn-sbctl set encap ${encap_uuid} type=geneve
 
 # Check that changes within an encap row are propagated
-ovn-sbctl set encap ${encap_uuid} ip=192.168.0.2
+check ovn-sbctl set encap ${encap_uuid} ip=192.168.0.2
 OVS_WAIT_UNTIL([check_tunnel_property options:remote_ip "\"192.168.0.2\""])
 
 # Change the type on the OVS side and check than OVN fixes it
@@ -395,7 +395,7 @@  ovn_attach n1 br-phys 192.168.0.1
 
 OVS_WAIT_UNTIL([test xhv = x`ovn-sbctl --columns name --bare find chassis`])
 # Delete the chassis "hv"
-ovn-sbctl chassis-del hv
+check ovn-sbctl chassis-del hv
 # ovn-controller should recreate its chassis row.
 OVS_WAIT_UNTIL([test xhv = x`ovn-sbctl --columns name --bare find chassis`])
 
@@ -822,7 +822,7 @@  no_tos_options="{csum=\"true\", key=flow, local_ip=\"192.168.0.1\", remote_ip=\"
 
 #
 # Start off with a remote chassis supporting geneve
-ovn-sbctl chassis-add fakechassis geneve 192.168.0.2
+check ovn-sbctl chassis-add fakechassis geneve 192.168.0.2
 OVS_WAIT_UNTIL([check_tunnel_property type geneve])
 
 tos_option=$(ovs-vsctl get interface ovn-fakech-0 options)
@@ -2855,7 +2855,7 @@  ovn_attach n1 br-phys 192.168.0.1
 check ovn-nbctl --wait=sb sync
 wait_row_count Chassis 1 name=hv1
 
-ovn-sbctl chassis-add fakechassis geneve 192.168.0.2
+check ovn-sbctl chassis-add fakechassis geneve 192.168.0.2
 fakech_tunnel=ovn-fakech-0
 OVS_WAIT_UNTIL([ovs-vsctl list port $fakech_tunnel])
 port_uuid=$(ovs-vsctl get port $fakech_tunnel _uuid)
diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at
index a6463ae3a..1ba65fd9f 100644
--- a/tests/ovn-ic.at
+++ b/tests/ovn-ic.at
@@ -66,7 +66,7 @@  ovn_init_ic_db
 ovn_start az1
 
 # create fake chassis with vxlan encap to enforce requested tunnel key checks
-ovn-sbctl chassis-add fakechassis vxlan 192.168.0.2
+check ovn-sbctl chassis-add fakechassis vxlan 192.168.0.2
 
 AT_CHECK([ovn-ic-nbctl ts-add ts1])
 AT_CHECK([ovn-ic-nbctl --wait=sb ts-add ts2])
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index d1d1b2782..88277ddc9 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -89,8 +89,8 @@  AT_SETUP([check from NBDB to SBDB])
 ovn_start
 
 ovn-nbctl create Logical_Router name=R1
-ovn-sbctl chassis-add gw1 geneve 127.0.0.1
-ovn-sbctl chassis-add gw2 geneve 1.2.4.8
+check ovn-sbctl chassis-add gw1 geneve 127.0.0.1
+check ovn-sbctl chassis-add gw2 geneve 1.2.4.8
 
 # Connect alice to R1 as distributed router gateway port on hv2
 check ovn-nbctl lrp-add R1 alice 00:00:02:01:02:03 172.16.1.1/24
@@ -123,13 +123,13 @@  ovn-sbctl list ha_chassis_group
 # Delete chassis - gw2 in SB DB.
 # ovn-northd should not recreate ha_chassis rows
 # repeatedly when gw2 is deleted.
-ovn-sbctl chassis-del gw2
+check ovn-sbctl chassis-del gw2
 
 ha_ch_list=$(fetch_column HA_Chassis _uuid)
 check_column "$ha_ch_list" HA_Chassis _uuid
 
 # Add back the gw2 chassis
-ovn-sbctl chassis-add gw2 geneve 1.2.4.8
+check ovn-sbctl chassis-add gw2 geneve 1.2.4.8
 
 # delete the 2nd Gateway_Chassis on NBDB for alice port
 check_column '' Port_Binding gateway_chassis logical_port=cr-alice
@@ -163,8 +163,8 @@  check ovn-nbctl ls-add S1
 check ovn-nbctl --wait=sb lsp-add S1 S1-vm1
 wait_row_count nb:Logical_Switch_Port 1 name=S1-vm1 'up!=true'
 
-ovn-sbctl chassis-add hv1 geneve 127.0.0.1
-ovn-sbctl lsp-bind S1-vm1 hv1
+check ovn-sbctl chassis-add hv1 geneve 127.0.0.1
+check ovn-sbctl lsp-bind S1-vm1 hv1
 wait_row_count nb:Logical_Switch_Port 1 name=S1-vm1 'up=true'
 
 AT_CLEANUP
@@ -191,7 +191,7 @@  OVN_FOR_EACH_NORTHD_NO_HV([
 AT_SETUP([check up state of router LSP linked to a gateway LR])
 ovn_start
 
-ovn-sbctl chassis-add gw1 geneve 127.0.0.1
+check ovn-sbctl chassis-add gw1 geneve 127.0.0.1
 
 ovn-nbctl create Logical_Router name=R1 options:chassis=gw1
 check ovn-nbctl lrp-add R1 R1-S1 02:ac:10:01:00:01 172.16.1.1/24
@@ -202,7 +202,7 @@  check ovn-nbctl lsp-set-type S1-R1 router
 check ovn-nbctl lsp-set-addresses S1-R1 02:ac:10:01:00:01
 check ovn-nbctl --wait=sb lsp-set-options S1-R1 router-port=R1-S1
 
-ovn-sbctl lsp-bind S1-R1 gw1
+check ovn-sbctl lsp-bind S1-R1 gw1
 AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])
 
 AT_CLEANUP
@@ -212,7 +212,7 @@  OVN_FOR_EACH_NORTHD_NO_HV([
 AT_SETUP([check up state of router LSP linked to an LRP with set Gateway Chassis])
 ovn_start
 
-ovn-sbctl chassis-add gw1 geneve 127.0.0.1
+check ovn-sbctl chassis-add gw1 geneve 127.0.0.1
 
 check ovn-nbctl lr-add R1
 check ovn-nbctl lrp-add R1 R1-S1 02:ac:10:01:00:01 172.16.1.1/24
@@ -579,7 +579,7 @@  check ovn-nbctl lsp-set-type sw0-lr0 router
 check ovn-nbctl lsp-set-addresses sw0-lr0 router
 check ovn-nbctl --wait=sb lsp-set-options sw0-lr0 router-port=lr0-sw0
 
-ovn-sbctl lsp-bind sw0-p1 comp1
+check ovn-sbctl lsp-bind sw0-p1 comp1
 wait_row_count nb:Logical_Switch_Port 1 name=sw0-p1 up=true
 
 comp1_ch_uuid=$(fetch_column Chassis _uuid name=comp1)
@@ -591,12 +591,12 @@  echo "comp1_ch_uuid = $comp1_ch_uuid"
 wait_column "$comp1_ch_uuid" HA_Chassis_Group ref_chassis
 
 # unbind sw0-p1
-ovn-sbctl lsp-unbind sw0-p1
+check ovn-sbctl lsp-unbind sw0-p1
 wait_row_count nb:Logical_Switch_Port 1 name=sw0-p1 up=false
 wait_column "" HA_Chassis_Group ref_chassis
 
 # Bind sw0-p1 in comp2
-ovn-sbctl lsp-bind sw0-p1 comp2
+check ovn-sbctl lsp-bind sw0-p1 comp2
 wait_column "$comp2_ch_uuid" HA_Chassis_Group ref_chassis
 
 check ovn-nbctl ls-add sw1
@@ -629,7 +629,7 @@  exp_ref_ch_list="$comp1_ch_uuid $comp2_ch_uuid"
 wait_column "$exp_ref_ch_list" HA_Chassis_Group ref_chassis
 
 # Unind sw1-p1. comp2 should not be in the ref_chassis.
-ovn-sbctl lsp-unbind sw1-p1
+check ovn-sbctl lsp-unbind sw1-p1
 wait_row_count nb:Logical_Switch_Port 1 name=sw1-p1 up=false
 wait_column "$comp2_ch_uuid" HA_Chassis_Group ref_chassis
 
@@ -664,12 +664,12 @@  wait_column "$exp_ref_ch_list" HA_Chassis_Group ref_chassis
 
 # Create sw0-p2 and bind it to comp1
 check ovn-nbctl --wait=sb lsp-add sw0 sw0-p2
-ovn-sbctl lsp-bind sw0-p2 comp1
+check ovn-sbctl lsp-bind sw0-p2 comp1
 wait_row_count nb:Logical_Switch_Port 1 name=sw0-p2 up=true
 wait_column "$exp_ref_ch_list" HA_Chassis_Group ref_chassis
 
 # unbind sw0-p2
-ovn-sbctl lsp-unbind sw0-p2
+check ovn-sbctl lsp-unbind sw0-p2
 wait_row_count nb:Logical_Switch_Port 1 name=sw0-p2 up=false
 wait_column "$exp_ref_ch_list" HA_Chassis_Group ref_chassis
 
@@ -963,7 +963,7 @@  OVN_FOR_EACH_NORTHD_NO_HV([
 AT_SETUP([check Redirect Chassis propagation from NB to SB])
 ovn_start
 
-ovn-sbctl chassis-add gw1 geneve 127.0.0.1
+check ovn-sbctl chassis-add gw1 geneve 127.0.0.1
 
 check ovn-nbctl lr-add R1
 check ovn-nbctl lrp-add R1 R1-S1 02:ac:10:01:00:01 172.16.1.1/24
@@ -988,7 +988,7 @@  OVN_FOR_EACH_NORTHD_NO_HV([
 AT_SETUP([check stateless dnat_and_snat rule])
 ovn_start
 
-ovn-sbctl chassis-add gw1 geneve 127.0.0.1
+check ovn-sbctl chassis-add gw1 geneve 127.0.0.1
 
 check ovn-nbctl lr-add R1
 check ovn-nbctl lrp-add R1 R1-S1 02:ac:10:01:00:01 172.16.1.1/24
@@ -1072,7 +1072,7 @@  OVN_FOR_EACH_NORTHD_NO_HV([
 AT_SETUP([check portrange dnat, snat and dnat_and_snat rules])
 ovn_start
 
-ovn-sbctl chassis-add gw1 geneve 127.0.0.1
+check ovn-sbctl chassis-add gw1 geneve 127.0.0.1
 
 check ovn-nbctl lr-add R1
 check ovn-nbctl lrp-add R1 R1-S1 02:ac:10:01:00:01 172.16.1.1/24
@@ -1395,9 +1395,9 @@  check ovn-nbctl --wait=sb lsp-add sw1 sw1-p1 -- lsp-set-addresses sw1-p1 \
 "02:00:00:00:00:03 20.0.0.3"
 
 # service_monitors state online requires corresponding port_binding to be "up"
-ovn-sbctl chassis-add hv1 geneve 127.0.0.1
-ovn-sbctl lsp-bind sw0-p1 hv1
-ovn-sbctl lsp-bind sw1-p1 hv1
+check ovn-sbctl chassis-add hv1 geneve 127.0.0.1
+check ovn-sbctl lsp-bind sw0-p1 hv1
+check ovn-sbctl lsp-bind sw1-p1 hv1
 wait_row_count nb:Logical_Switch_Port 1 name=sw0-p1 'up=true'
 wait_row_count nb:Logical_Switch_Port 1 name=sw1-p1 'up=true'
 
@@ -1480,7 +1480,7 @@  OVS_WAIT_FOR_OUTPUT(
 ])
 
 AS_BOX([Set the service monitor for sw0-p1 to offline])
-ovn-sbctl set service_monitor $sm_sw0_p1 status=offline
+check ovn-sbctl set service_monitor $sm_sw0_p1 status=offline
 
 wait_row_count Service_Monitor 1 logical_port=sw0-p1 status=offline
 check ovn-nbctl --wait=sb sync
@@ -1496,8 +1496,8 @@  OVS_WAIT_FOR_OUTPUT(
 ])
 
 AS_BOX([Set the service monitor for sw0-p1 and sw1-p1 to online])
-ovn-sbctl set service_monitor $sm_sw0_p1 status=online
-ovn-sbctl set service_monitor $sm_sw1_p1 status=online
+check ovn-sbctl set service_monitor $sm_sw0_p1 status=online
+check ovn-sbctl set service_monitor $sm_sw1_p1 status=online
 
 wait_row_count Service_Monitor 1 logical_port=sw1-p1 status=online
 check ovn-nbctl --wait=sb sync
@@ -1509,7 +1509,7 @@  OVS_WAIT_FOR_OUTPUT(
 ])
 
 AS_BOX([Set the service monitor for sw1-p1 to error])
-ovn-sbctl set service_monitor $sm_sw1_p1 status=error
+check ovn-sbctl set service_monitor $sm_sw1_p1 status=error
 wait_row_count Service_Monitor 1 logical_port=sw1-p1 status=error
 check ovn-nbctl --wait=sb sync
 
@@ -1618,8 +1618,8 @@  wait_row_count Service_Monitor 2
 sm_sw0_p1=$(fetch_column Service_Monitor _uuid logical_port=sw0-p1)
 sm_sw1_p1=$(fetch_column Service_Monitor _uuid logical_port=sw1-p1)
 
-ovn-sbctl set service_monitor $sm_sw0_p1 status=offline
-ovn-sbctl set service_monitor $sm_sw1_p1 status=offline
+check ovn-sbctl set service_monitor $sm_sw0_p1 status=offline
+check ovn-sbctl set service_monitor $sm_sw1_p1 status=offline
 
 AT_CAPTURE_FILE([sbflows12])
 OVS_WAIT_FOR_OUTPUT(
@@ -1967,7 +1967,7 @@  OVN_FOR_EACH_NORTHD_NO_HV([
 AT_SETUP([check router ARP/NS responder])
 ovn_start
 
-ovn-sbctl chassis-add ch geneve 127.0.0.1
+check ovn-sbctl chassis-add ch geneve 127.0.0.1
 
 check ovn-nbctl lr-add lr
 check ovn-nbctl lrp-add lr lrp-public 00:00:00:00:01:00 43.43.43.1/24 4343::1/64
@@ -6351,8 +6351,8 @@  wait_row_count Service_Monitor 2
 sm_vip1=$(fetch_column Service_Monitor _uuid logical_port=vip1)
 sm_vip2=$(fetch_column Service_Monitor _uuid logical_port=vip2)
 
-ovn-sbctl set service_monitor $sm_vip1 status=offline
-ovn-sbctl set service_monitor $sm_vip2 status=offline
+check ovn-sbctl set service_monitor $sm_vip1 status=offline
+check ovn-sbctl set service_monitor $sm_vip2 status=offline
 check ovn-nbctl --wait=sb sync
 
 AT_CHECK([ovn-sbctl dump-flows lr0 | grep "lr_in_dnat" | ovn_strip_lflows], [0], [dnl
@@ -12108,7 +12108,7 @@  as hv1
 ovs-vsctl add-br br-phys
 ovn_attach n1 br-phys 192.168.0.11
 
-ovn-sbctl chassis-add gw1 geneve 127.0.0.1
+check ovn-sbctl chassis-add gw1 geneve 127.0.0.1
 
 check ovn-nbctl ls-add sw0
 check ovn-nbctl --wait=sb lsp-add sw0 sw0p1 -- lsp-set-addresses sw0p1 "00:00:20:20:12:01 10.0.0.4"
diff --git a/tests/ovn.at b/tests/ovn.at
index c9ed483a4..f91fec765 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -2993,7 +2993,7 @@  ovn_start
 # Make ls1 a destination for unknown MACs.
 # Add some ACLs for Ethertypes 1234, 1235, 1236.
 check ovn-nbctl ls-add lsw0
-ovn-sbctl chassis-add hv0 geneve 127.0.0.1
+check ovn-sbctl chassis-add hv0 geneve 127.0.0.1
 for i in 1 2 3; do
     ovn-nbctl lsp-add lsw0 lp$i
 done
@@ -14390,7 +14390,7 @@  check ovn-nbctl --wait=hv sync
 # Chassis entry is not replaced.
 
 gw2_chassis=$(ovn-sbctl --bare --columns=_uuid find Chassis name=gw2)
-ovn-sbctl destroy Chassis $gw2_chassis
+check ovn-sbctl destroy Chassis $gw2_chassis
 
 # Wait for the gw2_chassis row is recreated.
 wait_row_count Chassis 1 name=gw2
@@ -22262,7 +22262,7 @@  check_virtual_offlows_not_present hv2
 # Forcibly clear virtual_parent. ovn-controller should release the binding
 # gracefully.
 pb_uuid=$(ovn-sbctl --bare --columns _uuid find port_binding logical_port=sw0-vir)
-ovn-sbctl clear port_binding $pb_uuid virtual_parent
+check ovn-sbctl clear port_binding $pb_uuid virtual_parent
 
 OVS_WAIT_UNTIL([test x$(ovn-sbctl --bare --columns chassis find port_binding \
 logical_port=sw0-vir) = x])
@@ -22693,7 +22693,7 @@  AT_CHECK([ovn-sbctl get controller_event $uuid seq_num], [0], [dnl
 1
 ])
 
-ovn-sbctl destroy controller_event $uuid
+check ovn-sbctl destroy controller_event $uuid
 packet1="inport==\"sw1-p0\" && eth.src==00:00:00:00:00:33 && eth.dst==00:00:00:00:ff:02 &&
          ip4 && ip.ttl==64 && ip4.src==192.168.2.11 && ip4.dst==192.168.2.100 &&
          tcp && tcp.src==10000 && tcp.dst==80"
@@ -22708,7 +22708,7 @@  empty_lb_backends
 AT_CHECK([ovn-sbctl get controller_event $uuid event_info:vip], [0], [dnl
 "192.168.2.100:80"
 ])
-ovn-sbctl destroy controller_event $uuid
+check ovn-sbctl destroy controller_event $uuid
 
 packet2="inport==\"sw0-p11\" && eth.src==00:00:00:00:00:11 && eth.dst==00:00:00:00:00:21 &&
          ip6 && ip.ttl==64 && ip6.src==2001::11 && ip6.dst==2001::10 &&
@@ -23214,9 +23214,9 @@  OVS_WAIT_UNTIL(
   [$at_diff -F'^---' exp rcv])
 
 # Flush IGMP groups.
-ovn-sbctl ip-multicast-flush sw1
-ovn-sbctl ip-multicast-flush sw2
-ovn-sbctl ip-multicast-flush sw3
+check ovn-sbctl ip-multicast-flush sw1
+check ovn-sbctl ip-multicast-flush sw2
+check ovn-sbctl ip-multicast-flush sw3
 wait_row_count IGMP_Group 0 address=239.0.1.68
 check ovn-nbctl --wait=hv sync
 
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index 6761078f3..1ca8b5e65 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -4347,7 +4347,7 @@  OVS_WAIT_UNTIL([
 ])
 
 # Flush IGMP groups.
-ovn-sbctl ip-multicast-flush sw1
+check ovn-sbctl ip-multicast-flush sw1
 check ovn-nbctl --wait=hv -t 3 sync
 OVS_WAIT_UNTIL([
     total_entries=`ovn-sbctl find IGMP_Group address="${group_v4}" | grep _uuid -c`
@@ -11844,7 +11844,7 @@  NS_CHECK_EXEC([vif0], [ping -q -c 3 -i 0.3 -w 2 fe80::200:ff:fe00:1 | FORMAT_PIN
 ])
 
 check_row_count mac_binding 1 mac=\"00:00:00:00:00:02\"
-ovn-sbctl --all destroy mac_binding
+check ovn-sbctl --all destroy mac_binding
 
 check ovn-nbctl --wait=hv set logical_router lr0 options:always_learn_from_arp_request=true