-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.sh
executable file
·148 lines (124 loc) · 2.83 KB
/
test.sh
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/usr/bin/env bash
set -e
# Build
bash build.sh
chmod +x ./k8senv-linux-amd64
echo
mkdir -p $HOME/.k8senv/bin
export PATH=$HOME/.k8senv/bin:$PATH
cp -f ./k8senv-linux-amd64 $HOME/.k8senv/bin/k8senv
echo "Testing 'k8senv version'"
k8senv version
echo "✅"
echo
# Test kubectl
echo "Testing 'k8senv install kubectl'"
k8senv install kubectl v1.29.1 --timeout 300 --overwrite
echo "Testing 'k8senv kubectl install'"
k8senv kubectl install 1.30.0 --timeout 300 --overwrite
echo "✅"
echo
echo "Testing 'k8senv use kubectl'"
k8senv use kubectl v1.29.1
kubectl version --client
echo "Testing 'k8senv kubectl use'"
k8senv kubectl use 1.30.0
kubectl version --client
echo "✅"
echo
echo "Testing 'k8senv kubectl list'"
k8senv kubectl list
echo "Testing 'k8senv list kubectl'"
k8senv list kubectl
echo "✅"
echo
echo "Testing 'k8senv kubectl unuse'"
k8senv kubectl unuse
k8senv list kubectl
echo "Testing 'k8senv unuse kubectl'"
k8senv unuse kubectl
k8senv list kubectl
echo "✅"
echo
echo "Testing 'k8senv kubectl remove'"
k8senv kubectl remove v1.30.0
k8senv list kubectl
echo "Testing 'k8senv remove kubectl'"
k8senv remove kubectl 1.29.1
k8senv list kubectl
echo "✅"
echo
# Test velero
echo "Testing 'k8senv install velero'"
k8senv install velero v1.14.1 --timeout 300 --overwrite
echo "Testing 'k8senv velero install'"
k8senv velero install 1.12.3 --timeout 300 --overwrite
echo "✅"
echo
echo "Testing 'k8senv use velero'"
k8senv use velero v1.14.1
velero version --client-only
echo "Testing 'k8senv velero use'"
k8senv velero use 1.12.3
velero version --client-only
echo "✅"
echo
echo "Testing 'k8senv velero list'"
k8senv velero list
echo "Testing 'k8senv list velero'"
k8senv list velero
echo "✅"
echo
echo "Testing 'k8senv velero unuse'"
k8senv velero unuse
k8senv list velero
echo "Testing 'k8senv unuse velero'"
k8senv unuse velero
k8senv list velero
echo "✅"
echo
echo "Testing 'k8senv velero remove'"
k8senv velero remove v1.12.3
k8senv list velero
echo "Testing 'k8senv remove velero'"
k8senv remove velero 1.14.1
k8senv list velero
echo "✅"
echo
# Test helm
echo "Testing 'k8senv install helm'"
k8senv install helm v3.10.2 --timeout 300 --overwrite
echo "Testing 'k8senv helm install'"
k8senv helm install 3.8.1 --timeout 300 --overwrite
echo "✅"
echo
echo "Testing 'k8senv use helm'"
k8senv use helm v3.8.1
helm version
echo "Testing 'k8senv helm use'"
k8senv helm use 3.10.2
helm version
echo "✅"
echo
echo "Testing 'k8senv helm list'"
k8senv helm list
echo "Testing 'k8senv list helm'"
k8senv list helm
echo "✅"
echo
echo "Testing 'k8senv helm unuse'"
k8senv helm unuse
k8senv list helm
echo "Testing 'k8senv unuse helm'"
k8senv unuse helm
k8senv list helm
echo "✅"
echo
echo "Testing 'k8senv helm remove'"
k8senv helm remove v3.10.2
k8senv list helm
echo "Testing 'k8senv remove helm'"
k8senv remove helm 3.8.1
k8senv list helm
echo "✅"
echo