本文整理汇总了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")
}