| 15 | const registryPrefix = "registry:5000" |
| 16 | |
| 17 | func 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 | |
| 49 | func TestInstall(t *testing.T) { |
| 50 | skip.If(t, environment.SkipPluginTests()) |