@@ -259,7 +259,12 @@ var _ = Describe("login command", func() {
259
259
input := NewBuffer ()
260
260
_ , err := input .Write ([]byte ("bad-passcode-again\n bad-passcode-strikes-back\n " ))
261
261
Expect (err ).ToNot (HaveOccurred ())
262
- session := helpers .CFWithStdin (input , "login" , "--sso-passcode" , "some-passcode" )
262
+ var session * Session
263
+ if skipSSLValidation {
264
+ session = helpers .CFWithStdin (input , "login" , "--sso-passcode" , "some-passcode" , "--skip-ssl-validation" )
265
+ } else {
266
+ session = helpers .CFWithStdin (input , "login" , "--sso-passcode" , "some-passcode" )
267
+ }
263
268
Eventually (session ).Should (Say ("API endpoint:\\ s+" + helpers .GetAPI ()))
264
269
Eventually (session ).Should (Say (`Authenticating\.\.\.` ))
265
270
Eventually (session .Err ).Should (Say (`Invalid passcode` ))
@@ -293,7 +298,12 @@ var _ = Describe("login command", func() {
293
298
When ("the user provides the --origin flag" , func () {
294
299
It ("logs in successfully" , func () {
295
300
username , password := helpers .GetCredentials ()
296
- session := helpers .CF ("login" , "-u" , username , "-p" , password , "--origin" , "uaa" )
301
+ var session * Session
302
+ if skipSSLValidation {
303
+ session = helpers .CF ("login" , "-u" , username , "-p" , password , "--origin" , "uaa" , "--skip-ssl-validation" )
304
+ } else {
305
+ session = helpers .CF ("login" , "-u" , username , "-p" , password , "--origin" , "uaa" )
306
+ }
297
307
Eventually (session ).Should (Say ("API endpoint:\\ s+" + helpers .GetAPI ()))
298
308
Eventually (session ).Should (Say (`Authenticating\.\.\.` ))
299
309
Eventually (session ).Should (Say (`OK` ))
@@ -402,7 +412,12 @@ var _ = Describe("login command", func() {
402
412
When ("the user provides the -p and -u flags" , func () {
403
413
Context ("and the credentials are correct" , func () {
404
414
It ("logs in successfully" , func () {
405
- session := helpers .CF ("login" , "-p" , password , "-u" , username )
415
+ var session * Session
416
+ if skipSSLValidation {
417
+ session = helpers .CF ("login" , "-p" , password , "-u" , username , "--skip-ssl-validation" )
418
+ } else {
419
+ session = helpers .CF ("login" , "-p" , password , "-u" , username )
420
+ }
406
421
Eventually (session ).Should (Say ("API endpoint:\\ s+" + helpers .GetAPI ()))
407
422
Eventually (session ).Should (Say (`Authenticating\.\.\.` ))
408
423
Eventually (session ).Should (Say (`OK` ))
@@ -567,7 +582,12 @@ var _ = Describe("login command", func() {
567
582
_ , err := input .Write ([]byte ("3\n " ))
568
583
Expect (err ).ToNot (HaveOccurred ())
569
584
570
- session := helpers .CFWithStdin (input , "login" , "-u" , username , "-p" , password )
585
+ var session * Session
586
+ if skipSSLValidation {
587
+ session = helpers .CFWithStdin (input , "login" , "-u" , username , "-p" , password , "--skip-ssl-validation" )
588
+ } else {
589
+ session = helpers .CFWithStdin (input , "login" , "-u" , username , "-p" , password )
590
+ }
571
591
572
592
Eventually (session ).Should (Say (regexp .QuoteMeta ("Select an org:" )))
573
593
Eventually (session ).Should (Say (regexp .QuoteMeta (`Org (enter to skip):` )))
0 commit comments