當前位置: 首頁>>代碼示例>>Golang>>正文


Golang utils.Execute函數代碼示例

本文整理匯總了Golang中github.com/deis/deis/tests/utils.Execute函數的典型用法代碼示例。如果您正苦於以下問題:Golang Execute函數的具體用法?Golang Execute怎麽用?Golang Execute使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Execute函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: permsCreateAppTest

func permsCreateAppTest(t *testing.T, params, user *utils.DeisTestConfig) {
	utils.Execute(t, authLoginCmd, user, false, "")
	utils.Execute(t, permsCreateAppCmd, user, true, "403 FORBIDDEN")
	utils.Execute(t, authLoginCmd, params, false, "")
	utils.Execute(t, permsCreateAppCmd, params, false, "")
	utils.CheckList(t, permsListAppCmd, params, "test1", false)
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:7,代碼來源:perms_test.go

示例2: 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
}
開發者ID:gdestuynder,項目名稱:deis,代碼行數:7,代碼來源:apps_test.go

示例3: TestPs

func TestPs(t *testing.T) {
	params := psSetup(t)
	psScaleTest(t, params, psScaleCmd)
	appsOpenTest(t, params)
	psListTest(t, params, false)
	psScaleTest(t, params, psRestartCmd)
	psScaleTest(t, params, psDownScaleCmd)

	// FIXME if we don't wait here, some of the routers may give us a 502 before
	// the app is removed from the config.
	// we wait 7 seconds since confd reloads every 5 seconds
	time.Sleep(time.Millisecond * 7000)

	// test for a 503 response
	utils.CurlWithFail(t, fmt.Sprintf("http://%s.%s", params.AppName, params.Domain), true, "503")

	utils.AppsDestroyTest(t, params)
	utils.Execute(t, psScaleCmd, params, true, "404 NOT FOUND")
	// ensure we can choose our preferred beverage
	utils.Execute(t, psScaleCmd, params, true, "but first, coffee!")
	if err := os.Setenv("DEIS_DRINK_OF_CHOICE", "tea"); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, psScaleCmd, params, true, "but first, tea!")
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:25,代碼來源:ps_test.go

示例4: 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, "")
}
開發者ID:bdemers,項目名稱:deis,代碼行數:7,代碼來源:integration_test.go

示例5: tagsTest

func tagsTest(t *testing.T, cfg *utils.DeisTestConfig, ver int) {
	configFleetMetadata(t, cfg)
	utils.Execute(t, tagsListCmd, cfg, false, "No tags defined")
	utils.Execute(t, tagsSetCmd, cfg, false, "test")
	utils.Execute(t, tagsListCmd, cfg, false, "test")
	utils.Execute(t, tagsUnsetCmd, cfg, false, "No tags defined")
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:7,代碼來源:tags_test.go

示例6: appsRunTest

func appsRunTest(t *testing.T, params *utils.DeisTestConfig) {
	cmd := appsRunCmd
	if err := utils.Chdir(params.ExampleApp); err != nil {
		t.Fatal(err)
	}
	utils.CheckList(t, cmd, params, "Hello, 世界", false)
	utils.Execute(t, "apps:run env", params, true, "GIT_SHA")
	// Fleet/systemd unit files have a limit of 2048 characters per line or else one encounters
	// problems parsing the unit.  To verify long log messages are truncated and do not crash
	// logspout (see https://github.com/deis/deis/issues/2046) we must issue a (relatively) short
	// command via `deis apps:run` that produces a LONG, but testable (predictable) log message we
	// can search for in the output of `deis logs`.
	//
	// The strategy for achieving this is to generate 1k random characters, then use that with a
	// command submitted via `deis apps:run` that will echo those 1k bytes 64x (on a single line).
	// Such a message is long enough to crash logspout if handled improperly and ALSO gives us a
	// large, distinct, and predictable string we can search for in the logs to assert success (and
	// assert that the message didn't crash logspout) WITHOUT ever needing to transmit such an
	// egregiously long command via `deis apps:run`.
	largeString := randomString(1024)
	utils.Execute(t, fmt.Sprintf("apps:run \"printf '%s%%.0s' {1..64}\"", largeString), params, false, largeString)
	// To assert the long message didn't crash logspout AND made it to the logger, we will search
	// the logs for a fragment of the long message-- specifically 2x the random string we generated.
	// This will help us ensure the actual log message made it through and not JUST the log message
	// that states the command being execured via `deis apps:run`.  We want to find the former, not
	// the latter because the latter is too short a message to have possibly crashed logspout if
	// mishandled.
	utils.Execute(t, "logs", params, false, strings.Repeat(largeString, 2))
	if err := utils.Chdir(".."); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, cmd, params, true, "Not found")
}
開發者ID:CloudSide,項目名稱:deis,代碼行數:33,代碼來源:apps_test.go

示例7: configSetTest

func configSetTest(t *testing.T, params *utils.DeisTestConfig) {
	utils.Execute(t, configSetCmd, params, false, "講台")
	utils.CheckList(t, appsInfoCmd, params, "(v5)", false)
	utils.Execute(t, configSet2Cmd, params, false, "10")
	utils.CheckList(t, appsInfoCmd, params, "(v6)", false)
	utils.Execute(t, configSetHealthcheckCmd, params, false, "/")
	utils.CheckList(t, appsInfoCmd, params, "(v7)", false)
}
開發者ID:bladealslayer,項目名稱:deis,代碼行數:8,代碼來源:config_test.go

