diff --git a/client/client_test.go b/client/client_test.go index ab2e3d1ccfec..f345cb2446cb 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -7845,14 +7845,16 @@ loop0: cdAddress := sb.ContainerdAddress() if cdAddress == "" { if checkContent { - store := proxy.NewContentStore(c.ContentClient()) - count := 0 - err := store.Walk(sb.Context(), func(info content.Info) error { - count++ - return nil - }) - require.NoError(t, err) - require.Equal(t, 0, count) + if err := workers.HasFeatureCompat(t, sb, workers.FeatureContentCheck); err == nil { + store := proxy.NewContentStore(c.ContentClient()) + count := 0 + err := store.Walk(sb.Context(), func(info content.Info) error { + count++ + return nil + }) + require.NoError(t, err) + require.Equal(t, 0, count) + } } t.Logf("checkAllReleasable: skipping check for exported tars in non-containerd test") return diff --git a/util/testutil/workers/dockerd.go b/util/testutil/workers/dockerd.go index b6c1d1d51ad1..4a1af71e1874 100644 --- a/util/testutil/workers/dockerd.go +++ b/util/testutil/workers/dockerd.go @@ -50,6 +50,7 @@ func InitDockerdWorker() { Unsupported: []string{ FeatureSecurityMode, FeatureCNINetwork, + FeatureContentCheck, }, }) } diff --git a/util/testutil/workers/features.go b/util/testutil/workers/features.go index 3aaea6c31fec..3325e623e5a6 100644 --- a/util/testutil/workers/features.go +++ b/util/testutil/workers/features.go @@ -30,6 +30,7 @@ const ( FeatureSecurityMode = "security_mode" FeatureSourceDateEpoch = "source_date_epoch" FeatureCNINetwork = "cni_network" + FeatureContentCheck = "content_check" ) var features = map[string]struct{}{ @@ -56,6 +57,7 @@ var features = map[string]struct{}{ FeatureSecurityMode: {}, FeatureSourceDateEpoch: {}, FeatureCNINetwork: {}, + FeatureContentCheck: {}, } func CheckFeatureCompat(t *testing.T, sb integration.Sandbox, reason ...string) {