talos/hack/test/basic-integration.sh
Andrey Smirnov ebd40bd0eb chore: use osctl cluster --wait in basic-integration
There are few workarounds for Drone way of running integration test:
DinD runs as a separate pod, and we can only access its exposed on the
"host" ports, while from Talos cluster this endpoint is not reachable.

So internally Talos nodes still use addresses like "10.5.0.2", while
test is using "docker" to access it (that's name of the `docker` service
in the pipeline).

When running locally, 127.0.0.1 is used as endpoint, which should work
fine both on OS X and Linux.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-12-30 15:15:42 -08:00

38 lines
778 B
Bash
Executable File

#!/bin/bash
set -eou pipefail
TALOS_IMG="docker.io/autonomy/talos:${TAG}"
OSCTL="${PWD}/${ARTIFACTS}/osctl-linux-amd64"
INTEGRATIONTEST="${PWD}/bin/integration-test"
TMP="/tmp/e2e"
export TALOSCONFIG="${TMP}/talosconfig"
case "${CI:-false}" in
true)
ENDPOINT="docker"
;;
*)
ENDPOINT="127.0.0.1"
;;
esac
case $(uname -s) in
Linux*)
LOCALOSCTL="${PWD}/${ARTIFACTS}/osctl-linux-amd64"
;;
Darwin*)
LOCALOSCTL="${PWD}/${ARTIFACTS}/osctl-darwin-amd64"
;;
*)
exit 1
;;
esac
mkdir -p "${TMP}"
${LOCALOSCTL} cluster create --name integration --image ${TALOS_IMG} --masters=3 --mtu 1440 --cpus 4.0 --wait --endpoint "${ENDPOINT}"
"${INTEGRATIONTEST}" -test.v -talos.osctlpath "${LOCALOSCTL}" -talos.k8sendpoint "${ENDPOINT}:6443"