Exemplo n.º 1
0
					})

					Context("when mounting fails", func() {
						It("returns error after trying to mount store migration directory", func() {
							platform.MountPersistentDiskErr = errors.New("fake-mount-persistent-disk-err")

							_, err := action.Run("fake-disk-cid")
							Expect(err).To(HaveOccurred())
							Expect(err.Error()).To(ContainSubstring("fake-mount-persistent-disk-err"))
						})
					})
				})

				Context("when store directory cannot be determined if it is mounted", func() {
					BeforeEach(func() {
						platform.IsMountPointErr = errors.New("fake-is-mount-point-err")
					})

					It("returns error", func() {
						_, err := action.Run("fake-disk-cid")
						Expect(err).To(HaveOccurred())
						Expect(err.Error()).To(ContainSubstring("fake-is-mount-point-err"))
					})

					It("does not try to mount disk", func() {
						_, err := action.Run("fake-disk-cid")
						Expect(err).To(HaveOccurred())
						Expect(platform.MountPersistentDiskCalled).To(BeFalse())
					})
				})
			})