예제 #1
0
							{Name: "Migrating disk content from 'fake-existing-disk-cid' to 'fake-secondary-disk-cid'"},
							{
								Name:  "Detaching disk 'fake-existing-disk-cid'",
								Error: detachError,
							},
						}))
					})
				})

				Context("when migration to the new disk fails", func() {
					var (
						migrateError = bosherr.Error("fake-migrate-disk-error")
					)

					BeforeEach(func() {
						fakeVM.MigrateDiskErr = migrateError
					})

					It("returns error and leaves the existing disk attached", func() {
						_, err := diskDeployer.Deploy(diskPool, cloud, fakeVM, fakeStage)
						Expect(err).To(HaveOccurred())
						Expect(err.Error()).To(ContainSubstring("fake-migrate-disk-error"))
						Expect(fakeVM.DetachDiskInputs).To(Equal([]fakebivm.DetachDiskInput{}))

						Expect(fakeStage.PerformCalls).To(Equal([]*fakebiui.PerformCall{
							{Name: "Attaching disk 'fake-existing-disk-cid' to VM 'fake-vm-cid'"},
							{Name: "Creating disk"},
							{Name: "Attaching disk 'fake-secondary-disk-cid' to VM 'fake-vm-cid'"},
							{
								Name:  "Migrating disk content from 'fake-existing-disk-cid' to 'fake-secondary-disk-cid'",
								Error: migrateError,