MCPcopy Index your code
hub / github.com/docker/cli / TestCreatePushPull

Function TestCreatePushPull

e2e/plugin/plugin_test.go:17–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15const registryPrefix = "registry:5000"
16
17func TestCreatePushPull(t *testing.T) {
18 skip.If(t, environment.SkipPluginTests())
19
20 const pluginName = registryPrefix + "/my-plugin"
21
22 // TODO(thaJeztah): probably should use a config without the content trust bits.
23 dir := fixtures.SetupConfigFile(t)
24 defer dir.Remove()
25
26 ctx, cancel := context.WithCancel(context.Background())
27 t.Cleanup(cancel)
28
29 pluginDir := testutils.SetupPlugin(t, ctx)
30
31 icmd.RunCommand("docker", "plugin", "create", pluginName, pluginDir).Assert(t, icmd.Success)
32 result := icmd.RunCmd(icmd.Command("docker", "plugin", "push", pluginName),
33 fixtures.WithConfig(dir.Path()),
34 )
35 result.Assert(t, icmd.Expected{
36 Out: fmt.Sprintf("The push refers to repository [%s]", pluginName),
37 })
38
39 icmd.RunCommand("docker", "plugin", "rm", "-f", pluginName).Assert(t, icmd.Success)
40
41 result = icmd.RunCmd(icmd.Command("docker", "plugin", "install", "--grant-all-permissions", pluginName),
42 fixtures.WithConfig(dir.Path()),
43 )
44 result.Assert(t, icmd.Expected{
45 Out: "Installed plugin " + pluginName,
46 })
47}
48
49func TestInstall(t *testing.T) {
50 skip.If(t, environment.SkipPluginTests())

Callers

nothing calls this directly

Calls 3

RemoveMethod · 0.65
PathMethod · 0.65
CommandMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…