71
72
added wordpress/0 unit to new machine
72
73
deployment of bundle "cs:bundle/wordpress-simple-1" completed`
73
74
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
74
s.assertCharmsUplodaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-47")
75
s.assertCharmsUploaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-47")
75
76
s.assertServicesDeployed(c, map[string]serviceInfo{
76
77
"mysql": {charm: "cs:trusty/mysql-42"},
77
78
"wordpress": {charm: "cs:trusty/wordpress-47"},
98
99
added terms2/0 unit to new machine
99
100
deployment of bundle "cs:bundle/terms-simple-1" completed`
100
101
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
101
s.assertCharmsUplodaded(c, "cs:trusty/terms1-17", "cs:trusty/terms2-42")
102
s.assertCharmsUploaded(c, "cs:trusty/terms1-17", "cs:trusty/terms2-42")
102
103
s.assertServicesDeployed(c, map[string]serviceInfo{
103
104
"terms1": {charm: "cs:trusty/terms1-17"},
104
105
"terms2": {charm: "cs:trusty/terms2-42"},
129
130
added wordpress/0 unit to new machine
130
131
deployment of bundle "cs:bundle/wordpress-with-mysql-storage-1" completed`
131
132
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
132
s.assertCharmsUplodaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-47")
133
s.assertCharmsUploaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-47")
133
134
s.assertServicesDeployed(c, map[string]serviceInfo{
135
136
charm: "cs:trusty/mysql-42",
150
151
func (s *DeployCharmStoreSuite) TestDeployBundleEndpointBindingsSpaceMissing(c *gc.C) {
151
152
testcharms.UploadCharm(c, s.client, "trusty/mysql-42", "mysql")
152
testcharms.UploadCharm(c, s.client, "trusty/wordpress-47", "wordpress")
153
testcharms.UploadCharm(c, s.client, "trusty/wordpress-extra-bindings-47", "wordpress-extra-bindings")
153
154
testcharms.UploadBundle(c, s.client, "bundle/wordpress-with-endpoint-bindings-1", "wordpress-with-endpoint-bindings")
154
155
output, err := runDeployCommand(c, "bundle/wordpress-with-endpoint-bindings")
155
156
c.Assert(err, gc.ErrorMatches,
156
157
"cannot deploy bundle: cannot deploy service \"mysql\": "+
157
158
"cannot add service \"mysql\": unknown space \"db\" not valid")
158
159
c.Assert(output, gc.Equals, "added charm cs:trusty/mysql-42")
159
s.assertCharmsUplodaded(c, "cs:trusty/mysql-42")
160
s.assertCharmsUploaded(c, "cs:trusty/mysql-42")
160
161
s.assertServicesDeployed(c, map[string]serviceInfo{})
161
162
s.assertUnitsCreated(c, map[string]string{})
168
169
c.Assert(err, jc.ErrorIsNil)
170
171
testcharms.UploadCharm(c, s.client, "trusty/mysql-42", "mysql")
171
testcharms.UploadCharm(c, s.client, "trusty/wordpress-47", "wordpress")
172
testcharms.UploadCharm(c, s.client, "trusty/wordpress-extra-bindings-47", "wordpress-extra-bindings")
172
173
testcharms.UploadBundle(c, s.client, "bundle/wordpress-with-endpoint-bindings-1", "wordpress-with-endpoint-bindings")
173
174
output, err := runDeployCommand(c, "bundle/wordpress-with-endpoint-bindings")
174
175
c.Assert(err, jc.ErrorIsNil)
175
176
expectedOutput := `
176
177
added charm cs:trusty/mysql-42
177
178
service mysql deployed (charm: cs:trusty/mysql-42)
178
added charm cs:trusty/wordpress-47
179
service wordpress deployed (charm: cs:trusty/wordpress-47)
180
related wordpress:db and mysql:server
179
added charm cs:trusty/wordpress-extra-bindings-47
180
service wordpress-extra-bindings deployed (charm: cs:trusty/wordpress-extra-bindings-47)
181
related wordpress-extra-bindings:db and mysql:server
181
182
added mysql/0 unit to new machine
182
added wordpress/0 unit to new machine
183
added wordpress-extra-bindings/0 unit to new machine
183
184
deployment of bundle "cs:bundle/wordpress-with-endpoint-bindings-1" completed`
184
185
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
185
s.assertCharmsUplodaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-47")
186
s.assertCharmsUploaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-extra-bindings-47")
187
188
s.assertServicesDeployed(c, map[string]serviceInfo{
188
"mysql": {charm: "cs:trusty/mysql-42"},
189
"wordpress": {charm: "cs:trusty/wordpress-47"},
189
"mysql": {charm: "cs:trusty/mysql-42"},
190
"wordpress-extra-bindings": {charm: "cs:trusty/wordpress-extra-bindings-47"},
191
192
s.assertDeployedServiceBindings(c, map[string]serviceInfo{
193
194
endpointBindings: map[string]string{"server": "db"},
196
"wordpress-extra-bindings": {
196
197
endpointBindings: map[string]string{
199
200
"logging-dir": "",
200
201
"monitoring-port": "",
205
"admin-api": "public",
205
s.assertRelationsEstablished(c, "wordpress:db mysql:server")
210
s.assertRelationsEstablished(c, "wordpress-extra-bindings:cluster", "wordpress-extra-bindings:db mysql:server")
206
211
s.assertUnitsCreated(c, map[string]string{
213
"wordpress-extra-bindings/0": "1",
227
232
avoid adding new units to service wordpress: 1 unit already present
228
233
deployment of bundle "cs:bundle/wordpress-simple-1" completed`
229
234
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
230
s.assertCharmsUplodaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-47")
235
s.assertCharmsUploaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-47")
231
236
s.assertServicesDeployed(c, map[string]serviceInfo{
232
237
"mysql": {charm: "cs:trusty/mysql-42"},
233
238
"wordpress": {charm: "cs:trusty/wordpress-47"},
246
251
testcharms.UploadBundle(c, s.client, "bundle/wordpress-simple-1", "wordpress-simple")
247
252
_, err := runDeployCommand(c, "bundle/wordpress-simple")
248
253
c.Assert(err, jc.ErrorIsNil)
249
s.assertCharmsUplodaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-47")
254
s.assertCharmsUploaded(c, "cs:trusty/mysql-42", "cs:trusty/wordpress-47")
250
255
s.assertServicesDeployed(c, map[string]serviceInfo{
251
256
"mysql": {charm: "cs:trusty/mysql-42"},
252
257
"wordpress": {charm: "cs:trusty/wordpress-47"},
272
277
added wordpress/0 unit to new machine
273
278
deployment of bundle %q completed`, path)
274
279
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
275
s.assertCharmsUplodaded(c, "cs:trusty/wordpress-47")
280
s.assertCharmsUploaded(c, "cs:trusty/wordpress-47")
276
281
s.assertServicesDeployed(c, map[string]serviceInfo{
277
282
"wordpress": {charm: "cs:trusty/wordpress-47"},
287
292
c.Assert(err, gc.ErrorMatches, `cannot deploy bundle: .*: unauthorized: access denied for user "client-username"`)
290
type deployRepoCharmStoreSuite struct {
295
type DeployRepoCharmStoreSuite struct {
292
297
testing.BaseRepoSuite
299
Client *csclient.Client
295
var _ = gc.Suite(&deployRepoCharmStoreSuite{})
302
var _ = gc.Suite(&DeployRepoCharmStoreSuite{})
297
func (s *deployRepoCharmStoreSuite) SetUpSuite(c *gc.C) {
304
func (s *DeployRepoCharmStoreSuite) SetUpSuite(c *gc.C) {
298
305
s.charmStoreSuite.SetUpSuite(c)
299
306
s.BaseRepoSuite.SetUpSuite(c)
307
s.PatchValue(&watcher.Period, 10*time.Millisecond)
302
func (s *deployRepoCharmStoreSuite) TearDownSuite(c *gc.C) {
310
func (s *DeployRepoCharmStoreSuite) TearDownSuite(c *gc.C) {
303
311
s.BaseRepoSuite.TearDownSuite(c)
304
312
s.charmStoreSuite.TearDownSuite(c)
307
func (s *deployRepoCharmStoreSuite) SetUpTest(c *gc.C) {
308
s.PatchValue(&watcher.Period, 10*time.Millisecond)
315
func (s *DeployRepoCharmStoreSuite) SetUpTest(c *gc.C) {
309
316
s.charmStoreSuite.SetUpTest(c)
310
317
s.BaseRepoSuite.SetUpTest(c)
313
func (s *deployRepoCharmStoreSuite) TearDownTest(c *gc.C) {
322
func (s *DeployRepoCharmStoreSuite) TearDownTest(c *gc.C) {
314
323
s.BaseRepoSuite.TearDownTest(c)
315
324
s.charmStoreSuite.TearDownTest(c)
318
// deployBundleYAML uses the given bundle content to create a bundle in the
327
// DeployBundleYAML uses the given bundle content to create a bundle in the
319
328
// local repository and then deploy it. It returns the bundle deployment output
321
func (s *deployRepoCharmStoreSuite) deployBundleYAML(c *gc.C, content string) (string, error) {
330
func (s *DeployRepoCharmStoreSuite) DeployBundleYAML(c *gc.C, content string) (string, error) {
322
331
bundlePath := filepath.Join(s.BundlesPath, "example")
323
332
c.Assert(os.Mkdir(bundlePath, 0777), jc.ErrorIsNil)
324
333
defer os.RemoveAll(bundlePath)
374
390
constraints: bad-wolf
376
err: `cannot deploy bundle: invalid constraints "bad-wolf" in service "mysql": malformed constraint "bad-wolf"`,
392
err: `the provided bundle has the following errors:
393
invalid constraints "bad-wolf" in service "mysql": malformed constraint "bad-wolf"`,
395
about: "multiple bundle verification errors",
401
constraints: bad-wolf
403
err: `the provided bundle has the following errors:
404
invalid constraints "bad-wolf" in service "mysql": malformed constraint "bad-wolf"
405
negative number of units specified on service "mysql"`,
378
407
about: "bundle inception",
388
417
func (s *deployRepoCharmStoreSuite) TestDeployBundleErrors(c *gc.C) {
389
418
for i, test := range deployBundleErrorsTests {
390
419
c.Logf("test %d: %s", i, test.about)
391
_, err := s.deployBundleYAML(c, test.content)
420
_, err := s.DeployBundleYAML(c, test.content)
392
421
c.Assert(err, gc.ErrorMatches, test.err)
396
425
func (s *deployRepoCharmStoreSuite) TestDeployBundleInvalidOptions(c *gc.C) {
397
426
testcharms.UploadCharm(c, s.client, "trusty/wordpress-42", "wordpress")
398
_, err := s.deployBundleYAML(c, `
427
_, err := s.DeployBundleYAML(c, `
401
430
charm: trusty/wordpress-42
409
438
func (s *deployRepoCharmStoreSuite) TestDeployBundleInvalidMachineContainerType(c *gc.C) {
410
439
testcharms.UploadCharm(c, s.client, "trusty/wordpress-42", "wordpress")
411
_, err := s.deployBundleYAML(c, `
440
_, err := s.DeployBundleYAML(c, `
414
443
charm: trusty/wordpress
423
452
func (s *deployRepoCharmStoreSuite) TestDeployBundleInvalidSeries(c *gc.C) {
424
453
testcharms.UploadCharm(c, s.client, "vivid/django-0", "dummy")
425
_, err := s.deployBundleYAML(c, `
454
_, err := s.DeployBundleYAML(c, `
428
457
charm: vivid/django
453
482
testcharms.UploadCharm(c, s.client, "trusty/django-0", "dummy")
454
483
testcharms.UploadCharm(c, s.client, "trusty/wordpress-0", "wordpress")
455
484
s.PatchValue(&updateUnitStatusPeriod, 0*time.Second)
456
_, err := s.deployBundleYAML(c, `
485
_, err := s.DeployBundleYAML(c, `
469
498
func (s *deployRepoCharmStoreSuite) TestDeployBundleLocalDeployment(c *gc.C) {
470
499
testcharms.Repo.ClonedDirPath(s.SeriesPath, "mysql")
471
500
testcharms.Repo.ClonedDirPath(s.SeriesPath, "wordpress")
472
output, err := s.deployBundleYAML(c, `
501
output, err := s.DeployBundleYAML(c, `
475
504
charm: local:wordpress
492
521
added wordpress/0 unit to new machine
493
522
deployment of bundle "local:bundle/example-0" completed`
494
523
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
495
s.assertCharmsUplodaded(c, "local:trusty/mysql-1", "local:trusty/wordpress-3")
524
s.assertCharmsUploaded(c, "local:trusty/mysql-1", "local:trusty/wordpress-3")
496
525
s.assertServicesDeployed(c, map[string]serviceInfo{
497
526
"mysql": {charm: "local:trusty/mysql-1"},
498
527
"wordpress": {charm: "local:trusty/wordpress-3"},
537
func (s *deployRepoCharmStoreSuite) TestDeployBundleFromBundlePath(c *gc.C) {
538
testcharms.Repo.ClonedDirPath(s.SeriesPath, "wordpress")
539
bundlePath := filepath.Join(c.MkDir(), "example")
540
err := os.Mkdir(bundlePath, 0777)
541
c.Assert(err, jc.ErrorIsNil)
542
err = ioutil.WriteFile(filepath.Join(bundlePath, "bundle.yaml"), []byte(`
545
charm: local:wordpress
548
c.Assert(err, jc.ErrorIsNil)
549
err = ioutil.WriteFile(filepath.Join(bundlePath, "README.md"), []byte("README"), 0644)
550
c.Assert(err, jc.ErrorIsNil)
551
_, err = runDeployCommand(c, bundlePath)
552
c.Assert(err, jc.ErrorIsNil)
508
555
func (s *deployRepoCharmStoreSuite) TestDeployBundleLocalAndCharmStoreCharms(c *gc.C) {
509
556
testcharms.UploadCharm(c, s.client, "trusty/wordpress-42", "wordpress")
510
557
testcharms.Repo.ClonedDirPath(s.SeriesPath, "mysql")
511
output, err := s.deployBundleYAML(c, `
558
output, err := s.DeployBundleYAML(c, `
514
561
charm: trusty/wordpress-42
530
577
added wordpress/0 unit to new machine
531
578
deployment of bundle "local:bundle/example-0" completed`
532
579
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
533
s.assertCharmsUplodaded(c, "local:trusty/mysql-1", "cs:trusty/wordpress-42")
580
s.assertCharmsUploaded(c, "local:trusty/mysql-1", "cs:trusty/wordpress-42")
534
581
s.assertServicesDeployed(c, map[string]serviceInfo{
535
582
"mysql": {charm: "local:trusty/mysql-1"},
536
583
"wordpress": {charm: "cs:trusty/wordpress-42"},
545
592
func (s *deployRepoCharmStoreSuite) TestDeployBundleServiceOptions(c *gc.C) {
546
593
testcharms.UploadCharm(c, s.client, "trusty/wordpress-42", "wordpress")
547
594
testcharms.UploadCharm(c, s.client, "precise/dummy-0", "dummy")
548
output, err := s.deployBundleYAML(c, `
595
output, err := s.DeployBundleYAML(c, `
569
616
added wordpress/0 unit to new machine
570
617
deployment of bundle "local:bundle/example-0" completed`
571
618
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
572
s.assertCharmsUplodaded(c, "cs:precise/dummy-0", "cs:trusty/wordpress-42")
619
s.assertCharmsUploaded(c, "cs:precise/dummy-0", "cs:trusty/wordpress-42")
573
620
s.assertServicesDeployed(c, map[string]serviceInfo{
575
622
charm: "cs:precise/dummy-0",
589
636
func (s *deployRepoCharmStoreSuite) TestDeployBundleServiceConstrants(c *gc.C) {
590
637
testcharms.UploadCharm(c, s.client, "trusty/wordpress-42", "wordpress")
591
638
testcharms.UploadCharm(c, s.client, "precise/dummy-0", "dummy")
592
output, err := s.deployBundleYAML(c, `
639
output, err := s.DeployBundleYAML(c, `
608
655
added customized/0 unit to new machine
609
656
deployment of bundle "local:bundle/example-0" completed`
610
657
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
611
s.assertCharmsUplodaded(c, "cs:precise/dummy-0", "cs:trusty/wordpress-42")
658
s.assertCharmsUploaded(c, "cs:precise/dummy-0", "cs:trusty/wordpress-42")
612
659
s.assertServicesDeployed(c, map[string]serviceInfo{
614
661
charm: "cs:precise/dummy-0",
652
699
added wordpress/0 unit to new machine
653
700
deployment of bundle "local:bundle/example-0" completed`
654
701
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
655
s.assertCharmsUplodaded(c, "cs:vivid/upgrade-1", "cs:trusty/wordpress-42")
702
s.assertCharmsUploaded(c, "cs:vivid/upgrade-1", "cs:trusty/wordpress-42")
657
704
// Then deploy a new bundle with modified charm revision and options.
658
output, err = s.deployBundleYAML(c, `
705
output, err = s.DeployBundleYAML(c, `
679
726
avoid adding new units to service wordpress: 1 unit already present
680
727
deployment of bundle "local:bundle/example-0" completed`
681
728
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
682
s.assertCharmsUplodaded(c, "cs:vivid/upgrade-1", "cs:vivid/upgrade-2", "cs:trusty/wordpress-42")
729
s.assertCharmsUploaded(c, "cs:vivid/upgrade-1", "cs:vivid/upgrade-2", "cs:trusty/wordpress-42")
683
730
s.assertServicesDeployed(c, map[string]serviceInfo{
684
731
"up": {charm: "cs:vivid/upgrade-2"},
713
760
// First deploy the bundle.
714
output, err := s.deployBundleYAML(c, content)
761
output, err := s.DeployBundleYAML(c, content)
715
762
c.Assert(err, jc.ErrorIsNil)
716
763
expectedOutput := `
717
764
added charm cs:trusty/wordpress-42
725
772
// Then deploy the same bundle again: no error is produced when the service
726
773
// is exposed again.
727
output, err = s.deployBundleYAML(c, content)
774
output, err = s.DeployBundleYAML(c, content)
728
775
c.Assert(err, jc.ErrorIsNil)
729
776
expectedOutput = `
730
777
added charm cs:trusty/wordpress-42
760
807
// Try upgrading to a different charm name.
761
808
testcharms.UploadCharm(c, s.client, "trusty/incompatible-42", "wordpress")
762
_, err := s.deployBundleYAML(c, `
809
_, err := s.DeployBundleYAML(c, `
765
812
charm: trusty/incompatible-42
768
815
c.Assert(err, gc.ErrorMatches, `cannot deploy bundle: cannot upgrade service "wordpress": bundle charm "cs:trusty/incompatible-42" is incompatible with existing charm "local:quantal/wordpress-3"`)
817
// Try upgrading to a different series.
818
// Note that this test comes before the next one because
819
// otherwise we can't resolve the charm URL because the charm's
820
// "base entity" is not marked as promulgated so the query by
821
// promulgated will find it.
822
testcharms.UploadCharm(c, s.client, "vivid/wordpress-42", "wordpress")
823
_, err = s.DeployBundleYAML(c, `
826
charm: vivid/wordpress
829
c.Assert(err, gc.ErrorMatches, `cannot deploy bundle: cannot upgrade service "wordpress": bundle charm "cs:vivid/wordpress-42" is incompatible with existing charm "local:quantal/wordpress-3"`)
770
831
// Try upgrading to a different user.
771
832
testcharms.UploadCharm(c, s.client, "~who/trusty/wordpress-42", "wordpress")
772
_, err = s.deployBundleYAML(c, `
833
_, err = s.DeployBundleYAML(c, `
775
836
charm: cs:~who/trusty/wordpress-42
778
839
c.Assert(err, gc.ErrorMatches, `cannot deploy bundle: cannot upgrade service "wordpress": bundle charm "cs:~who/trusty/wordpress-42" is incompatible with existing charm "local:quantal/wordpress-3"`)
780
// Try upgrading to a different series.
781
testcharms.UploadCharm(c, s.client, "vivid/wordpress-42", "wordpress")
782
_, err = s.deployBundleYAML(c, `
785
charm: vivid/wordpress
788
c.Assert(err, gc.ErrorMatches, `cannot deploy bundle: cannot upgrade service "wordpress": bundle charm "cs:vivid/wordpress-42" is incompatible with existing charm "local:quantal/wordpress-3"`)
791
842
func (s *deployRepoCharmStoreSuite) TestDeployBundleMultipleRelations(c *gc.C) {
793
844
testcharms.UploadCharm(c, s.client, "trusty/mysql-1", "mysql")
794
845
testcharms.UploadCharm(c, s.client, "trusty/postgres-2", "mysql")
795
846
testcharms.UploadCharm(c, s.client, "trusty/varnish-3", "varnish")
796
output, err := s.deployBundleYAML(c, `
847
output, err := s.DeployBundleYAML(c, `
845
896
testcharms.UploadCharm(c, s.client, "trusty/mysql-1", "mysql")
846
897
testcharms.UploadCharm(c, s.client, "trusty/postgres-2", "mysql")
847
898
testcharms.UploadCharm(c, s.client, "trusty/varnish-3", "varnish")
848
_, err := s.deployBundleYAML(c, `
899
_, err := s.DeployBundleYAML(c, `
950
1001
s.assertRelationsEstablished(c)
951
s.assertUnitsCreated(c, map[string]string{
1003
// We explicitly pull out the map creation in the call to
1004
// s.assertUnitsCreated() and create the map as a new variable
1005
// because this /appears/ to tickle a bug on ppc64le using
1006
// gccgo-4.9; the bug is that the map on the receiving side
1007
// does not have the same contents as it does here - which is
1008
// weird because that pattern is used elsewhere in this
1009
// function. And just pulling the map instantiation out of the
1010
// call is not enough; we need to do something benign with the
1011
// variable to keep a reference beyond the call to the
1012
// s.assertUnitsCreated(). I have to chosen to delete a
1013
// non-existent key. This problem does not occur on amd64
1014
// using gc or gccgo-4.9. Nor does it happen using go1.6 on
1015
// ppc64. Once we switch to go1.6 across the board this change
1016
// should be reverted. See http://pad.lv/1556116.
1017
expectedUnits := map[string]string{
952
1018
"sql/0": "0/lxc/0",
955
1021
"wp/1": "1/lxc/0",
1023
s.assertUnitsCreated(c, expectedUnits)
1024
delete(expectedUnits, "non-existent")
958
1026
// Redeploy the same bundle again.
959
output, err = s.deployBundleYAML(c, content)
1027
output, err = s.DeployBundleYAML(c, content)
960
1028
c.Assert(err, jc.ErrorIsNil)
961
1029
expectedOutput = `
962
1030
added charm cs:trusty/mysql-2
981
1049
func (s *deployRepoCharmStoreSuite) TestDeployBundleMachineAttributes(c *gc.C) {
982
1050
testcharms.UploadCharm(c, s.client, "trusty/django-42", "dummy")
983
output, err := s.deployBundleYAML(c, `
1051
output, err := s.DeployBundleYAML(c, `
986
1054
charm: cs:trusty/django-42
1030
1098
func (s *deployRepoCharmStoreSuite) TestDeployBundleTwiceScaleUp(c *gc.C) {
1031
1099
testcharms.UploadCharm(c, s.client, "trusty/django-42", "dummy")
1032
_, err := s.deployBundleYAML(c, `
1100
_, err := s.DeployBundleYAML(c, `
1035
1103
charm: cs:trusty/django-42
1038
1106
c.Assert(err, jc.ErrorIsNil)
1039
output, err := s.deployBundleYAML(c, `
1107
output, err := s.DeployBundleYAML(c, `
1042
1110
charm: cs:trusty/django-42
1064
1132
func (s *deployRepoCharmStoreSuite) TestDeployBundleUnitPlacedInService(c *gc.C) {
1065
1133
testcharms.UploadCharm(c, s.client, "trusty/django-42", "dummy")
1066
1134
testcharms.UploadCharm(c, s.client, "trusty/wordpress-0", "wordpress")
1067
output, err := s.deployBundleYAML(c, `
1135
output, err := s.DeployBundleYAML(c, `
1070
1138
charm: wordpress
1100
1168
testcharms.UploadCharm(c, s.client, "trusty/django-42", "dummy")
1101
1169
testcharms.UploadCharm(c, s.client, "trusty/mem-47", "dummy")
1102
1170
testcharms.UploadCharm(c, s.client, "trusty/rails-0", "dummy")
1103
output, err := s.deployBundleYAML(c, `
1171
output, err := s.DeployBundleYAML(c, `
1106
1174
charm: cs:trusty/mem-47
1169
1237
func (s *deployRepoCharmStoreSuite) TestDeployBundleUnitPlacedToMachines(c *gc.C) {
1170
1238
testcharms.UploadCharm(c, s.client, "trusty/django-42", "dummy")
1171
output, err := s.deployBundleYAML(c, `
1239
output, err := s.DeployBundleYAML(c, `
1174
1242
charm: cs:django
1220
1288
testcharms.UploadCharm(c, s.client, "trusty/django-42", "dummy")
1221
1289
testcharms.UploadCharm(c, s.client, "trusty/mem-47", "dummy")
1222
1290
testcharms.UploadCharm(c, s.client, "trusty/rails-0", "dummy")
1223
output, err := s.deployBundleYAML(c, `
1291
output, err := s.DeployBundleYAML(c, `
1226
1294
charm: cs:trusty/mem-47
1325
1393
c.Assert(output, gc.Equals, strings.TrimSpace(expectedOutput))
1327
1395
// Redeploy the same bundle again and check that nothing happens.
1328
output, err = s.deployBundleYAML(c, content)
1396
output, err = s.DeployBundleYAML(c, content)
1329
1397
c.Assert(err, jc.ErrorIsNil)
1330
1398
expectedOutput = `
1331
1399
added charm cs:trusty/django-42
1358
1426
func (s *deployRepoCharmStoreSuite) TestDeployBundleAnnotations(c *gc.C) {
1359
1427
testcharms.UploadCharm(c, s.client, "trusty/django-42", "dummy")
1360
1428
testcharms.UploadCharm(c, s.client, "trusty/mem-47", "dummy")
1361
output, err := s.deployBundleYAML(c, `
1429
output, err := s.DeployBundleYAML(c, `
1364
1432
charm: cs:django