-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcluster_test.go
More file actions
57 lines (45 loc) · 1.55 KB
/
cluster_test.go
File metadata and controls
57 lines (45 loc) · 1.55 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
54
55
56
57
// +build integration
package tests
import (
_ "fmt"
"testing"
"github.com/deis/deis/tests/integration-utils"
)
func clustersSetup(t *testing.T) *itutils.DeisTestConfig {
cfg := itutils.GetGlobalConfig()
cfg.ClusterName = "devtest"
cmd := itutils.GetCommand("auth", "login")
itutils.Execute(t, cmd, cfg, false, "")
return cfg
}
func clustersCreateTest(t *testing.T, params *itutils.DeisTestConfig) {
cmd := itutils.GetCommand("clusters", "create")
itutils.Execute(t, cmd, params, false, "")
itutils.Execute(t, cmd, params, true, "Cluster with this Id already exists")
}
func clustersListTest(t *testing.T, params *itutils.DeisTestConfig, notflag bool) {
cmd := itutils.GetCommand("clusters", "list")
itutils.CheckList(t, params, cmd, params.ClusterName, notflag)
}
func clustersInfoTest(t *testing.T, params *itutils.DeisTestConfig) {
cmd := itutils.GetCommand("clusters", "info")
itutils.Execute(t, cmd, params, false, "")
}
//Tets #1283
func clustersUpdateTest(t *testing.T, params *itutils.DeisTestConfig) {
cmd := itutils.GetCommand("clusters", "update")
itutils.CheckList(t, params, cmd, "~/.ssh/"+params.AuthKey, true)
}
func clustersDestroyTest(t *testing.T, params *itutils.DeisTestConfig) {
cmd := itutils.GetCommand("clusters", "destroy")
itutils.Execute(t, cmd, params, false, "")
}
func TestClusters(t *testing.T) {
params := clustersSetup(t)
clustersCreateTest(t, params)
clustersListTest(t, params, false)
clustersInfoTest(t, params)
clustersUpdateTest(t, params)
clustersDestroyTest(t, params)
clustersListTest(t, params, true)
}