func TestGexec(t *testing.T) { BeforeSuite(func() { var err error fireflyPath, err = gexec.Build("./_fixture/firefly") Ω(err).ShouldNot(HaveOccurred()) }) AfterSuite(func() { gexec.CleanupBuildArtifacts() }) RegisterFailHandler(Fail) RunSpecs(t, "Gexec Suite") }
"github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/gomega/gbytes" "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/gomega/gexec" ) var bin string var _ = SynchronizedBeforeSuite(func() []byte { bootstrapBin, err := gexec.Build("github.com/cloudfoundry/bosh-agent/bootstrapper/main") Expect(err).ToNot(HaveOccurred()) return []byte(bootstrapBin) }, func(payload []byte) { bin = string(payload) }) var _ = SynchronizedAfterSuite(func() {}, func() { gexec.CleanupBuildArtifacts() }) var _ = Describe("Main", func() { var session *gexec.Session Describe("download", func() { var listener net.Listener BeforeEach(func() { installScript := "#!/bin/bash\necho hello from install script \n" tarballPath := spec.CreateTarball(installScript) listener = spec.StartDownloadServer(9003, tarballPath, spec.CertFor("director")) }) AfterEach(func() {