@@ -145,14 +145,14 @@ func TestPromptExitCode(t *testing.T) {
145
145
t .Helper ()
146
146
skip .If (t , versions .LessThan (environment .DaemonAPIVersion (t ), "1.44" ))
147
147
148
- pluginDir := testutils .SetupPlugin (t , ctx )
149
- t .Cleanup (pluginDir .Remove )
150
-
151
- plugin := "registry:5000/plugin-content-trust-install:latest"
148
+ const plugin = "registry:5000/plugin-install-test:latest"
152
149
153
- icmd .RunCommand ("docker" , "plugin" , "create" , plugin , pluginDir .Path ()).Assert (t , icmd .Success )
150
+ pluginDir := testutils .SetupPlugin (t , ctx )
151
+ icmd .RunCommand ("docker" , "plugin" , "create" , plugin , pluginDir ).Assert (t , icmd .Success )
154
152
icmd .RunCmd (icmd .Command ("docker" , "plugin" , "push" , plugin ), defaultCmdOpts ... ).Assert (t , icmd .Success )
155
153
icmd .RunCmd (icmd .Command ("docker" , "plugin" , "rm" , "-f" , plugin ), defaultCmdOpts ... ).Assert (t , icmd .Success )
154
+
155
+ // Test prompt to grant privileges.
156
156
return icmd .Command ("docker" , "plugin" , "install" , plugin )
157
157
},
158
158
},
@@ -162,20 +162,22 @@ func TestPromptExitCode(t *testing.T) {
162
162
t .Helper ()
163
163
skip .If (t , versions .LessThan (environment .DaemonAPIVersion (t ), "1.44" ))
164
164
165
- pluginLatestDir := testutils .SetupPlugin (t , ctx )
166
- t .Cleanup (pluginLatestDir .Remove )
167
- pluginNextDir := testutils .SetupPlugin (t , ctx )
168
- t .Cleanup (pluginNextDir .Remove )
169
-
170
- plugin := "registry:5000/plugin-content-trust-upgrade"
165
+ const plugin = "registry:5000/plugin-upgrade-test"
171
166
172
- icmd . RunCommand ( "docker" , "plugin" , "create" , plugin + ":latest" , pluginLatestDir . Path ()). Assert ( t , icmd . Success )
173
- icmd .RunCommand ("docker" , "plugin" , "create" , plugin + ":next " , pluginNextDir . Path () ).Assert (t , icmd .Success )
167
+ pluginLatestDir := testutils . SetupPlugin ( t , ctx )
168
+ icmd .RunCommand ("docker" , "plugin" , "create" , plugin + ":latest " , pluginLatestDir ).Assert (t , icmd .Success )
174
169
icmd .RunCmd (icmd .Command ("docker" , "plugin" , "push" , plugin + ":latest" ), defaultCmdOpts ... ).Assert (t , icmd .Success )
175
- icmd .RunCmd (icmd .Command ("docker" , "plugin" , "push" , plugin + ":next" ), defaultCmdOpts ... ).Assert (t , icmd .Success )
176
170
icmd .RunCmd (icmd .Command ("docker" , "plugin" , "rm" , "-f" , plugin + ":latest" ), defaultCmdOpts ... ).Assert (t , icmd .Success )
171
+
172
+ pluginNextDir := testutils .SetupPlugin (t , ctx )
173
+ icmd .RunCommand ("docker" , "plugin" , "create" , plugin + ":next" , pluginNextDir ).Assert (t , icmd .Success )
174
+ icmd .RunCmd (icmd .Command ("docker" , "plugin" , "push" , plugin + ":next" ), defaultCmdOpts ... ).Assert (t , icmd .Success )
177
175
icmd .RunCmd (icmd .Command ("docker" , "plugin" , "rm" , "-f" , plugin + ":next" ), defaultCmdOpts ... ).Assert (t , icmd .Success )
176
+
177
+ // Using "--grant-all-permissions" to disable prompting for confirmation.
178
178
icmd .RunCmd (icmd .Command ("docker" , "plugin" , "install" , "--disable" , "--grant-all-permissions" , plugin + ":latest" ), defaultCmdOpts ... ).Assert (t , icmd .Success )
179
+
180
+ // Test prompting for upgrade.
179
181
return icmd .Command ("docker" , "plugin" , "upgrade" , plugin + ":latest" , plugin + ":next" )
180
182
},
181
183
},
0 commit comments