ensureTestCanCreateImages skips the current test if it is not possible to create layers and images in a private store.
(t *testing.T)
| 300 | |
| 301 | // ensureTestCanCreateImages skips the current test if it is not possible to create layers and images in a private store. |
| 302 | func 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 |
| 317 | func configForLayers(t *testing.T, layers []testBlob) testBlob { |
no outgoing calls
no test coverage detected
searching dependent graphs…