本文整理匯總了Golang中github.com/deis/deis/tests/utils.DeisTestConfig類的典型用法代碼示例。如果您正苦於以下問題:Golang DeisTestConfig類的具體用法?Golang DeisTestConfig怎麽用?Golang DeisTestConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了DeisTestConfig類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: 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, "")
}
示例2: buildsCreateTest
// buildsCreateTest uses the `deis builds:create` (or `deis pull`) command
// to promote a build from an existing docker image.
func buildsCreateTest(t *testing.T, params *utils.DeisTestConfig) {
params.AppName = "deispullsample"
params.ImageID = "deis/example-go:latest"
params.ExampleApp = "example-deis-pull"
if err := os.Mkdir(params.ExampleApp, 0755); err != nil {
t.Fatal(err)
}
if err := utils.Chdir(params.ExampleApp); err != nil {
t.Fatal(err)
}
utils.Execute(t, appsCreateCmdNoRemote, params, false, "")
utils.Execute(t, buildsCreateCmd, params, false, "")
if err := utils.Chdir(".."); err != nil {
t.Fatal(err)
}
}
示例3: 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, "")
}
示例4: 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)
}
示例5: buildsListTest
func buildsListTest(t *testing.T, params *utils.DeisTestConfig) {
cmd := buildsListCmd
var cmdBuf bytes.Buffer
tmpl := template.Must(template.New("cmd").Parse(cmd))
if err := tmpl.Execute(&cmdBuf, params); err != nil {
t.Fatal(err)
}
cmdString := cmdBuf.String()
cmdl := exec.Command("sh", "-c", utils.Deis+cmdString)
stdout, _, err := utils.RunCommandWithStdoutStderr(cmdl)
if err != nil {
t.Fatal(err)
}
ImageID := strings.Split(stdout.String(), "\n")[2]
params.ImageID = strings.Fields(ImageID)[0]
}
示例6: keysAddTest
func keysAddTest(t *testing.T, params *utils.DeisTestConfig) {
params.AuthKey = "deiskey"
utils.Execute(t, keysAddCmd, params, false, "")
utils.Execute(t, keysAddCmd, params, true,
"This field must be unique")
}