From e5cb6026f229fe294b7b6b7ec3abfa05eee88bb9 Mon Sep 17 00:00:00 2001 From: Youssef Yamout Date: Wed, 1 Apr 2026 16:05:33 -0400 Subject: [PATCH 1/2] fix: add RemoveExistingImage option to container setup --- .../networking/tests/container_connectivity/cntr_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/container/networking/tests/container_connectivity/cntr_test.go b/feature/container/networking/tests/container_connectivity/cntr_test.go index 6033d6999e8..d00e9797e6b 100644 --- a/feature/container/networking/tests/container_connectivity/cntr_test.go +++ b/feature/container/networking/tests/container_connectivity/cntr_test.go @@ -87,6 +87,7 @@ func setupContainer(t *testing.T, dut *ondatra.DUTDevice) { TarPath: containerTarPath(t), Network: "host", PollForRunningState: true, + RemoveExistingImage: true, } _, cleanup := containerztest.Setup(ctx, t, dut, opts) t.Cleanup(cleanup) From 5cafc505e6a71c5f5999693d91742ab1c1e3dba9 Mon Sep 17 00:00:00 2001 From: Youssef Yamout Date: Thu, 23 Apr 2026 20:12:01 -0400 Subject: [PATCH 2/2] Make container image cleanup configurable --- .../networking/tests/container_connectivity/cntr_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/feature/container/networking/tests/container_connectivity/cntr_test.go b/feature/container/networking/tests/container_connectivity/cntr_test.go index d00e9797e6b..fd1e27edce4 100644 --- a/feature/container/networking/tests/container_connectivity/cntr_test.go +++ b/feature/container/networking/tests/container_connectivity/cntr_test.go @@ -55,7 +55,8 @@ func TestMain(m *testing.M) { } var ( - containerTar = flag.String("container_tar", "/tmp/cntrsrv.tar", "The container tarball to deploy.") + containerTar = flag.String("container_tar", "/tmp/cntrsrv.tar", "The container tarball to deploy.") + removeExistingImage = flag.Bool("remove_existing_image", true, "Whether to remove any existing DUT image before pushing the test container image.") // containerTarPath returns the path to the container tarball. // This can be overridden for internal testing behavior using init(). containerTarPath = func(t *testing.T) string { @@ -87,7 +88,7 @@ func setupContainer(t *testing.T, dut *ondatra.DUTDevice) { TarPath: containerTarPath(t), Network: "host", PollForRunningState: true, - RemoveExistingImage: true, + RemoveExistingImage: *removeExistingImage, } _, cleanup := containerztest.Setup(ctx, t, dut, opts) t.Cleanup(cleanup)