예제 #1
0
파일: auth_test.go 프로젝트: CodeJuan/deis
func authPasswdTest(t *testing.T, params *utils.DeisTestConfig) {
	password := "******"
	params.NewPassword = password
	cmd := authPasswdCmd
	utils.Execute(t, cmd, params, false, "")
	params.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
0
// 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
0
파일: auth_test.go 프로젝트: gpxl/deis
func authPasswdTest(t *testing.T, params *utils.DeisTestConfig) {
	password := "******"
	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
0
파일: apps_test.go 프로젝트: yun-an/deis
func appsTransferTest(t *testing.T, params *utils.DeisTestConfig) {
	user := utils.GetGlobalConfig()
	user.UserName, user.Password = "******", "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
0
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
0
파일: keys_test.go 프로젝트: CodeJuan/deis
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")
}
예제 #7
0
파일: keys_test.go 프로젝트: Blystad/deis
func keysAddTest(t *testing.T, params *utils.DeisTestConfig) {
	params.AuthKey = "deiskey"
	utils.Execute(t, keysAddCmd, params, false, "")
	utils.Execute(t, keysAddCmd, params, true,
		"SSH Key with this Public already exists")
}