@@ -205,9 +205,30 @@ func TestLoginCommandDelegation(t *testing.T) {
205
205
})
206
206
})
207
207
208
+ t .Run ("localhost registry interactive" , func (t * testing.T ) {
209
+ res := c .RunDockerOrExitError ("login" , "localhost:443" )
210
+ res .Assert (t , icmd.Expected {
211
+ ExitCode : 1 ,
212
+ Err : "Cannot perform an interactive login from a non TTY device" ,
213
+ })
214
+ })
215
+
216
+ t .Run ("localhost registry" , func (t * testing.T ) {
217
+ res := c .RunDockerOrExitError ("login" , "localhost" , "-u" , "user" , "-p" , "password" )
218
+ res .Assert (t , icmd.Expected {
219
+ ExitCode : 1 ,
220
+ Err : "http://localhost/v2/" ,
221
+ })
222
+ })
223
+
208
224
t .Run ("logout" , func (t * testing.T ) {
209
225
res := c .RunDockerCmd ("logout" , "someregistry.docker.io" )
210
- res .Assert (t , icmd.Expected {Out : "someregistry.docker.io" })
226
+ res .Assert (t , icmd.Expected {Out : "Removing login credentials for someregistry.docker.io" })
227
+ })
228
+
229
+ t .Run ("logout" , func (t * testing.T ) {
230
+ res := c .RunDockerCmd ("logout" , "localhost:443" )
231
+ res .Assert (t , icmd.Expected {Out : "Removing login credentials for localhost:443" })
211
232
})
212
233
213
234
t .Run ("existing context" , func (t * testing.T ) {
@@ -221,18 +242,6 @@ func TestLoginCommandDelegation(t *testing.T) {
221
242
})
222
243
}
223
244
224
- func TestCloudLogin (t * testing.T ) {
225
- c := NewParallelE2eCLI (t , binDir )
226
-
227
- t .Run ("unknown backend" , func (t * testing.T ) {
228
- res := c .RunDockerOrExitError ("login" , "mycloudbackend" )
229
- res .Assert (t , icmd.Expected {
230
- ExitCode : 1 ,
231
- Err : "unknown backend type for cloud login: mycloudbackend" ,
232
- })
233
- })
234
- }
235
-
236
245
func TestMissingExistingCLI (t * testing.T ) {
237
246
t .Parallel ()
238
247
home , err := ioutil .TempDir ("" , "" )
0 commit comments