Exemplo n.º 1
0
	stderrBuffer := gbytes.NewBuffer()
	fakeStreamer.StdoutReturns(stdoutBuffer)
	fakeStreamer.StderrReturns(stderrBuffer)

	return fakeStreamer
}

var _ = Describe("UploadStep", func() {
	var (
		step   steps.Step
		result chan error

		uploadAction    *models.UploadAction
		uploader        Uploader.Uploader
		tempDir         string
		gardenClient    *fakes.FakeGardenClient
		logger          *lagertest.TestLogger
		compressor      Compressor.Compressor
		fakeStreamer    *fake_log_streamer.FakeLogStreamer
		currentUser     *user.User
		uploadTarget    *httptest.Server
		uploadedPayload []byte
	)

	BeforeEach(func() {
		var err error

		result = make(chan error)

		uploadTarget = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
			var err error
Exemplo n.º 2
0
	"github.com/cloudfoundry-incubator/garden"
	gfakes "github.com/cloudfoundry-incubator/garden/fakes"
	"github.com/pivotal-golang/clock/fakeclock"

	"github.com/cloudfoundry-incubator/executor"
	"github.com/cloudfoundry-incubator/executor/depot/log_streamer/fake_log_streamer"
	"github.com/cloudfoundry-incubator/executor/depot/steps"
	"github.com/cloudfoundry-incubator/executor/fakes"
)

var _ = Describe("RunAction", func() {
	var step steps.Step

	var runAction models.RunAction
	var fakeStreamer *fake_log_streamer.FakeLogStreamer
	var gardenClient *fakes.FakeGardenClient
	var logger *lagertest.TestLogger
	var fileDescriptorLimit uint64
	var externalIP string
	var portMappings []executor.PortMapping
	var exportNetworkEnvVars bool
	var fakeClock *fakeclock.FakeClock

	var spawnedProcess *gfakes.FakeProcess
	var runError error

	BeforeEach(func() {
		fileDescriptorLimit = 17

		runAction = models.RunAction{
			Path: "sudo",