-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathps_test.go
More file actions
53 lines (45 loc) · 1.39 KB
/
ps_test.go
File metadata and controls
53 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// +build integration
package tests
import (
_ "fmt"
"testing"
"github.com/deis/deis/tests/integration-utils"
"github.com/deis/deis/tests/utils"
)
func psSetup(t *testing.T) *itutils.DeisTestConfig {
cfg := itutils.GetGlobalConfig()
cfg.ExampleApp = itutils.GetRandomApp()
cfg.AppName = "pssample"
cmd := itutils.GetCommand("auth", "login")
itutils.Execute(t, cmd, cfg, false, "")
cmd = itutils.GetCommand("git", "clone")
itutils.Execute(t, cmd, cfg, false, "")
cmd = itutils.GetCommand("apps", "create")
cmd1 := itutils.GetCommand("git", "push")
if err := utils.Chdir(cfg.ExampleApp); err != nil {
t.Fatalf("Failed:\n%v", err)
}
itutils.Execute(t, cmd, cfg, false, "")
itutils.Execute(t, cmd1, cfg, false, "")
if err := utils.Chdir(".."); err != nil {
t.Fatalf("Failed:\n%v", err)
}
return cfg
}
func psListTest(t *testing.T, params *itutils.DeisTestConfig, notflag bool) {
cmd := itutils.GetCommand("ps", "list")
itutils.CheckList(t, params, cmd, "web.2 up (v2)", notflag)
}
func psScaleTest(t *testing.T, params *itutils.DeisTestConfig) {
cmd := itutils.GetCommand("ps", "scale")
itutils.Execute(t, cmd, params, false, "")
}
func TestPs(t *testing.T) {
params := psSetup(t)
psScaleTest(t, params)
appsOpenTest(t, params)
psListTest(t, params, false)
itutils.AppsDestroyTest(t, params)
cmd := itutils.GetCommand("ps", "list")
itutils.Execute(t, cmd, params, true, "404 NOT FOUND")
}