本文整理汇总了Golang中github.com/cloudfoundry-incubator/cf-test-helpers/helpers.LoadConfig函数的典型用法代码示例。如果您正苦于以下问题:Golang LoadConfig函数的具体用法?Golang LoadConfig怎么用?Golang LoadConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadConfig函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestRouting
func TestRouting(t *testing.T) {
RegisterFailHandler(Fail)
config = helpers.LoadConfig()
componentName := "Routing"
rs := []Reporter{}
context := helpers.NewContext(config)
environment := helpers.NewEnvironment(context)
BeforeSuite(func() {
Expect(config.SystemDomain).ToNot(Equal(""), "Must provide a system domain for the routing suite")
Expect(config.ClientSecret).ToNot(Equal(""), "Must provide a client secret for the routing suite")
environment.Setup()
})
AfterSuite(func() {
environment.Teardown()
})
if config.ArtifactsDirectory != "" {
helpers.EnableCFTrace(config, componentName)
rs = append(rs, helpers.NewJUnitReporter(config, componentName))
}
RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
示例2: TestDetect
func TestDetect(t *testing.T) {
RegisterFailHandler(Fail)
config = helpers.LoadConfig()
if config.DefaultTimeout > 0 {
DEFAULT_TIMEOUT = config.DefaultTimeout * time.Second
}
if config.DetectTimeout > 0 {
DETECT_TIMEOUT = config.DetectTimeout * time.Second
}
context = helpers.NewContext(config)
environment := helpers.NewEnvironment(context)
BeforeSuite(func() {
environment.Setup()
})
AfterSuite(func() {
environment.Teardown()
})
componentName := "Buildpack Detection"
rs := []Reporter{}
if config.ArtifactsDirectory != "" {
helpers.EnableCFTrace(config, componentName)
rs = append(rs, helpers.NewJUnitReporter(config, componentName))
}
RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
示例3: TestApplications
func TestApplications(t *testing.T) {
RegisterFailHandler(Fail)
SetDefaultEventuallyTimeout(time.Minute)
SetDefaultEventuallyPollingInterval(time.Second)
config := helpers.LoadConfig()
context = helpers.NewContext(config)
environment := helpers.NewEnvironment(context)
var _ = SynchronizedBeforeSuite(func() []byte {
path, err := exec.LookPath("scp")
Expect(err).NotTo(HaveOccurred())
return []byte(path)
}, func(encodedSCPPath []byte) {
scpPath = string(encodedSCPPath)
environment.Setup()
})
AfterSuite(func() {
environment.Teardown()
})
componentName := "SSH"
rs := []Reporter{}
if config.ArtifactsDirectory != "" {
helpers.EnableCFTrace(config, componentName)
rs = append(rs, helpers.NewJUnitReporter(config, componentName))
}
RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
示例4: TestElasticsearchService
func TestElasticsearchService(t *testing.T) {
RegisterFailHandler(Fail)
config = helpers.LoadConfig()
if config.DefaultTimeout > 0 {
DEFAULT_TIMEOUT = config.DefaultTimeout * time.Second
}
if config.CfPushTimeout > 0 {
CF_PUSH_TIMEOUT = config.CfPushTimeout * time.Second
}
context = helpers.NewContext(config)
environment := helpers.NewEnvironment(context)
BeforeSuite(func() {
environment.Setup()
})
AfterSuite(func() {
//environment.Teardown()
})
RunSpecs(t, "Elasticsearch Service")
}
示例5: TestSuite
func TestSuite(t *testing.T) {
RegisterFailHandler(Fail)
config = helpers.LoadConfig()
if config.DefaultTimeout > 0 {
DEFAULT_TIMEOUT = config.DefaultTimeout * time.Second
}
if config.CfPushTimeout > 0 {
CF_PUSH_TIMEOUT = config.CfPushTimeout * time.Second
}
if config.LongCurlTimeout > 0 {
LONG_CURL_TIMEOUT = config.LongCurlTimeout * time.Second
}
context = helpers.NewContext(config)
environment := helpers.NewEnvironment(context)
BeforeSuite(func() {
environment.Setup()
})
AfterSuite(func() {
environment.Teardown()
})
RunSpecs(t, "Performance tests")
}
示例6: TestApplications
func TestApplications(t *testing.T) {
RegisterFailHandler(Fail)
SetDefaultEventuallyTimeout(time.Minute)
SetDefaultEventuallyPollingInterval(time.Second)
config := helpers.LoadConfig()
context = helpers.NewContext(config)
environment := helpers.NewEnvironment(context)
BeforeSuite(func() {
environment.Setup()
})
AfterSuite(func() {
environment.Teardown()
})
componentName := "SecurityGroups"
rs := []Reporter{}
if config.ArtifactsDirectory != "" {
helpers.EnableCFTrace(config, componentName)
rs = append(rs, helpers.NewJUnitReporter(config, componentName))
}
RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
示例7: deleteServiceBroker
func deleteServiceBroker(brokerName string) {
config = helpers.LoadConfig()
context := helpers.NewContext(config)
cf.AsUser(context.AdminUserContext(), context.ShortTimeout(), func() {
responseBuffer := cf.Cf("delete-service-broker", brokerName, "-f")
Expect(responseBuffer.Wait(DEFAULT_TIMEOUT)).To(Exit(0))
})
}
示例8: SetBackend
func SetBackend(appName string) {
config := helpers.LoadConfig()
if config.Backend == "diego" {
EnableDiego(appName)
} else if config.Backend == "dea" {
DisableDiego(appName)
}
}
示例9: SetBackend
func SetBackend(appName string) {
config := helpers.LoadConfig()
if config.Backend == "diego" {
guid := guidForAppName(appName)
Eventually(cf.Cf("curl", "/v2/apps/"+guid, "-X", "PUT", "-d", `{"diego": true}`), DEFAULT_TIMEOUT).Should(Exit(0))
} else if config.Backend == "dea" {
guid := guidForAppName(appName)
Eventually(cf.Cf("curl", "/v2/apps/"+guid, "-X", "PUT", "-d", `{"diego": false}`), DEFAULT_TIMEOUT).Should(Exit(0))
}
}
示例10: Push
func (b ServiceBroker) Push() {
Expect(cf.Cf("push", b.Name, "-p", b.Path, "--no-start").Wait(BROKER_START_TIMEOUT)).To(Exit(0))
if helpers.LoadConfig().UseDiego {
appGuid := strings.TrimSpace(string(cf.Cf("app", b.Name, "--guid").Wait(DEFAULT_TIMEOUT).Out.Contents()))
cf.Cf("curl",
fmt.Sprintf("/v2/apps/%s", appGuid),
"-X", "PUT",
"-d", "{\"diego\": true}",
).Wait(DEFAULT_TIMEOUT)
}
Expect(cf.Cf("start", b.Name).Wait(BROKER_START_TIMEOUT)).To(Exit(0))
}
示例11: Push
func (b ServiceBroker) Push() {
config := helpers.LoadConfig()
Expect(cf.Cf(
"push", b.Name,
"--no-start",
"-b", config.RubyBuildpackName,
"-m", DEFAULT_MEMORY_LIMIT,
"-p", b.Path,
"-d", config.AppsDomain,
).Wait(BROKER_START_TIMEOUT)).To(Exit(0))
app_helpers.SetBackend(b.Name)
Expect(cf.Cf("start", b.Name).Wait(BROKER_START_TIMEOUT)).To(Exit(0))
}
示例12: SetOauthEndpoints
func SetOauthEndpoints(apiEndpoint string, config *OAuthConfig) {
args := []string{}
if helpers.LoadConfig().SkipSSLValidation {
args = append(args, "--insecure")
}
args = append(args, fmt.Sprintf("%v/info", apiEndpoint))
curl := runner.Curl(args...).Wait(DEFAULT_TIMEOUT)
Expect(curl).To(Exit(0))
apiResponse := curl.Out.Contents()
jsonResult := ParseJsonResponse(apiResponse)
config.TokenEndpoint = fmt.Sprintf("%v", jsonResult[`token_endpoint`])
config.AuthorizationEndpoint = fmt.Sprintf("%v", jsonResult[`authorization_endpoint`])
return
}
示例13: TestLats
func TestLats(t *testing.T) {
RegisterFailHandler(Fail)
var environment *helpers.Environment
BeforeSuite(func() {
config = helpers.LoadConfig()
context := helpers.NewContext(config)
environment = helpers.NewEnvironment(context)
environment.Setup()
})
AfterSuite(func() {
environment.Teardown()
})
RunSpecs(t, "Lats Suite")
}
示例14: TestApplications
func TestApplications(t *testing.T) {
RegisterFailHandler(Fail)
config = helpers.LoadConfig()
if config.DefaultTimeout > 0 {
DEFAULT_TIMEOUT = config.DefaultTimeout * time.Second
}
if config.CfPushTimeout > 0 {
CF_PUSH_TIMEOUT = config.CfPushTimeout * time.Second
}
if config.LongCurlTimeout > 0 {
LONG_CURL_TIMEOUT = config.LongCurlTimeout * time.Second
}
context = helpers.NewContext(config)
environment := helpers.NewEnvironment(context)
BeforeSuite(func() {
environment.Setup()
})
AfterSuite(func() {
environment.Teardown()
})
componentName := "Docker"
rs := []Reporter{}
if config.ArtifactsDirectory != "" {
helpers.EnableCFTrace(config, componentName)
rs = append(rs, helpers.NewJUnitReporter(config, componentName))
}
RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
示例15: createServiceBroker
func createServiceBroker() (string, string, string) {
serviceBrokerAsset := assets.NewAssets().ServiceBroker
serviceBrokerAppName := PushApp(serviceBrokerAsset, config.RubyBuildpackName)
serviceName := initiateBrokerConfig(serviceBrokerAppName)
brokerName := generator.PrefixedRandomName("RATS-BROKER-")
brokerUrl := helpers.AppUri(serviceBrokerAppName, "")
config = helpers.LoadConfig()
context := helpers.NewContext(config)
cf.AsUser(context.AdminUserContext(), context.ShortTimeout(), func() {
session := cf.Cf("create-service-broker", brokerName, "user", "password", brokerUrl)
Expect(session.Wait(DEFAULT_TIMEOUT)).To(Exit(0))
session = cf.Cf("enable-service-access", serviceName)
Expect(session.Wait(DEFAULT_TIMEOUT)).To(Exit(0))
})
return brokerName, serviceBrokerAppName, serviceName
}