services/content: fix reading a blob which is smaller than the read buffer.
The newly added test fails without this fix in services/content/service.go: $ go test -c . && sudo ./containerd.test -test.v -test.root -test.run TestContentClient ... --- FAIL: TestContentClient/SmallBlob (0.02s) provideringester.go:62: rpc error: code = OutOfRange desc = read past object length 6 bytes helpers.go:67: drwx------ 4096 /tmp/content-suite-ContentClient-286788688 FAIL Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
@@ -50,6 +50,10 @@ func ContentSuite(t *testing.T, name string, storeFn func(ctx context.Context, r
|
||||
|
||||
t.Run("CrossNamespaceAppend", makeTest(t, name, storeFn, checkCrossNSAppend))
|
||||
t.Run("CrossNamespaceShare", makeTest(t, name, storeFn, checkCrossNSShare))
|
||||
|
||||
t.Run("SmallBlob", makeTest(t, name, storeFn, func(ctx context.Context, t *testing.T, cs content.Store) {
|
||||
TestSmallBlob(ctx, t, cs)
|
||||
}))
|
||||
}
|
||||
|
||||
// ContextWrapper is used to decorate new context used inside the test
|
||||
|
Reference in New Issue
Block a user