Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First stab at semiautomation. #280

Merged
merged 12 commits into from
Nov 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/.gitignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,4 @@ arango-deployment-dev.yaml
arango-deployment-replication-dev.yaml
arango-storage-dev.yaml
arango-test-dev.yaml
arango-crd-dev.yaml
5 changes: 4 additions & 1 deletion tests/acceptance/cluster-local-storage.template.yaml
Original file line number Diff line number Diff line change
@@ -8,4 +8,7 @@ spec:
externalAccess:
type: LoadBalancer
mode: Cluster
storageClassName: acceptance
agents:
storageClassName: acceptance
dbservers:
storageClassName: acceptance
3 changes: 3 additions & 0 deletions tests/acceptance/cluster-sync.template.yaml
Original file line number Diff line number Diff line change
@@ -10,3 +10,6 @@ spec:
mode: Cluster
sync:
enabled: true
externalAccess:
type: LoadBalancer
accessPackageSecretNames: ["src-accesspackage"]
14 changes: 14 additions & 0 deletions tests/acceptance/cluster-sync2.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: "database.arangodb.com/v1alpha"
kind: "ArangoDeployment"
metadata:
name: "acceptance-cluster2"
spec:
environment: @ENVIRONMENT@
image: @IMAGE@
externalAccess:
type: LoadBalancer
mode: Cluster
sync:
enabled: true
externalAccess:
type: LoadBalancer
2 changes: 2 additions & 0 deletions tests/acceptance/generate.sh
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ version="arangodb-preview:3.4.0-rc.3"
enterprise_secret="$ARANGO_EP_SECRET" #only the number
community="arangodb/$version"
enterprise="registry.arangodb.com/arangodb/$version-$enterprise_secret"
community="neunhoef/arangodb:3.4"
enterprise="neunhoef/arangodb:3.4"

rm -fr generated
mkdir -p generated
9 changes: 9 additions & 0 deletions tests/acceptance/local-storage.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: "storage.arangodb.com/v1alpha"
kind: "ArangoLocalStorage"
metadata:
name: "acceptance-local-storage"
spec:
storageClass:
name: acceptance
localPath:
- /var/lib/acceptance-test
18 changes: 18 additions & 0 deletions tests/acceptance/semiautomation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Semiautomation for the acceptance test

This is a collection of tools to perform the acceptance test faster.

## Prerequisites

- k8s cluster set up with `kubectl`
- `fish` shell installed
- `curl` installed
- Obi's generated templates in a subdirectory called `generated`

## Usage

Execute the tests like this:

./test1a.fish

and follow the instructions.
93 changes: 93 additions & 0 deletions tests/acceptance/semiautomation/helper.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
function printheader
echo "Test : $TESTNAME"
echo "Description : $TESTDESC"
echo "Yaml file : $YAMLFILE"
echo "Deployment name : $DEPLOYMENT"
echo
end

function waitForKubectl
if test (count $argv) -lt 5
return 1
end
set -l op (string split -- " " $argv[1])
set -l select $argv[2]
set -l good (string split -- ";" "$argv[3]")
set -l expected $argv[4]
set -l timeout $argv[5]

echo
echo "Testing `kubectl $op`"
echo " for occurrences of `$select`"
echo " that are `$good`, expecting `$expected`"
echo

set -l t 0
while true
set -l l (kubectl $op | grep $select)
set -l nfound (count $l)
set -l ngood 0
for line in $l
if string match -r $good $line > /dev/null
set ngood (math $ngood + 1)
end
end
echo -n "Good=$ngood, found=$nfound, expected=$expected, try $t ($timeout)"
echo -n -e "\r"
if test $ngood -eq $expected -a $nfound -eq $expected ; echo ; return 0 ; end
if test $t -gt $timeout ; echo ; echo Timeout ; return 2 ; end
set t (math $t + 1)
sleep 1
end
end

function output
if which say > /dev/null
say $argv[1] > /dev/null ^ /dev/null
end
echo
for l in $argv[2..-1] ; echo $l ; end
end

function log
echo "$argv[1] Test: $TESTNAME, Desc: $TESTDESC" >> testprotocol.log
end

function inputAndLogResult
read -P "Test result: " result
log $result
echo
end

function waitForUser
read -P "Hit enter to continue"
end

function getLoadBalancerIP
string trim -c '"' (kubectl get service $argv[1] -o=json | \
jq .status.loadBalancer.ingress[0].ip)
end

