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


Golang cmd.Start函數代碼示例

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


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

示例1: Login

// Login executes `deis auth:login` as the specified user. In the process, it creates the a
// corresponding profile that contains the user's authentication token. Re-use of this profile is
// for most other actions is what permits multiple test users to act in parallel without impacting
// one another.
func Login(user model.User) {
	sess, err := cmd.Start("deis auth:login %s --username=%s --password=%s", &user, settings.DeisControllerURL, user.Username, user.Password)
	Expect(err).To(BeNil())
	Eventually(sess).Should(Exit(0))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Say(fmt.Sprintf("Logged in as %s\n", user.Username)))
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:11,代碼來源:commands.go

示例2: listProcs

func listProcs(user model.User, app model.App) *Session {
	sess, err := cmd.Start("deis ps:list --app=%s", &user, app.Name)
	Eventually(sess).Should(Say("=== %s Processes", app.Name))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Exit(0))
	return sess
}
開發者ID:helgi,項目名稱:workflow-e2e,代碼行數:7,代碼來源:ps_test.go

示例3: Logout

// Logout executes `deis auth:logout` as the specified user.
func Logout(user model.User) {
	sess, err := cmd.Start("deis auth:logout", &user)
	Expect(err).To(BeNil())
	Eventually(sess).Should(Exit(0))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Say("Logged out\n"))
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:8,代碼來源:commands.go

示例4: Info

// Info executes `deis certs:info` as the specified user to retrieve information about the
// specified cert.
func Info(user model.User, cert model.Cert) *Session {
	sess, err := cmd.Start("deis certs:info %s", &user, cert.Name)
	Eventually(sess).Should(Say("=== %s Certificate", cert.Name))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Exit(0))
	return sess
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:9,代碼來源:commands.go

示例5: createOrPull

func createOrPull(user model.User, app model.App, command string) {
	sess, err := cmd.Start("deis %s --app=%s %s", &user, command, app.Name, ExampleImage)
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Say("Creating build..."))
	Eventually(sess, settings.MaxEventuallyTimeout).Should(Exit(0))
	time.Sleep(10 * time.Second)
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:7,代碼來源:commands.go

示例6: Cancel

// Cancel executes `deis auth:cancel` as the specified user.
func Cancel(user model.User) {
	sess, err := cmd.Start("deis auth:cancel --username=%s --password=%s --yes", &user, user.Username, user.Password)
	Expect(err).To(BeNil())
	Eventually(sess).Should(Exit(0))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Say("Account cancelled\n"))
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:8,代碼來源:commands.go

示例7: Remove

// Remove executes `deis certs:remove` as the specified user to remove the specified cert.
func Remove(user model.User, cert model.Cert) {
	sess, err := cmd.Start("deis certs:remove %s", &user, cert.Name)
	Eventually(sess).Should(Say("Removing %s...", cert.Name))
	Eventually(sess).Should(Say("done"))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Exit(0))
	Eventually(List(user).Wait().Out.Contents()).ShouldNot(ContainSubstring(cert.Name))
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:9,代碼來源:commands.go

示例8: Add

// Add executes `deis certs:add` as the specified user to add the specified cert.
func Add(user model.User, cert model.Cert) {
	sess, err := cmd.Start("deis certs:add %s %s %s", &user, cert.Name, cert.CertPath, cert.KeyPath)
	Eventually(sess).Should(Say("Adding SSL endpoint..."))
	Eventually(sess, settings.MaxEventuallyTimeout).Should(Say("done"))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Exit(0))
	Eventually(List(user).Wait().Out.Contents()).Should(ContainSubstring(cert.Name))
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:9,代碼來源:commands.go

示例9: Set

