1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-25 09:36:25 +00:00
node-feature-discovery/scripts/test-infra/test-e2e.sh
Markus Lehtonen 05f5d2a88a scripts/test-infra: add script for end-to-end testing
Add a new script for running end-to-end tests. Implement a Makefile rule
for polling the container image. We need this for prow as there is no
other way for syncing the jobs (e2e postsubmit job must wait until the
image-pushing job has built and published the image). This is
implemented in the Makefile as all the image-related variables are also
defined/available there.

Also, adapt the TravisCI config to use the new script.
2020-08-27 14:48:37 +03:00

37 lines
865 B
Bash
Executable file

#!/bin/bash -e
# Install deps
curl -o $HOME/bin/aws-iam-authenticator --create-dirs https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/linux/amd64/aws-iam-authenticator
chmod a+x $HOME/bin/aws-iam-authenticator
export PATH=$PATH:$HOME/bin
# Configure environment
if [ -z "$IMAGE_TAG_NAME" ]; then
export IMAGE_TAG_NAME="$_PULL_BASE_REF-g$COMMIT_SHA"
fi
export KUBECONFIG=`pwd`/kubeconfig
export E2E_TEST_CONFIG=`pwd`/e2e-test-config
echo "$KUBECONFIG_DATA" > "$KUBECONFIG"
echo "$E2E_TEST_CONFIG_DATA" > "$E2E_TEST_CONFIG"
# Wait for the image to be built and published
i=1
while true; do
if make poll-image -e; then
break
elif [ $i -ge 10 ]; then
"ERROR: too many tries when polling for image"
exit 1
fi
sleep 60
i=$(( $i + 1 ))
done
# Configure environment and run tests
make e2e-test -e