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")
}
Beispiel #2
0
	"net"
	"net/http"
	"os/exec"
	"strconv"

	"github.com/cloudfoundry/bosh-agent/bootstrapper/spec"
	. "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/ginkgo"
	. "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/gomega"
	"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