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