本文整理匯總了Golang中github.com/deis/deis/tests/utils.GetGlobalConfig函數的典型用法代碼示例。如果您正苦於以下問題:Golang GetGlobalConfig函數的具體用法?Golang GetGlobalConfig怎麽用?Golang GetGlobalConfig使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetGlobalConfig函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestUsers
func TestUsers(t *testing.T) {
params := utils.GetGlobalConfig()
user := utils.GetGlobalConfig()
user.UserName, user.Password = "user-list-test", "test"
user.AppName = params.AppName
utils.Execute(t, authRegisterCmd, user, false, "")
usersListTest(t, params, user)
}
示例2: authCancel
func authCancel(t *testing.T, params *utils.DeisTestConfig) {
utils.Execute(t, authCancelCmd, params, false, "Account cancelled")
user := utils.GetGlobalConfig()
// Admins can delete other users.
user.UserName, user.Password = "cancel-test", "test"
utils.Execute(t, authRegisterCmd, user, false, "")
admin := utils.GetGlobalConfig()
utils.Execute(t, authLoginCmd, admin, false, "")
utils.Execute(t, authCancelAdminCmd, user, false, "Account cancelled")
// Make sure the user's config was not purged after auth:cancel --username
utils.Execute(t, authWhoamiCmd, admin, false, "You are "+admin.UserName)
}
示例3: authCancel
func authCancel(t *testing.T, params *utils.DeisTestConfig) {
utils.Execute(t, authCancelCmd, params, false, "Account cancelled")
user := utils.GetGlobalConfig()
// Admins can delete other users.
user.UserName, user.Password = "cancel-test", "test"
utils.Execute(t, authRegisterCmd, user, false, "")
admin := utils.GetGlobalConfig()
utils.Execute(t, authLoginCmd, admin, false, "")
utils.Execute(t, authCancelAdminCmd, user, false, "Account cancelled")
// Make sure the admin is still logged in
utils.CheckList(t, authWhoamiCmd, admin, admin.UserName, false)
}
示例4: appsSetup
func appsSetup(t *testing.T) *utils.DeisTestConfig {
cfg := utils.GetGlobalConfig()
cfg.AppName = "appssample"
utils.Execute(t, authLoginCmd, cfg, false, "")
utils.Execute(t, gitCloneCmd, cfg, false, "")
return cfg
}
示例5: TestSmokeExampleApp
// TestSmokeExampleApp updates a Vagrant instance to run Deis with docker
// containers using the current codebase, then registers a user, pushes an
// example app, and looks for "Powered by Deis" in the HTTP response.
func TestSmokeExampleApp(t *testing.T) {
cfg := utils.GetGlobalConfig()
for _, tt := range smokeTests {
runTest(t, &tt, cfg)
}
}
示例6: configSetup
func configSetup(t *testing.T) *utils.DeisTestConfig {
cfg := utils.GetGlobalConfig()
cfg.AppName = "configsample"
utils.Execute(t, authLoginCmd, cfg, false, "")
utils.Execute(t, gitCloneCmd, cfg, false, "")
if err := utils.Chdir(cfg.ExampleApp); err != nil {
t.Fatal(err)
}
utils.Execute(t, appsCreateCmd, cfg, false, "")
// ensure envvars with spaces work fine on `git push`
// https://github.com/deis/deis/issues/2477
utils.Execute(t, configSet3Cmd, cfg, false, "the Deis team")
// ensure custom buildpack URLs are in order
url := buildpacks[cfg.ExampleApp]
if url == "" {
// set url anyway so example-dockerfile apps create a build
url = buildpacks["example-go"]
}
cmd := strings.Replace(configSetBuildpackCmd, "$BUILDPACK_URL", url, 1)
utils.Execute(t, cmd, cfg, false, url)
utils.Execute(t, gitPushCmd, cfg, false, "")
utils.CurlApp(t, *cfg)
utils.CheckList(t, "run env --app={{.AppName}}", cfg, "DEIS_APP", false)
utils.CheckList(t, "run env --app={{.AppName}}", cfg, "DEIS_RELEASE", false)
if err := utils.Chdir(".."); err != nil {
t.Fatal(err)
}
return cfg
}
示例7: TestGlobal
func TestGlobal(t *testing.T) {
params := utils.GetGlobalConfig()
cookieTest(t, params)
utils.Execute(t, authRegisterCmd, params, false, "")
utils.Execute(t, keysAddCmd, params, false, "")
utils.Execute(t, clustersCreateCmd, params, false, "")
}
示例8: TestPerms
func TestPerms(t *testing.T) {
params := permsSetup(t)
user := utils.GetGlobalConfig()
user.UserName, user.Password = "test1", "test1"
user.AppName = params.AppName
utils.Execute(t, authRegisterCmd, user, false, "")
permsCreateAppTest(t, params, user)
permsDeleteAppTest(t, params, user)
permsCreateAdminTest(t, params)
permsDeleteAdminTest(t, params)
utils.AppsDestroyTest(t, params)
}
示例9: authRegenerateTest
func authRegenerateTest(t *testing.T) {
params := utils.GetGlobalConfig()
regenCmd := authRegenerateUsrCmd
loginCmd := authLoginCmd
utils.Execute(t, loginCmd, params, false, "")
utils.Execute(t, authRegenerateCmd, params, false, "")
utils.Execute(t, loginCmd, params, false, "")
utils.Execute(t, regenCmd, params, false, "")
utils.Execute(t, checkTokenCmd, params, true, "401 UNAUTHORIZED")
utils.Execute(t, loginCmd, params, false, "")
utils.Execute(t, authRegenerateAllCmd, params, false, "")
utils.Execute(t, checkTokenCmd, params, true, "401 UNAUTHORIZED")
}
示例10: appsTransferTest
func appsTransferTest(t *testing.T, params *utils.DeisTestConfig) {
user := utils.GetGlobalConfig()
user.UserName, user.Password = "app-transfer-test", "test"
user.AppName = "transfer-test"
user.NewOwner = params.UserName
utils.Execute(t, authRegisterCmd, user, false, "")
utils.Execute(t, authLoginCmd, user, false, "")
utils.Execute(t, appsCreateCmdNoRemote, user, false, "")
utils.Execute(t, appsTransferCmd, user, false, "")
utils.Execute(t, appsInfoCmd, user, true, "403 FORBIDDEN")
utils.Execute(t, authLoginCmd, params, false, "")
params.AppName = user.AppName
utils.CheckList(t, appsInfoCmd, params, params.UserName, false)
}
示例11: psSetup
func psSetup(t *testing.T) *utils.DeisTestConfig {
cfg := utils.GetGlobalConfig()
cfg.AppName = "pssample"
utils.Execute(t, authLoginCmd, cfg, false, "")
utils.Execute(t, gitCloneCmd, cfg, false, "")
if err := utils.Chdir(cfg.ExampleApp); err != nil {
t.Fatal(err)
}
utils.Execute(t, appsCreateCmd, cfg, false, "")
utils.Execute(t, gitPushCmd, cfg, false, "")
if err := utils.Chdir(".."); err != nil {
t.Fatal(err)
}
return cfg
}
示例12: buildSetup
func buildSetup(t *testing.T) *utils.DeisTestConfig {
cfg := utils.GetGlobalConfig()
cfg.AppName = "buildsample"
utils.Execute(t, authLoginCmd, cfg, false, "")
utils.Execute(t, gitCloneCmd, cfg, false, "")
if err := utils.Chdir(cfg.ExampleApp); err != nil {
t.Fatal(err)
}
utils.Execute(t, appsCreateCmd, cfg, false, "")
utils.Execute(t, gitPushCmd, cfg, false, "")
utils.Execute(t, "git commit --allow-empty -m bump", cfg, false, "")
utils.Execute(t, gitPushCmd, cfg, false, "")
if err := utils.Chdir(".."); err != nil {
t.Fatal(err)
}
return cfg
}
示例13: configSetup
func configSetup(t *testing.T) *utils.DeisTestConfig {
cfg := utils.GetGlobalConfig()
cfg.AppName = "configsample"
utils.Execute(t, authLoginCmd, cfg, false, "")
utils.Execute(t, gitCloneCmd, cfg, false, "")
if err := utils.Chdir(cfg.ExampleApp); err != nil {
t.Fatal(err)
}
utils.Execute(t, appsCreateCmd, cfg, false, "")
// ensure envvars with spaces work fine on `git push`
// https://github.com/deis/deis/issues/2477
utils.Execute(t, configSet3Cmd, cfg, false, "the Deis team")
utils.Execute(t, gitPushCmd, cfg, false, "")
utils.CurlWithFail(t, cfg, false, "the Deis team")
if err := utils.Chdir(".."); err != nil {
t.Fatal(err)
}
return cfg
}
示例14: clustersSetup
func clustersSetup(t *testing.T) *utils.DeisTestConfig {
cfg := utils.GetGlobalConfig()
cfg.ClusterName = "devtest"
utils.Execute(t, authLoginCmd, cfg, false, "")
return cfg
}
示例15: TestGlobal
func TestGlobal(t *testing.T) {
params := utils.GetGlobalConfig()
utils.Execute(t, authRegisterCmd, params, false, "")
clientTest(t, params)
utils.Execute(t, keysAddCmd, params, false, "")
}