• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang cmd.Start函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/deis/workflow-e2e/tests/cmd.Start函数的典型用法代码示例。如果您正苦于以下问题:Golang Start函数的具体用法?Golang Start怎么用?Golang Start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Start函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: listDeploymentProcs

func listDeploymentProcs(user model.User, app model.App, proctype string) *Session {
	sess, err := cmd.Start("deis ps:list --app=%s", &user, app.Name)
	Eventually(sess).Should(Say("=== %s Processes", app.Name))
	if proctype != "" {
		Eventually(sess).Should(Say("--- %s:", proctype))
	}
	Expect(err).NotTo(HaveOccurred())
	Eventually(sess).Should(Exit(0))
	return sess
}
开发者ID:sgoings,项目名称:workflow-e2e,代码行数:10,代码来源:deployments_ps_test.go


示例17: Create

// Create executes `deis apps:create` as the specified user with the specified, arvitrary options.
func Create(user model.User, options ...string) model.App {
	noRemote := false
	app := model.NewApp()
	sess, err := cmd.Start("deis apps:create %s %s", &user, app.Name, strings.Join(options, " "))
	Expect(err).NotTo(HaveOccurred())
	sess.Wait(settings.MaxEventuallyTimeout)
	Eventually(sess).Should(Say("created %s", app.Name))

	for _, option := range options {
		if option == "--no-remote" {
			noRemote = true
			break
		}
	}

	if !noRemote {
		Eventually(sess).Should(Say("Git remote deis added"))
	}
	Eventually(sess).Should(Say("remote available at "))
	Eventually(sess).Should(Exit(0))
	return app
}
开发者ID:helgi,项目名称:workflow-e2e,代码行数:23,代码来源:commands.go


示例18:

		})

		Context("who owns an existing app", func() {

			var app model.App

			BeforeEach(func() {
				app = apps.Create(user, "--no-remote")
			})

			AfterEach(func() {
				apps.Destroy(user, app)
			})

			Specify("that user can list that app's registry information", func() {
				sess, err := cmd.Start("deis registry:list --app=%s", &user, app.Name)
				Eventually(sess).Should(Say("=== %s Registry", app.Name))
				Expect(err).NotTo(HaveOccurred())
				Eventually(sess).Should(Exit(0))
			})

			Specify("that user cannot unset an invalid registry information", func() {
				sess, err := cmd.Start("deis registry:unset --app=%s munkafolyamat", &user, app.Name)
				Eventually(sess).ShouldNot(Say(`munkafolyamat\s+yeah`, app.Name))
				Expect(err).NotTo(HaveOccurred())
				Eventually(sess).Should(Exit(1))
			})

			Specify("that user can set a valid registry information", func() {
				// Setting a port first is required for a private registry
				sess, err := cmd.Start("deis config:set -a %s PORT=5000", &user, app.Name)
开发者ID:sgoings,项目名称:workflow-e2e,代码行数:31,代码来源:registry_test.go


示例19: Regenerate

// Regenerate executes `deis auth:regenerate` as the specified user.
func Regenerate(user model.User) {
	sess, err := cmd.Start("deis auth:regenerate", &user)
	Eventually(sess).Should(Say("Token Regenerated"))
	Eventually(sess).Should(Exit(0))
	Expect(err).NotTo(HaveOccurred())
}
开发者ID:sgoings,项目名称:workflow-e2e,代码行数:7,代码来源:commands.go


示例20: Whoami

// Whoami executes `deis auth:whoami` as the specified user.
func Whoami(user model.User) {
	sess, err := cmd.Start("deis auth:whoami", &user)
	Eventually(sess).Should(Say("You are %s", user.Username))
	Eventually(sess).Should(Exit(0))
	Expect(err).NotTo(HaveOccurred())
}
开发者ID:sgoings,项目名称:workflow-e2e,代码行数:7,代码来源:commands.go



注:本文中的github.com/deis/workflow-e2e/tests/cmd.Start函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang apps.Create函数代码示例发布时间:2022-05-23
下一篇:
Golang prettyprint.Colorize函数代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap