forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcluster_test.go
33 lines (24 loc) · 903 Bytes
/
cluster_test.go
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
package e2e
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
. "github.com/argoproj/gitops-engine/pkg/utils/errors"
. "github.com/argoproj/argo-cd/test/e2e/fixture"
)
func TestClusterList(t *testing.T) {
output := FailOnErr(RunCli("cluster", "list")).(string)
assert.Equal(t, fmt.Sprintf(`SERVER NAME VERSION STATUS MESSAGE
https://kubernetes.default.svc in-cluster %v Successful `, GetVersions().ServerVersion), output)
}
func TestClusterGet(t *testing.T) {
output := FailOnErr(RunCli("cluster", "get", "https://kubernetes.default.svc")).(string)
assert.Contains(t, output, fmt.Sprintf(`
name: in-cluster
server: https://kubernetes.default.svc
serverVersion: "%v"`, GetVersions().ServerVersion))
assert.Contains(t, output, `config:
tlsClientConfig:
insecure: false`)
assert.Contains(t, output, `status: Successful`)
}