func (boot bootstrap) checkLastMountedCid(settings boshsettings.Settings) error { lastMountedCid, err := boot.lastMountedCid() if err != nil { return bosherr.WrapError(err, "Fetching last mounted disk CID") } if len(settings.Disks.Persistent) == 0 || lastMountedCid == "" { return nil } if _, ok := settings.PersistentDiskSettings(lastMountedCid); !ok { return fmt.Errorf("Attached disk disagrees with previous mount") } return nil }
package integration_test import ( "time" . "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/ginkgo" . "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/gomega" boshsettings "github.com/cloudfoundry/bosh-agent/settings" ) var _ = Describe("RawEphemeralDisk", func() { var ( registrySettings boshsettings.Settings ) BeforeEach(func() { err := testEnvironment.StopAgent() Expect(err).ToNot(HaveOccurred()) err = testEnvironment.CleanupDataDir() Expect(err).ToNot(HaveOccurred()) err = testEnvironment.CleanupLogFile() Expect(err).ToNot(HaveOccurred()) err = testEnvironment.SetupConfigDrive() Expect(err).ToNot(HaveOccurred()) err = testEnvironment.UpdateAgentConfig("config-drive-agent.json") Expect(err).ToNot(HaveOccurred())
package integration_test import ( "strings" "time" . "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/ginkgo" . "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/gomega" boshsettings "github.com/cloudfoundry/bosh-agent/settings" ) var _ = Describe("EphemeralDisk", func() { var ( registrySettings boshsettings.Settings ) BeforeEach(func() { err := testEnvironment.StopAgent() Expect(err).ToNot(HaveOccurred()) err = testEnvironment.CleanupDataDir() Expect(err).ToNot(HaveOccurred()) err = testEnvironment.CleanupLogFile() Expect(err).ToNot(HaveOccurred()) err = testEnvironment.SetupConfigDrive() Expect(err).ToNot(HaveOccurred()) err = testEnvironment.UpdateAgentConfig("config-drive-agent.json")