diff --git a/packages/test-peerpods.sh b/packages/test-peerpods.sh index c2e3dc15bd..d28f6f8f8c 100644 --- a/packages/test-peerpods.sh +++ b/packages/test-peerpods.sh @@ -39,9 +39,17 @@ if [[ $found != true ]]; then exit 1 fi +run_tests() { + pod="$(kubectl get pod -l app=alpine -o jsonpath='{.items[0].metadata.name}')" + + # Check IMDS functionality. + # -f makes this fail on a 500 status code. + kubectl exec "$pod" -- curl -f -i -H "Metadata: true" http://169.254.169.254/metadata/THIM/amd/certification +} + cleanup() { - kubectl delete deploy nginx - kubectl wait --for=delete pod --selector=app=nginx --timeout=5m + kubectl delete deploy alpine + kubectl wait --for=delete pod --selector=app=alpine --timeout=5m } trap cleanup EXIT @@ -52,26 +60,29 @@ kubectl apply -f - <