} }) Describe("GetRealDevicePath", func() { It("refreshes udev", func() { pathResolver.GetRealDevicePath(diskSettings) Expect(udev.Triggered).To(Equal(true)) Expect(udev.Settled).To(Equal(true)) }) Context("when path exists", func() { BeforeEach(func() { err := fs.MkdirAll("fake-device-path", os.FileMode(0750)) Expect(err).ToNot(HaveOccurred()) err = fs.Symlink("fake-device-path", "/dev/disk/by-id/virtio-fake-disk-id-include") Expect(err).ToNot(HaveOccurred()) }) It("returns the path ", func() { path, timeout, err := pathResolver.GetRealDevicePath(diskSettings) Expect(err).ToNot(HaveOccurred()) Expect(path).To(Equal("fake-device-path")) Expect(timeout).To(BeFalse()) }) }) Context("when path does not exist", func() { BeforeEach(func() { err := fs.Symlink("fake-device-path", "/dev/disk/by-id/virtio-fake-disk-id-include")