Skip to content

Commit

Permalink
Merge pull request moby#5547 from crazy-max/fix-content-check-test
Browse files Browse the repository at this point in the history
dockerd: skip content check with containerd snapshotter
  • Loading branch information
crazy-max authored Nov 22, 2024
2 parents db6989a + 0145090 commit 94d0f6e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
18 changes: 10 additions & 8 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions util/testutil/workers/dockerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func InitDockerdWorker() {
Unsupported: []string{
FeatureSecurityMode,
FeatureCNINetwork,
FeatureContentCheck,
},
})
}
Expand Down
2 changes: 2 additions & 0 deletions util/testutil/workers/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const (
FeatureSecurityMode = "security_mode"
FeatureSourceDateEpoch = "source_date_epoch"
FeatureCNINetwork = "cni_network"
FeatureContentCheck = "content_check"
)

var features = map[string]struct{}{
Expand All @@ -56,6 +57,7 @@ var features = map[string]struct{}{
FeatureSecurityMode: {},
FeatureSourceDateEpoch: {},
FeatureCNINetwork: {},
FeatureContentCheck: {},
}

func CheckFeatureCompat(t *testing.T, sb integration.Sandbox, reason ...string) {
Expand Down

0 comments on commit 94d0f6e

Please sign in to comment.