MCPcopy Create free account
hub / github.com/containers/image / ensureTestCanCreateImages

Function ensureTestCanCreateImages

storage/storage_test.go:302–314  ·  view source on GitHub ↗

ensureTestCanCreateImages skips the current test if it is not possible to create layers and images in a private store.

(t *testing.T)

Source from the content-addressed store, hash-verified

300
301// ensureTestCanCreateImages skips the current test if it is not possible to create layers and images in a private store.
302func ensureTestCanCreateImages(t *testing.T) {
303 t.Helper()
304 switch runtime.GOOS {
305 case "darwin":
306 return // Due to https://github.com/containers/storage/pull/811 , c/storage can be used on macOS unprivileged.
307 case "linux":
308 if os.Geteuid() != 0 {
309 t.Skip("test requires root privileges on Linux")
310 }
311 default:
312 // Unknown, let’s leave the tests enabled so that this can be investigated when working on that architecture.
313 }
314}
315
316// configForLayers returns a minimally-plausible config for layers
317func configForLayers(t *testing.T, layers []testBlob) testBlob {

Callers 7

TestResolveReferenceFunction · 0.85
TestWriteReadFunction · 0.85
TestDuplicateNameFunction · 0.85
TestDuplicateIDFunction · 0.85
TestDuplicateNameIDFunction · 0.85
TestSizeFunction · 0.85
TestDuplicateBlobFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…