diff --git a/feature/container/networking/tests/container_connectivity/cntr_test.go b/feature/container/networking/tests/container_connectivity/cntr_test.go index 6033d6999e8..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,6 +88,7 @@ func setupContainer(t *testing.T, dut *ondatra.DUTDevice) { TarPath: containerTarPath(t), Network: "host", PollForRunningState: true, + RemoveExistingImage: *removeExistingImage, } _, cleanup := containerztest.Setup(ctx, t, dut, opts) t.Cleanup(cleanup)