func initializeTransformer( logger lager.Logger, cachePath, workDir string, maxCacheSizeInBytes uint64, maxConcurrentDownloads, maxConcurrentUploads uint, skipSSLVerification bool, exportNetworkEnvVars bool, clock clock.Clock, ) *transformer.Transformer { cache := cacheddownloader.New(cachePath, workDir, int64(maxCacheSizeInBytes), 10*time.Minute, int(math.MaxInt8), skipSSLVerification) uploader := uploader.New(10*time.Minute, skipSSLVerification, logger) extractor := extractor.NewDetectable() compressor := compressor.NewTgz() return transformer.NewTransformer( cache, uploader, extractor, compressor, make(chan struct{}, maxConcurrentDownloads), make(chan struct{}, maxConcurrentUploads), workDir, exportNetworkEnvVars, clock, ) }
processGuid = helpers.GenerateGuid() address = componentMaker.Addresses.SSHProxy var fileServer ifrit.Runner fileServer, fileServerStaticDir = componentMaker.FileServer() runtime = ginkgomon.Invoke(grouper.NewParallel(os.Kill, grouper.Members{ {"router", componentMaker.Router()}, {"file-server", fileServer}, {"rep", componentMaker.Rep()}, {"converger", componentMaker.Converger()}, {"auctioneer", componentMaker.Auctioneer()}, {"route-emitter", componentMaker.RouteEmitter()}, {"ssh-proxy", componentMaker.SSHProxy()}, })) tgCompressor := compressor.NewTgz() err := tgCompressor.Compress(componentMaker.Artifacts.Executables["sshd"], filepath.Join(fileServerStaticDir, "sshd.tgz")) Expect(err).NotTo(HaveOccurred()) sshRoute := routes.SSHRoute{ ContainerPort: 3456, PrivateKey: componentMaker.SSHConfig.PrivateKeyPem, HostFingerprint: ssh_helpers.MD5Fingerprint(componentMaker.SSHConfig.HostKey.PublicKey()), } sshRoutePayload, err := json.Marshal(sshRoute) Expect(err).NotTo(HaveOccurred()) sshRouteMessage := json.RawMessage(sshRoutePayload) envVars := []receptor.EnvironmentVariable{
})) uploadAction = &models.UploadAction{ To: uploadTarget.URL, From: "./expected-src.txt", User: "******", } tempDir, err = ioutil.TempDir("", "upload-step-tmpdir") Expect(err).NotTo(HaveOccurred()) gardenClient = fakes.NewGardenClient() logger = lagertest.NewTestLogger("test") compressor = Compressor.NewTgz() uploader = Uploader.New(5*time.Second, false, logger) fakeStreamer = newFakeStreamer() currentUser, err = user.Current() Expect(err).NotTo(HaveOccurred()) }) AfterEach(func() { os.RemoveAll(tempDir) uploadTarget.Close() }) handle := "some-container-handle"