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

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/application/bundle_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:
34
34
// charm or bundle. The deployment output and error are returned.
35
35
func runDeployCommand(c *gc.C, id string, args ...string) (string, error) {
36
36
        args = append([]string{id}, args...)
37
 
        ctx, err := coretesting.RunCommand(c, NewDeployCommand(), args...)
 
37
        ctx, err := coretesting.RunCommand(c, NewDefaultDeployCommand(), args...)
38
38
        return strings.Trim(coretesting.Stderr(ctx), "\n"), err
39
39
}
40
40
 
546
546
        applications:
547
547
            wordpress:
548
548
                charm: wordpress
549
 
                constraints: mem=4G cpu-cores=2
 
549
                constraints: mem=4G cores=2
550
550
            customized:
551
551
                charm: precise/dummy-0
552
552
                num_units: 1
561
561
                },
562
562
                "wordpress": {
563
563
                        charm:       "cs:xenial/wordpress-42",
564
 
                        constraints: constraints.MustParse("mem=4G cpu-cores=2"),
 
564
                        constraints: constraints.MustParse("mem=4G cores=2"),
565
565
                },
566
566
        })
567
567
        s.assertUnitsCreated(c, map[string]string{
598
598
                num_units: 1
599
599
                options:
600
600
                    blog-title: new title
601
 
                constraints: spaces=new cpu-cores=8
 
601
                constraints: spaces=new cores=8
602
602
            up:
603
603
                charm: vivid/upgrade-2
604
604
                num_units: 1
610
610
                "wordpress": {
611
611
                        charm:       "cs:xenial/wordpress-42",
612
612
                        config:      charm.Settings{"blog-title": "new title"},
613
 
                        constraints: constraints.MustParse("spaces=new cpu-cores=8"),
 
613
                        constraints: constraints.MustParse("spaces=new cores=8"),
614
614
                },
615
615
        })
616
616
        s.assertUnitsCreated(c, map[string]string{
897
897
        machines:
898
898
            1:
899
899
                series: xenial
900
 
                constraints: "cpu-cores=4 mem=4G"
 
900
                constraints: "cores=4 mem=4G"
901
901
                annotations:
902
902
                    foo: bar
903
903
    `)
915
915
        c.Assert(m.Series(), gc.Equals, "xenial")
916
916
        cons, err := m.Constraints()
917
917
        c.Assert(err, jc.ErrorIsNil)
918
 
        expectedCons, err := constraints.Parse("cpu-cores=4 mem=4G")
 
918
        expectedCons, err := constraints.Parse("cores=4 mem=4G")
919
919
        c.Assert(err, jc.ErrorIsNil)
920
920
        c.Assert(cons, jc.DeepEquals, expectedCons)
921
921
        ann, err := s.State.Annotations(m)