) var _ = Describe("mappedDevicePathResolver", func() { var ( fs boshsys.FileSystem resolver DevicePathResolver ) BeforeEach(func() { fs = fakesys.NewFakeFileSystem() resolver = NewMappedDevicePathResolver(time.Second, fs) }) Context("when a matching /dev/xvdX device is found", func() { BeforeEach(func() { fs.WriteFile("/dev/xvda", []byte{}) fs.WriteFile("/dev/vda", []byte{}) fs.WriteFile("/dev/sda", []byte{}) }) It("returns the match", func() { realPath, err := resolver.GetRealDevicePath("/dev/sda") Expect(err).NotTo(HaveOccurred()) Expect(realPath).To(Equal("/dev/xvda")) }) }) Context("when a matching /dev/vdX device is found", func() { BeforeEach(func() { fs.WriteFile("/dev/vda", []byte{}) fs.WriteFile("/dev/sda", []byte{})