~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/worker/upgradesteps/worker_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
                        "aborted wait for other controllers:" + causeMsg},
293
293
        })
294
294
        c.Assert(statusCalls, jc.DeepEquals, []StatusCall{{
295
 
                status.StatusError,
 
295
                status.Error,
296
296
                fmt.Sprintf(
297
297
                        "upgrade to %s failed (giving up): aborted wait for other controllers:"+causeMsg,
298
298
                        jujuversion.Current),
389
389
        statusMessage := fmt.Sprintf(
390
390
                `upgrade to %s failed (giving up): %s`, jujuversion.Current, causeMessage)
391
391
        c.Assert(statusCalls, jc.DeepEquals, []StatusCall{{
392
 
                status.StatusError, statusMessage,
 
392
                status.Error, statusMessage,
393
393
        }})
394
394
}
395
395
 
502
502
 
503
503
func (s *UpgradeSuite) makeExpectedStatusCalls(retryCount int, expectFail bool, failReason string) []StatusCall {
504
504
        calls := []StatusCall{{
505
 
                status.StatusStarted,
 
505
                status.Started,
506
506
                fmt.Sprintf("upgrading to %s", jujuversion.Current),
507
507
        }}
508
508
        for i := 0; i < retryCount; i++ {
509
509
                calls = append(calls, StatusCall{
510
 
                        status.StatusError,
 
510
                        status.Error,
511
511
                        fmt.Sprintf("upgrade to %s failed (will retry): %s", jujuversion.Current, failReason),
512
512
                })
513
513
        }
514
514
        if expectFail {
515
515
                calls = append(calls, StatusCall{
516
 
                        status.StatusError,
 
516
                        status.Error,
517
517
                        fmt.Sprintf("upgrade to %s failed (giving up): %s", jujuversion.Current, failReason),
518
518
                })
519
519
        } else {
520
 
                calls = append(calls, StatusCall{status.StatusStarted, ""})
 
520
                calls = append(calls, StatusCall{status.Started, ""})
521
521
        }
522
522
        return calls
523
523
}