MCPcopy
hub / github.com/containerd/containerd / TestContainerInfo

Function TestContainerInfo

integration/client/container_test.go:1716–1742  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1714}
1715
1716func TestContainerInfo(t *testing.T) {
1717 t.Parallel()
1718
1719 ctx, cancel := testContext(t)
1720 defer cancel()
1721 id := t.Name()
1722
1723 client, err := newClient(t, address)
1724 if err != nil {
1725 t.Fatal(err)
1726 }
1727 defer client.Close()
1728
1729 container, err := client.NewContainer(ctx, id, WithNewSpec())
1730 if err != nil {
1731 t.Fatal(err)
1732 }
1733 defer container.Delete(ctx)
1734
1735 info, err := container.Info(ctx)
1736 if err != nil {
1737 t.Fatal(err)
1738 }
1739 if info.ID != container.ID() {
1740 t.Fatalf("info.ID=%s != container.ID()=%s", info.ID, container.ID())
1741 }
1742}
1743
1744func TestContainerLabels(t *testing.T) {
1745 t.Parallel()

Callers

nothing calls this directly

Calls 10

DeleteMethod · 0.95
InfoMethod · 0.95
IDMethod · 0.95
testContextFunction · 0.85
newClientFunction · 0.85
WithNewSpecFunction · 0.85
FatalMethod · 0.80
NameMethod · 0.65
CloseMethod · 0.65
NewContainerMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…