function testArangoDB
set -l ip $argv[1]
set -l timeout $argv[2]
set -l n 0
echo Waiting for ArangoDB to be ready...
while true
if set v (curl -k -s -m 3 "https://$ip:8529/_api/version" --user root: | jq .server)
if test "$v" = '"arango"' ; return 0 ; end
end
set n (math $n + 1)
if test "$n" -gt "$timeout"
echo Timeout
return 1
end
echo Waiting "$n($timeout)"...
sleep 1
end
end

function fail
output "Failed" $argv
exit 1
end
13 changes: 13 additions & 0 deletions tests/acceptance/semiautomation/replication.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: "replication.database.arangodb.com/v1alpha"
kind: "ArangoDeploymentReplication"
metadata:
name: "replication-internal"
spec:
source:
masterEndpoint: ["https://@ADDRESS@:8629"]
auth:
keyfileSecretName: src-accesspackage-auth
tls:
caSecretName: src-accesspackage-ca
destination:
deploymentName: "acceptance-cluster2"
32 changes: 32 additions & 0 deletions tests/acceptance/semiautomation/test1a.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test1a
set -g TESTDESC "Deployment of mode single (development)"
set -g YAMLFILE generated/single-community-dev.yaml
set -g DEPLOYMENT acceptance-single
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-sngl" "1/1 *Running" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test1b.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test1b
set -g TESTDESC "Deployment of mode active/failover (development)"
set -g YAMLFILE generated/activefailover-community-dev.yaml
set -g DEPLOYMENT acceptance-activefailover
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test1c.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test1c
set -g TESTDESC "Deployment of mode cluster (development, enterprise)"
set -g YAMLFILE generated/cluster-enterprise-dev.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
38 changes: 38 additions & 0 deletions tests/acceptance/semiautomation/test1d.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test1d
set -g TESTDESC "Deployment of mode cluster with sync (development, enterprise)"
set -g YAMLFILE generated/cluster-sync-enterprise-dev.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 15 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-syma" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-sywo" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get service" "$DEPLOYMENT-sync *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
50 changes: 50 additions & 0 deletions tests/acceptance/semiautomation/test2a.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test2a
set -g TESTDESC "Scale an active failover deployment (enterprise)"
set -g YAMLFILE generated/activefailover-enterprise-dev.yaml
set -g DEPLOYMENT acceptance-activefailover
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Scale up the deployment
output "Next" "Patching Spec for Scaling up"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/single/count", "value":3}]'
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 6 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 2 120
or fail "Patched deployment did not get ready."

# Scale down the deployment
output "Next" "Patching Spec for Scaling down"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/single/count", "value":2}]'
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
or fail "Patched deployment did not get ready."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
71 changes: 71 additions & 0 deletions tests/acceptance/semiautomation/test2b.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test2b
set -g TESTDESC "Scale a cluster deployment (development, enterprise)"
set -g YAMLFILE generated/cluster-enterprise-dev.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Patching
output "Scaling db servers up" "Patching Spec for Scaling up DBservers"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":5}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 11 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
or fail "Deployment did not get ready."

# Patching
output "Scaling coordinators up" "Patching Spec for Scaling up coordinators"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":4}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 12 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 120
or fail "Deployment did not get ready."

# Patching
output "Scaling dbservers down" "Patching Spec for Scaling down dbservers"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":2}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 4 120
or fail "Deployment did not get ready."

# Patching
output "Scaling coordinators down" "Patching Spec for Scaling down coordinators"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":1}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 6 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 1 120
or fail "Deployment did not get ready."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 0 120
or fail "Could not delete deployment."

output "Ready" ""
32 changes: 32 additions & 0 deletions tests/acceptance/semiautomation/test3a.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test3a
set -g TESTDESC "Deployment of mode single (production)"
set -g YAMLFILE generated/single-enterprise-pro.yaml
set -g DEPLOYMENT acceptance-single
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-sngl" "1/1 *Running" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test3b.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test3b
set -g TESTDESC "Deployment of mode active/failover (production)"
set -g YAMLFILE generated/activefailover-community-pro.yaml
set -g DEPLOYMENT acceptance-activefailover
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test3c.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test3c
set -g TESTDESC "Deployment of mode cluster (production, enterprise)"
set -g YAMLFILE generated/cluster-enterprise-pro.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
71 changes: 71 additions & 0 deletions tests/acceptance/semiautomation/test3d.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test3d
set -g TESTDESC "Scale a cluster deployment (production, enterprise)"
set -g YAMLFILE generated/cluster-enterprise-pro.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Patching
output "Scaling dbservers down" "Patching Spec for Scaling down dbservers"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":2}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 8 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
or fail "Deployment did not get ready."

# Patching
output "Scaling coordinators down" "Patching Spec for Scaling down coordinators"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":2}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 7 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 2 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 2 120
or fail "Deployment did not get ready."

