@@ -2,26 +2,24 @@ package plugin
22
33import (
44 "context"
5+ "fmt"
56 "testing"
67
78 "github.com/docker/cli/e2e/internal/fixtures"
89 "github.com/docker/cli/e2e/testutils"
910 "github.com/docker/cli/internal/test/environment"
10- "github.com/moby/moby/api/types/versions"
1111 "gotest.tools/v3/icmd"
1212 "gotest.tools/v3/skip"
1313)
1414
1515const registryPrefix = "registry:5000"
1616
17- func TestInstallWithContentTrust (t * testing.T ) {
18- // TODO(krissetto): remove this skip once the fix (see https://github.com/moby/moby/pull/47299) is deployed to moby versions < 25
19- skip .If (t , versions .LessThan (environment .DaemonAPIVersion (t ), "1.44" ))
17+ func TestCreatePushPull (t * testing.T ) {
2018 skip .If (t , environment .SkipPluginTests ())
21- t .Skip ("flaky" )
2219
23- const pluginName = registryPrefix + "/plugin-content-trust "
20+ const pluginName = registryPrefix + "/my-plugin "
2421
22+ // TODO(thaJeztah): probably should use a config without the content trust bits.
2523 dir := fixtures .SetupConfigFile (t )
2624 defer dir .Remove ()
2725
@@ -33,39 +31,28 @@ func TestInstallWithContentTrust(t *testing.T) {
3331 icmd .RunCommand ("docker" , "plugin" , "create" , pluginName , pluginDir ).Assert (t , icmd .Success )
3432 result := icmd .RunCmd (icmd .Command ("docker" , "plugin" , "push" , pluginName ),
3533 fixtures .WithConfig (dir .Path ()),
36- fixtures .WithTrust ,
37- fixtures .WithNotary ,
3834 fixtures .WithPassphrase ("foo" , "bar" ),
3935 )
4036 result .Assert (t , icmd.Expected {
41- Out : "Signing and pushing trust metadata" ,
37+ Out : fmt . Sprintf ( "The push refers to repository [%s]" , pluginName ) ,
4238 })
4339
4440 icmd .RunCommand ("docker" , "plugin" , "rm" , "-f" , pluginName ).Assert (t , icmd .Success )
4541
4642 result = icmd .RunCmd (icmd .Command ("docker" , "plugin" , "install" , "--grant-all-permissions" , pluginName ),
4743 fixtures .WithConfig (dir .Path ()),
48- fixtures .WithTrust ,
49- fixtures .WithNotary ,
5044 )
5145 result .Assert (t , icmd.Expected {
5246 Out : "Installed plugin " + pluginName ,
5347 })
5448}
5549
56- func TestInstallWithContentTrustUntrusted (t * testing.T ) {
50+ func TestInstall (t * testing.T ) {
5751 skip .If (t , environment .SkipPluginTests ())
5852
59- dir := fixtures .SetupConfigFile (t )
60- defer dir .Remove ()
61-
62- result := icmd .RunCmd (icmd .Command ("docker" , "plugin" , "install" , "--grant-all-permissions" , "tiborvass/sample-volume-plugin:latest" ),
63- fixtures .WithConfig (dir .Path ()),
64- fixtures .WithTrust ,
65- fixtures .WithNotary ,
66- )
53+ const pluginName = "tiborvass/sample-volume-plugin:latest"
54+ result := icmd .RunCmd (icmd .Command ("docker" , "plugin" , "install" , "--grant-all-permissions" , pluginName ))
6755 result .Assert (t , icmd.Expected {
68- ExitCode : 1 ,
69- Err : "Error: remote trust data does not exist" ,
56+ Out : "Installed plugin " + pluginName ,
7057 })
7158}
0 commit comments