@@ -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
@@ -34,39 +32,28 @@ func TestInstallWithContentTrust(t *testing.T) {
3432 icmd .RunCommand ("docker" , "plugin" , "create" , pluginName , pluginDir .Path ()).Assert (t , icmd .Success )
3533 result := icmd .RunCmd (icmd .Command ("docker" , "plugin" , "push" , pluginName ),
3634 fixtures .WithConfig (dir .Path ()),
37- fixtures .WithTrust ,
38- fixtures .WithNotary ,
3935 fixtures .WithPassphrase ("foo" , "bar" ),
4036 )
4137 result .Assert (t , icmd.Expected {
42- Out : "Signing and pushing trust metadata" ,
38+ Out : fmt . Sprintf ( "The push refers to repository [%s]" , pluginName ) ,
4339 })
4440
4541 icmd .RunCommand ("docker" , "plugin" , "rm" , "-f" , pluginName ).Assert (t , icmd .Success )
4642
4743 result = icmd .RunCmd (icmd .Command ("docker" , "plugin" , "install" , "--grant-all-permissions" , pluginName ),
4844 fixtures .WithConfig (dir .Path ()),
49- fixtures .WithTrust ,
50- fixtures .WithNotary ,
5145 )
5246 result .Assert (t , icmd.Expected {
5347 Out : "Installed plugin " + pluginName ,
5448 })
5549}
5650
57- func TestInstallWithContentTrustUntrusted (t * testing.T ) {
51+ func TestInstall (t * testing.T ) {
5852 skip .If (t , environment .SkipPluginTests ())
5953
60- dir := fixtures .SetupConfigFile (t )
61- defer dir .Remove ()
62-
63- result := icmd .RunCmd (icmd .Command ("docker" , "plugin" , "install" , "--grant-all-permissions" , "tiborvass/sample-volume-plugin:latest" ),
64- fixtures .WithConfig (dir .Path ()),
65- fixtures .WithTrust ,
66- fixtures .WithNotary ,
67- )
54+ const pluginName = "tiborvass/sample-volume-plugin:latest"
55+ result := icmd .RunCmd (icmd .Command ("docker" , "plugin" , "install" , "--grant-all-permissions" , pluginName ))
6856 result .Assert (t , icmd.Expected {
69- ExitCode : 1 ,
70- Err : "Error: remote trust data does not exist" ,
57+ Out : "Installed plugin " + pluginName ,
7158 })
7259}
0 commit comments