Skip to content

Commit ad9e603

Browse files
author
lamai93
committed
Added tests 1c, 1d, 2a and 2b.
1 parent b8c4144 commit ad9e603

File tree

4 files changed

+163
-2
lines changed

4 files changed

+163
-2
lines changed

tests/acceptance/semiautomation/test1c.fish

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
source helper.fish
44

5-
set -g TESTNAME test1b
5+
set -g TESTNAME test1c
66
set -g TESTDESC "Deployment of mode cluster (enterprise)"
77
set -g YAMLFILE generated/cluster-enterprise-dev.yaml
88
set -g DEPLOYMENT acceptance-cluster
99
printheader
1010

1111
# Deploy and check
1212
kubectl apply -f $YAMLFILE
13-
and waitForKubectl "get pod" $DEPLOYMENT "1/1 *Running" 9 120
13+
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
14+
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
15+
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
1416
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
1517
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 120
1618
or fail "Deployment did not get ready."
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/fish
2+
3+
source helper.fish
4+
5+
set -g TESTNAME test1d
6+
set -g TESTDESC "Deployment of mode cluster with sync (enterprise)"
7+
set -g YAMLFILE generated/cluster-sync-enterprise-dev.yaml
8+
set -g DEPLOYMENT acceptance-cluster
9+
printheader
10+
11+
# Deploy and check
12+
kubectl apply -f $YAMLFILE
13+
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 15 120
14+
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
15+
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
16+
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
17+
and waitForKubectl "get pod" "$DEPLOYMENT-syma" "1/1 *Running" 3 120
18+
and waitForKubectl "get pod" "$DEPLOYMENT-sywo" "1/1 *Running" 3 120
19+
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
20+
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 120
21+
and waitForKubectl "get service" "$DEPLOYMENT-sync *LoadBalancer" "-v;pending" 1 120
22+
or fail "Deployment did not get ready."
23+
24+
# Automatic check
25+
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
26+
testArangoDB $ip 60
27+
or fail "ArangoDB was not reachable."
28+
29+
# Manual check
30+
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
31+
inputAndLogResult
32+
33+
# Cleanup
34+
kubectl delete -f $YAMLFILE
35+
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
36+
or fail "Could not delete deployment."
37+
38+
output "Ready" ""
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/fish
2+
3+
source helper.fish
4+
5+
set -g TESTNAME test2a
6+
set -g TESTDESC "Scale an active failover deployment (enterprise)"
7+
set -g YAMLFILE generated/activefailover-enterprise-dev.yaml
8+
set -g DEPLOYMENT acceptance-activefailover
9+
printheader
10+
11+
# Deploy and check
12+
kubectl apply -f $YAMLFILE
13+
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
14+
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
15+
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
16+
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
17+
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 120
18+
or fail "Deployment did not get ready."
19+
20+
# Automatic check
21+
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
22+
testArangoDB $ip 60
23+
or fail "ArangoDB was not reachable."
24+
25+
# Scale up the deployment
26+
output "Next" "Patching Spec for Scaling up"
27+
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/single/count", "value":3}]'
28+
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 6 120
29+
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
30+
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 2 120
31+
or fail "Patched deployment did not get ready."
32+
33+
# Scale down the deployment
34+
output "Next" "Patching Spec for Scaling down"
35+
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/single/count", "value":2}]'
36+
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
37+
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
38+
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
39+
or fail "Patched deployment did not get ready."
40+
41+
# Manual check
42+
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
43+
inputAndLogResult
44+
45+
# Cleanup
46+
kubectl delete -f $YAMLFILE
47+
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
48+
or fail "Could not delete deployment."
49+
50+
output "Ready" ""
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/fish
2+
3+
source helper.fish
4+
5+
set -g TESTNAME test2b
6+
set -g TESTDESC "Scale an cluster deployment (enterprise)"
7+
set -g YAMLFILE generated/cluster-enterprise-dev.yaml
8+
set -g DEPLOYMENT acceptance-cluster
9+
printheader
10+
11+
# Deploy and check
12+
kubectl apply -f $YAMLFILE
13+
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120
14+
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
15+
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
16+
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
17+
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
18+
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 120
19+
or fail "Deployment did not get ready."
20+
21+
# Automatic check
22+
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
23+
testArangoDB $ip 60
24+
or fail "ArangoDB was not reachable."
25+
26+
# Patching
27+
output "Patching" "Patching Spec for Scaling up"
28+
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":5}]'
29+
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 11 120
30+
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 120
31+
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
32+
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
33+
or fail "Deployment did not get ready."
34+
35+
# Patching
36+
output "Patching" "Patching Spec for Scaling up"
37+
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":4}]'
38+
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 12 120
39+
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 120
40+
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
41+
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 120
42+
or fail "Deployment did not get ready."
43+
44+
# Patching
45+
output "Patching" "Patching Spec for Scaling up"
46+
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":2}]'
47+
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120
48+
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120
49+
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
50+
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 120
51+
or fail "Deployment did not get ready."
52+
53+
# Patching
54+
output "Patching" "Patching Spec for Scaling up"
55+
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":1}]'
56+
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 6 120
57+
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120
58+
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
59+
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 1 120
60+
or fail "Deployment did not get ready."
61+
62+
# Manual check
63+
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
64+
inputAndLogResult
65+
66+
# Cleanup
67+
kubectl delete -f $YAMLFILE
68+
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 0 120
69+
or fail "Could not delete deployment."
70+
71+
output "Ready" ""

0 commit comments

Comments
 (0)