Example #1
0
		config.StartResponseDelayIntervalInSeconds = 1
		config.EndpointTimeoutInSeconds = 5
		config.DrainTimeoutInSeconds = 1
	}

	createConfig := func(cfgFile string, statusPort, proxyPort uint16) *config.Config {
		config := test_util.SpecConfig(natsPort, statusPort, proxyPort)

		configDrainSetup(config)

		writeConfig(config, cfgFile)
		return config
	}

	createSSLConfig := func(cfgFile string, statusPort, proxyPort, SSLPort uint16) *config.Config {
		config := test_util.SpecSSLConfig(natsPort, statusPort, proxyPort, SSLPort)

		configDrainSetup(config)

		writeConfig(config, cfgFile)
		return config
	}

	startGorouterSession := func(cfgFile string) *Session {
		gorouterCmd := exec.Command(gorouterPath, "-c", cfgFile)
		session, err := Start(gorouterCmd, GinkgoWriter, GinkgoWriter)
		Expect(err).ToNot(HaveOccurred())
		Eventually(session, 5).Should(Say("gorouter.started"))
		gorouterSession = session

		return session
Example #2
0
		configDrainSetup(cfg, pruneInterval, pruneThreshold)

		cfg.OAuth = config.OAuthConfig{
			TokenEndpoint:            "non-existent-oauth.com",
			Port:                     8443,
			ClientName:               "client-id",
			ClientSecret:             "client-secret",
			SkipOAuthTLSVerification: true,
		}

		writeConfig(cfg, cfgFile)
		return cfg
	}

	createSSLConfig := func(cfgFile string, statusPort, proxyPort, SSLPort uint16, natsPorts ...uint16) *config.Config {
		config := test_util.SpecSSLConfig(statusPort, proxyPort, SSLPort, natsPorts...)

		configDrainSetup(config, defaultPruneInterval, defaultPruneThreshold)

		writeConfig(config, cfgFile)
		return config
	}

	startGorouterSession := func(cfgFile string) *Session {
		gorouterCmd := exec.Command(gorouterPath, "-c", cfgFile)
		session, err := Start(gorouterCmd, GinkgoWriter, GinkgoWriter)
		Expect(err).ToNot(HaveOccurred())
		Eventually(session, 30).Should(Say("starting"))
		Eventually(session, 10).Should(Say("gorouter.started"))
		gorouterSession = session
		return session