// Set executes `deis config:set` on the specified app as the specified user.
func Set(user model.User, app model.App, key string, value string) *Session {
	sess, err := cmd.Start("deis config:set %s=%s --app=%s", &user, key, value, app.Name)
	Expect(err).NotTo(HaveOccurred())
	sess.Wait(settings.MaxEventuallyTimeout)
	Eventually(sess).Should(Say("Creating config..."))
	Eventually(sess).Should(Exit(0))
	return sess
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:9,代碼來源:commands.go

示例10: Push

// Push executes a `git push deis master` from the current directory using the provided key.
func Push(user model.User, keyPath string) {
	sess, err := cmd.Start("GIT_SSH=%s GIT_KEY=%s git push deis master", &user, settings.GitSSH, keyPath)
	Expect(err).NotTo(HaveOccurred())
	// sess.Wait(settings.MaxEventuallyTimeout)
	// output := string(sess.Out.Contents())
	// Expect(output).To(MatchRegexp(`Done, %s:v\d deployed to Deis`, app.Name))
	Eventually(sess, settings.MaxEventuallyTimeout).Should(Exit(0))
}
開發者ID:helgi,項目名稱:workflow-e2e,代碼行數:9,代碼來源:commands.go

示例11: CancelAdmin

// CancelAdmin deletes the admin user that was created to facilitate the tests.
func CancelAdmin() {
	admin := model.Admin
	sess, err := cmd.Start("deis auth:cancel --username=%s --password=%s --yes", &admin, admin.Username, admin.Password)
	Expect(err).To(BeNil())
	Eventually(sess).Should(Exit(0))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Say("Account cancelled\n"))
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:9,代碼來源:commands.go

示例12: Detach

// Detatch executes `deis certs:detach` as the specified user to detach the specified cert from
// the specified domain.
func Detach(user model.User, cert model.Cert, domain string) {
	sess, err := cmd.Start("deis certs:detach %s %s", &user, cert.Name, domain)
	// Explicitly build literal substring since 'domain' may be a wildcard domain ('*.foo.com') and
	// we don't want Gomega interpreting this string as a regexp
	Eventually(sess.Wait().Out.Contents()).Should(ContainSubstring(fmt.Sprintf("Detaching certificate %s from domain %s...", cert.Name, domain)))
	Eventually(sess, settings.MaxEventuallyTimeout).Should(Say("done"))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Exit(0))
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:11,代碼來源:commands.go

示例13: Register

// Register executes `deis auth:register` using a randomized username and returns a model.User.
func Register() model.User {
	user := model.NewUser()
	sess, err := cmd.Start("deis auth:register %s --username=%s --password=%s --email=%s", &user, settings.DeisControllerURL, user.Username, user.Password, user.Email)
	Expect(err).To(BeNil())
	Eventually(sess).Should(Exit(0))
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Say(fmt.Sprintf("Logged in as %s\n", user.Username)))
	return user
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:10,代碼來源:commands.go

示例14: Destroy

// Destroy executes `deis apps:destroy` on the specified app as the specified user.
func Destroy(user model.User, app model.App) *Session {
	sess, err := cmd.Start("deis apps:destroy --app=%s --confirm=%s", &user, app.Name, app.Name)
	Expect(err).NotTo(HaveOccurred())
	sess.Wait(settings.MaxEventuallyTimeout)
	Eventually(sess).Should(Say("Destroying %s...", app.Name))
	Eventually(sess).Should(Say(`done in `))
	Eventually(sess).Should(Exit(0))
	return sess
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:10,代碼來源:commands.go

示例15: RegisterAdmin

// RegisterAdmin executes `deis auth:register`, using hard-coded username, password, and email
// address. When this is executed, it is executed in hopes of registering Workflow's FIRST user,
// which will automatically have admin permissions. If this should fail, the function proceeds
// with logging in using those same hard-coded credentials, in the hopes that the reason for the
// failure is that such an account already exists, having been created by a previous execution of
// the tests.
func RegisterAdmin() {
	admin := model.Admin
	sess, err := cmd.Start("deis auth:register %s --username=%s --password=%s --email=%s", &admin, settings.DeisControllerURL, admin.Username, admin.Password, admin.Email)
	Expect(err).To(BeNil())
	Eventually(sess).Should(Exit())
	Expect(err).NotTo(HaveOccurred())

	// We cannot entirely count on the registration having succeeded. It may have failed if a user
	// with the username "admin" already exists. However, if that user IS indeed an admin and their
	// password is also "admin" (e.g. the admin was created by a previous run of these tests), then
	// we can proceed... so attempt to login...
	Login(admin)

	// Now verify this user is an admin by running a privileged command.
	sess, err = cmd.Start("deis users:list", &admin)
	Expect(err).To(BeNil())
	Eventually(sess).Should(Exit(0))
	Expect(err).NotTo(HaveOccurred())
}
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:25,代碼來源:commands.go


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