# Patching
output "Scaling db servers up" "Patching Spec for Scaling up DBservers"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/dbservers/count", "value":3}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 8 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 2 120
or fail "Deployment did not get ready."

# Patching
output "Scaling coordinators up" "Patching Spec for Scaling up coordinators"
kubectl patch arango $DEPLOYMENT --type='json' -p='[{"op": "replace", "path": "/spec/coordinators/count", "value":3}]'
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 9 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
or fail "Deployment did not get ready."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 0 120
or fail "Could not delete deployment."

output "Ready" ""
46 changes: 46 additions & 0 deletions tests/acceptance/semiautomation/test4a.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test4a
set -g TESTDESC "Deployment of mode cluster (development, enterprise, local storage)"
set -g YAMLFILE generated/cluster-local-storage-enterprise-dev.yaml
set -g YAMLFILESTORAGE generated/local-storage-community-dev.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy local storage:
kubectl apply -f $YAMLFILESTORAGE
and waitForKubectl "get storageclass" "acceptance.*arangodb.*localstorage" "" 1 60
or fail "Local storage could not be deployed."

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pvc" "$DEPLOYMENT" "RWO *acceptance" 6 120
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

kubectl delete -f $YAMLFILESTORAGE
kubectl delete storageclass acceptance
waitForKubectl "get storageclass" "acceptance.*arangodb.*localstorage" "" 0 120
or fail "Could not delete deployed storageclass."

output "Ready" ""
46 changes: 46 additions & 0 deletions tests/acceptance/semiautomation/test4b.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test4a
set -g TESTDESC "Deployment of mode cluster (development, enterprise, local storage)"
set -g YAMLFILE generated/cluster-enterprise-dev.yaml
set -g YAMLFILESTORAGE generated/local-storage-community-dev.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy local storage:
kubectl apply -f $YAMLFILESTORAGE
and waitForKubectl "get storageclass" "acceptance.*arangodb.*localstorage" "" 1 60
or fail "Local storage could not be deployed."

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pvc" "$DEPLOYMENT" "RWO *standard" 6 120
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

kubectl delete -f $YAMLFILESTORAGE
kubectl delete storageclass acceptance
waitForKubectl "get storageclass" "acceptance.*arangodb.*localstorage" "" 0 120
or fail "Could not delete deployed storageclass."

output "Ready" ""
32 changes: 32 additions & 0 deletions tests/acceptance/semiautomation/test5a.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test5a
set -g TESTDESC "Pod resilience in mode single (production)"
set -g YAMLFILE generated/single-community-pro.yaml
set -g DEPLOYMENT acceptance-single
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-sngl" "1/1 *Running" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in and kill the single server pod." "Wait until it comes back and then see if the data is still there."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test5b.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test5b
set -g TESTDESC "Pod resilience in active/failover (production)"
set -g YAMLFILE generated/activefailover-community-pro.yaml
set -g DEPLOYMENT acceptance-activefailover
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in." "Then, kill one single server pod after another." "They should come back, service should continue." "All data must still be there."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test5c.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test5c
set -g TESTDESC "Pod resilience in mode cluster (production, enterprise)"
set -g YAMLFILE generated/cluster-enterprise-pro.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in with replication factor 2." "Then, kill one pod after another with enough time in between." "They should come back, service should continue." "All data must still be there."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
32 changes: 32 additions & 0 deletions tests/acceptance/semiautomation/test6a.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test6a
set -g TESTDESC "Node resilience in mode single (production)"
set -g YAMLFILE generated/single-community-pro.yaml
set -g DEPLOYMENT acceptance-single
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-sngl" "1/1 *Running" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in and reboot node the single pod is running on." "Wait until it comes back and then see if the data is still there and the server is responsive."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test6b.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test6b
set -g TESTDESC "Node resilience in active/failover (production)"
set -g YAMLFILE generated/activefailover-community-pro.yaml
set -g DEPLOYMENT acceptance-activefailover
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in." "Then, reboot the node on which the ready single server pod resides." "The node and pod should come back, service should be uninterrupted." "All data must still be there."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test6c.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test6c
set -g TESTDESC "Node resilience in mode cluster (production, enterprise)"
set -g YAMLFILE generated/cluster-enterprise-pro.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in with replication factor 2." "Then, reboot nodes one after another with enough time in between." "They should come back, service should not be interrupted." "Even writes should be possible during the restart." "All data must still be there."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
32 changes: 32 additions & 0 deletions tests/acceptance/semiautomation/test6d.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test6d
set -g TESTDESC "Node resilience in mode single (production)"
set -g YAMLFILE generated/single-community-pro.yaml
set -g DEPLOYMENT acceptance-single
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-sngl" "1/1 *Running" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in and remove the node the single pod is running on." "Wait until a replacement is back." "This can only work with network attached storage." "Then see if the data is still there and the new server is responsive."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT-sngl "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test6e.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test6e
set -g TESTDESC "Node resilience in active/failover (production)"
set -g YAMLFILE generated/activefailover-community-pro.yaml
set -g DEPLOYMENT acceptance-activefailover
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in." "Then, remove the node on which the ready single server pod resides." "The node and pod should come back (on a different machine)." "The service should be uninterrupted." "All data must still be there."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test6f.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test6c
set -g TESTDESC "Node resilience in mode cluster (production, enterprise)"
set -g YAMLFILE generated/cluster-enterprise-pro.yaml
set -g DEPLOYMENT acceptance-cluster
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in with replication factor 2." "Then, remove a node." "Pods should come back, service should not be interrupted." "Even writes should be possible during the redeployment." "All data must still be there."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
34 changes: 34 additions & 0 deletions tests/acceptance/semiautomation/test6g.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test6f
set -g TESTDESC "Node resilience in active/failover, repl factor 1 (production)"
set -g YAMLFILE generated/activefailover-community-pro.yaml
set -g DEPLOYMENT acceptance-activefailover
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
and waitForKubectl "get pod" $DEPLOYMENT "1 *Running" 5 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*1/1 *Running" "" 1 120
and waitForKubectl "get pod" "$DEPLOYMENT-sngl.*0/1 *Running" "" 1 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB was not reachable."

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER." "Furthermore, put some data in, use replication factor 1 for one collection." "Then, remove the node on which the dbserver pod with the shard resides." "The lost pods should come back (on a different machine), except the one." "The service should be uninterrupted, except for the one collection." "All data except the one must still be there." "This is only for locally attached persistent volumes."
inputAndLogResult