示例8: authPasswdTest

func authPasswdTest(t *testing.T, params *utils.DeisTestConfig) {
	password := "aNewPassword"
	utils.AuthPasswd(t, params, password)
	cmd := authLoginCmd
	utils.Execute(t, cmd, params, true, "400 BAD REQUEST")
	params.Password = password
	utils.Execute(t, cmd, params, false, "")
}
開發者ID:gpxl,項目名稱:deis,代碼行數:8,代碼來源:auth_test.go

示例9: buildsScaleTest

// buildsScaleTest ensures that we can use a Procfile-based workflow for `deis pull`.
func buildsScaleTest(t *testing.T, params *utils.DeisTestConfig) {
	if err := utils.Chdir(params.ExampleApp); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, "scale worker=1 --app={{.AppName}}", params, false, "")
	utils.Execute(t, "logs --app={{.AppName}}", params, false, "hi")
	if err := utils.Chdir(".."); err != nil {
		t.Fatal(err)
	}
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:11,代碼來源:builds_test.go

示例10: domainsTest

func domainsTest(t *testing.T, cfg *utils.DeisTestConfig) {
	utils.Execute(t, domainsAddCmd, cfg, false, "done")
	// ensure both the root domain and the custom domain work
	utils.CurlApp(t, *cfg)
	utils.Curl(t, fmt.Sprintf("http://%s", cfg.AppDomain))
	utils.Execute(t, domainsRemoveCmd, cfg, false, "done")
	// only the root domain should work now
	utils.CurlApp(t, *cfg)
	// TODO (bacongobbler): add test to ensure that the custom domain fails to connect
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:10,代碼來源:domains_test.go

示例11: appsCreateTest

func appsCreateTest(t *testing.T, params *utils.DeisTestConfig) {
	wd, _ := os.Getwd()
	defer os.Chdir(wd)
	if err := utils.Chdir(params.ExampleApp); err != nil {
		t.Fatal(err)
	}
	cmd := appsCreateCmd
	utils.Execute(t, cmd, params, false, "")
	utils.Execute(t, cmd, params, true, "App with this Id already exists")
}
開發者ID:ericcapricorn,項目名稱:deis,代碼行數:10,代碼來源:apps_test.go

示例12: appsRunTest

func appsRunTest(t *testing.T, params *utils.DeisTestConfig) {
	cmd := appsRunCmd
	if err := utils.Chdir(params.ExampleApp); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, cmd, params, false, "")
	if err := utils.Chdir(".."); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, cmd, params, true, "Not found")
}
開發者ID:netf,項目名稱:deis,代碼行數:11,代碼來源:apps_test.go

示例13: limitsUnsetTest

func limitsUnsetTest(t *testing.T, cfg *utils.DeisTestConfig, ver int) {
	cpuCmd, memCmd := limitsUnsetCPUCmd, limitsUnsetMemCmd
	if strings.Contains(cfg.ExampleApp, "dockerfile") {
		cpuCmd = strings.Replace(cpuCmd, "web", "cmd", 1)
		memCmd = strings.Replace(memCmd, "web", "cmd", 1)
	}
	utils.Execute(t, cpuCmd, cfg, false, "Unlimited")
	utils.Execute(t, limitsListCmd, cfg, false, "Unlimited")
	utils.Execute(t, memCmd, cfg, false, "Unlimited")
	utils.Execute(t, limitsListCmd, cfg, false, "Unlimited")
}
開發者ID:Blystad,項目名稱:deis,代碼行數:11,代碼來源:limits_test.go

示例14: appsCreateTest

func appsCreateTest(t *testing.T, params *utils.DeisTestConfig) {
	wd, _ := os.Getwd()
	defer os.Chdir(wd)
	if err := utils.Chdir(params.ExampleApp); err != nil {
		t.Fatal(err)
	}
	// TODO: move --buildpack to client unit tests
	utils.Execute(t, appsCreateCmdBuildpack, params, false, "BUILDPACK_URL")
	utils.Execute(t, appsDestroyCmdNoApp, params, false, "")
	utils.Execute(t, appsCreateCmd, params, false, "")
	utils.Execute(t, appsCreateCmd, params, true, "App with this Id already exists")
}
開發者ID:gdestuynder,項目名稱:deis,代碼行數:12,代碼來源:apps_test.go

示例15: authPasswdTest

func authPasswdTest(t *testing.T, params *utils.DeisTestConfig) {
	password := "aNewPassword"
	params.NewPassword = password
	cmd := authPasswdCmd
	utils.Execute(t, cmd, params, false, "")
	params.Password = "wrong-password"
	utils.Execute(t, cmd, params, true, "Password change failed")

	cmd = authLoginCmd
	utils.Execute(t, cmd, params, true, "400 BAD REQUEST")
	params.Password = password
	utils.Execute(t, cmd, params, false, "")
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:13,代碼來源:auth_test.go


注:本文中的github.com/deis/deis/tests/utils.Execute函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。