(t *testing.T)
| 47 | ) |
| 48 | |
| 49 | func TestRunCustomRootfs(t *testing.T) { |
| 50 | testutil.DockerIncompatible(t) |
| 51 | // FIXME: root issue is undiagnosed and this is very likely a containerd bug |
| 52 | // It appears that in certain conditions, the proxy content store info method will fail on the layer of the image |
| 53 | // Search for func (pcs *proxyContentStore) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error) { |
| 54 | // Note that: |
| 55 | // - the problem is still here with containerd and nerdctl v2 |
| 56 | // - it seems to affect images that are tagged multiple times, or that share a layer with another image |
| 57 | // - this test is not parallelized - but the fact that namespacing it solves the problem suggest that something |
| 58 | // happening in the default namespace BEFORE this test is run is SOMETIMES setting conditions that will make this fail |
| 59 | // Possible suspects would be concurrent pulls somehow effing things up w. namespaces. |
| 60 | base := testutil.NewBaseWithNamespace(t, testutil.Identifier(t)) |
| 61 | rootfs := prepareCustomRootfs(base, testutil.AlpineImage) |
| 62 | t.Cleanup(func() { |
| 63 | base.Cmd("namespace", "remove", testutil.Identifier(t)).Run() |
| 64 | }) |
| 65 | defer os.RemoveAll(rootfs) |
| 66 | base.Cmd("run", "--rm", "--rootfs", rootfs, "/bin/cat", "/proc/self/environ").AssertOutContains("PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin") |
| 67 | base.Cmd("run", "--rm", "--entrypoint", "/bin/echo", "--rootfs", rootfs, "echo", "foo").AssertOutExactly("echo foo\n") |
| 68 | } |
| 69 | |
| 70 | func prepareCustomRootfs(base *testutil.Base, imageName string) string { |
| 71 | base.Cmd("pull", "--quiet", imageName).AssertOK() |
nothing calls this directly
no test coverage detected
searching dependent graphs…