From 05fd26b601c15d3fd51924a130e47243b3c607c4 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 7 May 2026 14:21:32 +0100 Subject: [PATCH] tests: Make ovs setup idempotent Try and delete the bridge if it exists before setting up for the test. This prevents cascading failures where if the test fails once any subsequent run of the test will fail during the setup. Signed-off-by: Rob Bradford --- cloud-hypervisor/tests/common/utils.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cloud-hypervisor/tests/common/utils.rs b/cloud-hypervisor/tests/common/utils.rs index 48d8441c1..a847e7e8b 100644 --- a/cloud-hypervisor/tests/common/utils.rs +++ b/cloud-hypervisor/tests/common/utils.rs @@ -337,6 +337,9 @@ pub(crate) fn setup_ovs_dpdk() { ); assert!(exec_host_command_status("service openvswitch-switch restart").success()); + // Clean up any stale bridge from a previous failed run + exec_host_command_status("ovs-vsctl --if-exists del-br ovsbr0"); + // Create OVS-DPDK bridge and ports assert!( exec_host_command_status(