# Cleanup
kubectl delete -f $YAMLFILE
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
or fail "Could not delete deployment."

output "Ready" ""
62 changes: 62 additions & 0 deletions tests/acceptance/semiautomation/test7a.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/fish

source helper.fish

set -g TESTNAME test7a
set -g TESTDESC "Deployment of 2 clusters with sync with DC2DC (production, enterprise)"
set -g YAMLFILE generated/cluster-sync-enterprise-pro.yaml
set -g YAMLFILE2 generated/cluster-sync2-enterprise-pro.yaml
set -g DEPLOYMENT acceptance-cluster
set -g DEPLOYMENT2 acceptance-cluster2
printheader

# Deploy and check
kubectl apply -f $YAMLFILE
kubectl apply -f $YAMLFILE2
and waitForKubectl "get pod" "$DEPLOYMENT" "1/1 *Running" 15 120
and waitForKubectl "get pod" "$DEPLOYMENT-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-crdn" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-syma" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT-sywo" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get service" "$DEPLOYMENT-sync *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get pod" "$DEPLOYMENT2" "1/1 *Running" 15 120
and waitForKubectl "get pod" "$DEPLOYMENT2-prmr" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT2-agnt" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT2-crdn" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT2-syma" "1/1 *Running" 3 120
and waitForKubectl "get pod" "$DEPLOYMENT2-sywo" "1/1 *Running" 3 120
and waitForKubectl "get service" "$DEPLOYMENT2 *ClusterIP" 8529 1 120
and waitForKubectl "get service" "$DEPLOYMENT2-ea *LoadBalancer" "-v;pending" 1 180
and waitForKubectl "get service" "$DEPLOYMENT2-sync *LoadBalancer" "-v;pending" 1 180
or fail "Deployment did not get ready."

# Automatic check
set ip (getLoadBalancerIP "$DEPLOYMENT-ea")
testArangoDB $ip 120
or fail "ArangoDB (1) was not reachable."

set ip2 (getLoadBalancerIP "$DEPLOYMENT2-ea")
testArangoDB $ip2 120
or fail "ArangoDB (2) was not reachable."

# Set up replication, rest is manual:
# run sed here on replication.yaml, find sync-ea first
kubectl apply -f replication.yaml

# Manual check
output "Work" "Now please check external access on this URL with your browser:" " https://$ip:8529/" "then type the outcome followed by ENTER."
inputAndLogResult

# Cleanup
kubectl delete -f replication.yaml
sleep 15
kubectl delete -f $YAMLFILE
kubectl delete -f $YAMLFILE2
waitForKubectl "get pod" $DEPLOYMENT "" 0 120
waitForKubectl "get pod" $DEPLOYMENT2 "" 0 120
or fail "Could not delete deployment."

output "Ready" ""