} testhelpers.SetTestFixturesForFakeSoftLayerClient(fakeSoftLayerClient, fileNames) }) It("attaches the iSCSI volume successfully (multipath-tool installed)", func() { expectedCmdResults := []string{ "/sbin/multipath", "No devices found", "", "", "", "", "", expectedDmSetupLs1, } testhelpers.SetTestFixturesForFakeSSHClient(sshClient, expectedCmdResults, nil) vm = NewSoftLayerVM(1234567, fakeSoftLayerClient, sshClient, agentEnvService, logger) bslcommon.TIMEOUT = 2 * time.Second bslcommon.POLLING_INTERVAL = 1 * time.Second err := vm.AttachDisk(disk) Expect(err).ToNot(HaveOccurred()) }) It("attaches the iSCSI volume successfully (multipath-tool not installed)", func() { expectedCmdResults := []string{ "", expectedPartitions1, "", "", "",
BeforeEach(func() { logger = boshlog.NewLogger(boshlog.LevelNone) softLayerClient = fakeslclient.NewFakeSoftLayerClient("fake-username", "fake-api-key") sshClient = fakesutil.NewFakeSshClient() uuidGenerator = fakeuuid.NewFakeGenerator() fs = fakesys.NewFakeFileSystem() testhelpers.SetTestFixtureForFakeSoftLayerClient(softLayerClient, "SoftLayer_Virtual_Guest_Service_getObject.json") }) Describe("Upload", func() { It("file contents into /var/vcap/file.ext", func() { expectedCmdResults := []string{ "", } testhelpers.SetTestFixturesForFakeSSHClient(sshClient, expectedCmdResults, nil) var virtualGuestService softlayer.SoftLayer_Virtual_Guest_Service virtualGuestService, err := softLayerClient.GetSoftLayer_Virtual_Guest_Service() Expect(err).ToNot(HaveOccurred()) virtualGuest, err := virtualGuestService.GetObject(1234567) Expect(err).ToNot(HaveOccurred()) softlayerFileService = NewSoftlayerFileService(sshClient, virtualGuest, logger, uuidGenerator, fs) err = softlayerFileService.Upload("/var/vcap/file.ext", []byte("fake-contents")) Expect(err).ToNot(HaveOccurred()) }) }) Describe("Download", func() { It("copies agent env into temporary location", func() {