diff --git a/hack/ci-e2e-test.sh b/hack/ci-e2e-test.sh index 6a7d6ce44..41ee17938 100755 --- a/hack/ci-e2e-test.sh +++ b/hack/ci-e2e-test.sh @@ -31,9 +31,14 @@ curl --retry 5 -LO \ chmod +x kubectl && mv kubectl /usr/local/bin +# Build binaries +echo "Building machine-controller and webhook" +make machine-controller webhook + # Generate ssh keypair -echo "Set permissions for ssh key" +echo "Generating ssh keypair" chmod 0700 $HOME/.ssh +ssh-keygen -t rsa -N "" -f ~/.ssh/id_ed25519 # Initialize terraform echo "Initalizing terraform" @@ -42,14 +47,14 @@ make terraform cp provider.tf{.disabled,} terraform init --input=false --backend-config=key=$BUILD_ID export TF_VAR_hcloud_token="${HZ_E2E_TOKEN}" -export TF_VAR_hcloud_sshkey_content="$(cat ~/.ssh/id_rsa.pub)" +export TF_VAR_hcloud_sshkey_content="$(cat ~/.ssh/id_ed25519.pub)" +export TF_VAR_hcloud_sshkey_name="$BUILD_ID" export TF_VAR_hcloud_test_server_name="machine-controller-test-${BUILD_ID}" for try in {1..20}; do set +e # Create environment at cloud provider echo "Creating environment at cloud provider." - terraform import hcloud_ssh_key.default 355488 terraform apply -auto-approve TF_RC=$? if [[ $TF_RC == 0 ]]; then break; fi @@ -64,15 +69,16 @@ done set -e cd - -# Build binaries -echo "Building machine-controller and webhook" -make machine-controller webhook - # Create kubeadm cluster and install machine-controller onto it echo "Creating kubeadm cluster and install machine-controller onto it." +export E2E_SSH_PUBKEY="$(cat ~/.ssh/id_rsa.pub)" ./test/tools/integration/provision_master.sh # Run e2e test echo "Running e2e test." -export KUBECONFIG=$GOPATH/src/github.com/kubermatic/machine-controller/.kubeconfig && -go test -race -tags=e2e -parallel 240 -v -timeout 30m ./test/e2e/... -identifier=$BUILD_ID +export KUBECONFIG=$GOPATH/src/github.com/kubermatic/machine-controller/.kubeconfig +EXTRA_ARGS="" +if [[ $# -gt 0 ]]; then + EXTRA_ARGS="-run $1" +fi +go test -race -tags=e2e -parallel 240 -v -timeout 30m ./test/e2e/... -identifier=$BUILD_ID $EXTRA_ARGS