// Expect(os.Chmod(tmpFile.Name(), 0)).To(Succeed()) // err = dropletRunner.UploadBits("droplet-name", tmpFile.Name()) // Expect(err).To(HaveOccurred()) // Expect(fakeBlobBucket.PutReaderCallCount()).To(BeZero()) // }) }) Describe("BuildDroplet", func() { It("does the build droplet task", func() { config.SetBlobTarget("blob-host", 7474, "access-key", "secret-key", "bucket-name") config.Save() err := dropletRunner.BuildDroplet("task-name", "droplet-name", "buildpack", map[string]string{}) Expect(err).NotTo(HaveOccurred()) Expect(fakeTaskRunner.CreateTaskCallCount()).To(Equal(1)) createTaskParams := fakeTaskRunner.CreateTaskArgsForCall(0) Expect(createTaskParams).ToNot(BeNil()) receptorRequest := createTaskParams.GetReceptorRequest() expectedActions := &models.SerialAction{ Actions: []models.Action{ &models.DownloadAction{ From: "http://file_server.service.dc1.consul:8080/v1/static/lattice-cell-helpers.tgz", To: "/tmp", }, &models.RunAction{ Path: "/tmp/s3downloader",
fakeBlobStore.UploadDropletActionReturns(&models.RunAction{ Path: "/tmp/davtool", Dir: "/", Args: []string{"put", blobURL + "/droplet.tgz", "/tmp/droplet"}, User: "******", }) fakeBlobStore.UploadDropletMetadataActionReturns(&models.RunAction{ Path: "/tmp/davtool", Dir: "/", Args: []string{"put", blobURL + "/result.json", "/tmp/result.json"}, User: "******", }) err := dropletRunner.BuildDroplet("task-name", "droplet-name", "buildpack", map[string]string{}, 128, 100, 800) Expect(err).NotTo(HaveOccurred()) Expect(fakeTaskRunner.CreateTaskCallCount()).To(Equal(1)) createTaskParams := fakeTaskRunner.CreateTaskArgsForCall(0) Expect(createTaskParams).ToNot(BeNil()) receptorRequest := createTaskParams.GetReceptorRequest() expectedActions := &models.SerialAction{ Actions: []models.Action{ &models.DownloadAction{ From: "http://file_server.service.dc1.consul:8080/v1/static/lattice-cell-helpers.tgz", To: "/tmp", User: "******", }, &models.DownloadAction{
// Expect(os.Chmod(tmpFile.Name(), 0)).To(Succeed()) // err = dropletRunner.UploadBits("droplet-name", tmpFile.Name()) // Expect(err).To(HaveOccurred()) // Expect(fakeBlobBucket.PutReaderCallCount()).To(BeZero()) // }) }) Describe("BuildDroplet", func() { It("does the build droplet task", func() { config.SetBlobTarget("blob-host", 7474, "access-key", "secret-key", "bucket-name") config.Save() err := dropletRunner.BuildDroplet("task-name", "droplet-name", "buildpack") Expect(err).NotTo(HaveOccurred()) Expect(fakeTaskRunner.CreateTaskCallCount()).To(Equal(1)) createTaskParams := fakeTaskRunner.CreateTaskArgsForCall(0) Expect(createTaskParams).ToNot(BeNil()) receptorRequest := createTaskParams.GetReceptorRequest() expectedActions := &models.SerialAction{ Actions: []models.Action{ &models.DownloadAction{ From: "http://file_server.service.dc1.consul:8080/v1/static/lattice-support.tgz", To: "/tmp", }, &models.RunAction{ Path: "/tmp/s3downloader",