Skip to content

Commit

Permalink
e2e: minor improvements to test-peerpods.sh
Browse files Browse the repository at this point in the history
* wait for Kata runtime to be available
* print CAA logs on error
* treat unset azure_image_id as empty
  • Loading branch information
burgerdev committed Nov 23, 2024
1 parent e3d9446 commit ea356bb
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/test-peerpods.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -euo pipefail

set -x

if [ -z "${azure_image_id}" ]; then
if [ -z "${azure_image_id:-}" ]; then
nix run -L .#scripts.upload-image -- \
--subscription-id="${azure_subscription_id:?}" \
--location="${azure_location:?}" \
Expand All @@ -23,13 +23,31 @@ just create AKS-PEER-SNP
just get-credentials AKS-PEER-SNP
just node-installer AKS-PEER-SNP

set +x
found=false
for _ in $(seq 30); do
if kubectl get runtimeclass | grep -q kata-remote; then
found=true
break
fi
echo "Waiting for Kata installation to succeed ..."
sleep 10
done

if [[ $found != true ]]; then
echo "Kata RuntimeClass not ready" >&2
exit 1
fi

cleanup() {
kubectl delete deploy nginx
kubectl wait --for=delete pod --selector=app=nginx --timeout=5m
}

trap cleanup EXIT

set -x

kubectl apply -f - <<EOF
apiVersion: apps/v1
kind: Deployment
Expand All @@ -54,5 +72,6 @@ EOF

if ! kubectl wait --for=condition=available --timeout=5m deployment/nginx; then
kubectl describe pods
kubectl logs -n confidential-containers-system -l app=cloud-api-adaptor --tail=-1 --all-containers
exit 1
fi

0 comments on commit ea356bb

Please sign in to comment.