Ejemplo n.º 1
0
	"github.com/pivotal-cf/cf-redis-broker/redis"
	"github.com/pivotal-golang/lager"

	"testing"
)

func TestDebug(t *testing.T) {
	RegisterFailHandler(Fail)
	junitReporter := reporters.NewJUnitReporter("junit_debug.xml")
	RunSpecsWithDefaultAndCustomReporters(t, "Debug Suite", []Reporter{junitReporter})
}

var dirs []string

var _ = BeforeSuite(func() {
	helpers.ResetTestDirs()

	dirs = []string{"/tmp/to/redis", "/tmp/redis/data/directory", "/tmp/redis/log/directory"}
	for _, dir := range dirs {
		err := os.MkdirAll(dir, 0755)
		Ω(err).ShouldNot(HaveOccurred())
	}
	_, err := os.Create("/tmp/to/redis/config.conf")
	Ω(err).ShouldNot(HaveOccurred())
	path, err := filepath.Abs(path.Join("..", "brokerconfig", "assets", "test_config.yml"))
	Ω(err).ToNot(HaveOccurred())
	config, err := brokerconfig.ParseConfig(path)
	Ω(err).NotTo(HaveOccurred())

	logger := lager.NewLogger("foo")
	repo, err := redis.NewRemoteRepository(&redis.RemoteAgentClient{}, config, logger)
func stopAgent(session *gexec.Session) {
	helpers.KillProcess(session)
	helpers.ResetTestDirs()
}
Ejemplo n.º 3
0
func switchBroker(config string) {
	helpers.KillProcess(brokerSession)
	helpers.ResetTestDirs()
	brokerSession = integration.LaunchProcessWithBrokerConfig(brokerExecutablePath, config)
	Ω(helpers.ServiceAvailable(brokerPort)).Should(BeTrue())
}