reuse e2e scripts
This commit is contained in:
9
testdata/e2e/bin/install-chart.sh
vendored
Executable file
9
testdata/e2e/bin/install-chart.sh
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
kubectl config set-context --current --namespace=agh-e2e
|
||||
|
||||
if [[ $(helm list --no-headers -n agh-e2e | grep agh-e2e | wc -l) == "1" ]]; then
|
||||
helm delete agh-e2e -n agh-e2e --wait
|
||||
fi
|
||||
helm install agh-e2e testdata/e2e -n agh-e2e --create-namespace
|
||||
5
testdata/e2e/bin/show-origin-logs.sh
vendored
Executable file
5
testdata/e2e/bin/show-origin-logs.sh
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo Pod adguardhome-origin logs
|
||||
kubectl logs adguardhome-origin
|
||||
10
testdata/e2e/bin/show-replica-logs.sh
vendored
Executable file
10
testdata/e2e/bin/show-replica-logs.sh
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
for pod in $(kubectl get pods -l bakito.net/adguardhome-sync=replica -o name); do
|
||||
echo Pod "${pod} logs"
|
||||
kubectl logs ${pod}
|
||||
ERRORS=$(kubectl logs ${pod} | grep '\[error\]' | wc -l)
|
||||
echo "Found ${ERRORS} error(s) in log"
|
||||
echo "----------------------------------------------"
|
||||
done
|
||||
8
testdata/e2e/bin/show-sync-logs.sh
vendored
Executable file
8
testdata/e2e/bin/show-sync-logs.sh
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo Pod adguardhome-sync logs
|
||||
kubectl logs adguardhome-sync
|
||||
ERRORS=$(kubectl logs adguardhome-sync | grep Error | wc -l)
|
||||
echo "Found ${ERRORS} error(s) in log";
|
||||
if [[ "${ERRORS}" != "0" ]]; then exit 1; fi
|
||||
7
testdata/e2e/bin/wait-for-agh-pods.sh
vendored
Executable file
7
testdata/e2e/bin/wait-for-agh-pods.sh
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "wait for adguardhome pods"
|
||||
for pod in $(kubectl get pods -l bakito.net/adguardhome-sync -o name); do
|
||||
kubectl wait --for condition=Ready ${pod} --timeout=30s
|
||||
done
|
||||
4
testdata/e2e/bin/wait-for-sync.sh
vendored
Executable file
4
testdata/e2e/bin/wait-for-sync.sh
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/adguardhome-sync --timeout=1m
|
||||
15
testdata/e2e/pod-adguardhome-sync.yaml
vendored
15
testdata/e2e/pod-adguardhome-sync.yaml
vendored
@@ -1,15 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: adguardhome-sync
|
||||
spec:
|
||||
containers:
|
||||
- name: adguardhome-sync
|
||||
image: ghcr.io/bakito/adguardhome-sync:main
|
||||
command:
|
||||
- /opt/go/adguardhome-sync
|
||||
- run
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: sync-conf
|
||||
restartPolicy: Never
|
||||
@@ -12,11 +12,7 @@ spec:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- |
|
||||
#!/bin/bash
|
||||
echo "wait for adguardhome pods"
|
||||
for pod in $(kubectl get pods -l bakito.net/adguardhome-sync -o name); do
|
||||
kubectl wait --for condition=Ready ${pod} --timeout=30s
|
||||
done
|
||||
{{- .Files.Get "bin/wait-for-agh-pods.sh" | nindent 10}}
|
||||
containers:
|
||||
- name: adguardhome-sync
|
||||
image: ghcr.io/bakito/adguardhome-sync:main
|
||||
Reference in New Issue
Block a user