mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-11 22:10:11 +01:00
feat(zfspv): check pod-status in BDD test (#171)
Signed-off-by: vaniisgh <vanisingh@live.co.uk>
This commit is contained in:
parent
051f26fe16
commit
a19877e4c0
2 changed files with 36 additions and 2 deletions
|
|
@ -44,8 +44,41 @@ dumpControllerLogs() {
|
|||
printf "\n\n"
|
||||
}
|
||||
|
||||
# wait for zfs driver to be UP
|
||||
sleep 20
|
||||
|
||||
isPodReady(){
|
||||
[ "$(kubectl get po "$1" -o 'jsonpath={.status.conditions[?(@.type=="Ready")].status}' -n kube-system)" = 'True' ]
|
||||
}
|
||||
|
||||
|
||||
isDriverReady(){
|
||||
for pod in $zfsDriver;do
|
||||
isPodReady $pod || return 1
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
waitForZFSDriver() {
|
||||
period=120
|
||||
interval=1
|
||||
|
||||
i=0
|
||||
while [ "$i" -le "$period" ]; do
|
||||
zfsDriver="$(kubectl get pods -l role=openebs-zfs -o 'jsonpath={.items[*].metadata.name}' -n kube-system)"
|
||||
if isDriverReady $zfsDriver; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
i=$(( i + interval ))
|
||||
echo "Waiting for zfs-driver to be ready..."
|
||||
sleep "$interval"
|
||||
done
|
||||
|
||||
echo "Waited for $period seconds, but all pods are not ready yet."
|
||||
return 1
|
||||
}
|
||||
|
||||
# wait for zfs-driver to be up
|
||||
waitForZFSDriver
|
||||
|
||||
cd $TEST_DIR
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue