@@ -31,9 +31,14 @@ curl --retry 5 -LO \
3131chmod +x kubectl &&
3232mv kubectl /usr/local/bin
3333
34+ # Build binaries
35+ echo " Building machine-controller and webhook"
36+ make machine-controller webhook
37+
3438# Generate ssh keypair
35- echo " Set permissions for ssh key "
39+ echo " Generating ssh keypair "
3640chmod 0700 $HOME /.ssh
41+ ssh-keygen -t rsa -N " " -f ~ /.ssh/id_ed25519
3742
3843# Initialize terraform
3944echo " Initalizing terraform"
@@ -42,32 +47,38 @@ make terraform
4247cp provider.tf{.disabled,}
4348terraform init --input=false --backend-config=key=$BUILD_ID
4449export TF_VAR_hcloud_token=" ${HZ_E2E_TOKEN} "
45- export TF_VAR_hcloud_sshkey_content=" $( cat ~ /.ssh/id_rsa.pub) "
50+ export TF_VAR_hcloud_sshkey_content=" $( cat ~ /.ssh/id_ed25519.pub) "
51+ export TF_VAR_hcloud_sshkey_name=" $BUILD_ID "
4652export TF_VAR_hcloud_test_server_name=" machine-controller-test-${BUILD_ID} "
4753
4854for try in {1..20}; do
4955 set +e
5056 # Create environment at cloud provider
5157 echo " Creating environment at cloud provider."
52- terraform import hcloud_ssh_key.default 265119
5358 terraform apply -auto-approve
54- if [[ $? == 0 ]]; then break ; fi
59+ TF_RC=$?
60+ if [[ $TF_RC == 0 ]]; then break ; fi
61+ if [[ $TF_RC != 0 ]] && [[ $try -eq 20 ]]; then
62+ echo " Creating cloud provider env failed!"
63+ exit 1
64+ fi
5565 echo " Sleeping for $try seconds"
5666 sleep ${try} s
5767done
5868
5969set -e
6070cd -
6171
62- # Build binaries
63- echo " Building machine-controller and webhook"
64- make machine-controller webhook
65-
6672# Create kubeadm cluster and install machine-controller onto it
6773echo " Creating kubeadm cluster and install machine-controller onto it."
74+ export E2E_SSH_PUBKEY=" $( cat ~ /.ssh/id_rsa.pub) "
6875./test/tools/integration/provision_master.sh
6976
7077# Run e2e test
7178echo " Running e2e test."
72- export KUBECONFIG=$GOPATH /src/github.com/kubermatic/machine-controller/.kubeconfig &&
73- go test -race -tags=e2e -parallel 240 -v -timeout 30m ./test/e2e/... -identifier=$BUILD_ID
79+ export KUBECONFIG=$GOPATH /src/github.com/kubermatic/machine-controller/.kubeconfig
80+ EXTRA_ARGS=" "
81+ if [[ $# -gt 0 ]]; then
82+ EXTRA_ARGS=" -run $1 "
83+ fi
84+ go test -race -tags=e2e -parallel 240 -v -timeout 30m ./test/e2e/... -identifier=$BUILD_ID $EXTRA_ARGS
0 commit comments