diff --git a/scripts/test b/scripts/test index 3d8f93625b..c45b05f9cf 100755 --- a/scripts/test +++ b/scripts/test @@ -26,6 +26,9 @@ echo "Did test-run-hardened $?" . ./scripts/test-run-cacerts echo "Did test-run-cacerts $?" +. ./scripts/test-run-bootstraptoken +echo "Did test-run-bootstraptoken $?" + . ./scripts/test-run-upgrade echo "Did test-run-upgrade $?" diff --git a/scripts/test-run-bootstraptoken b/scripts/test-run-bootstraptoken new file mode 100755 index 0000000000..343ac91efe --- /dev/null +++ b/scripts/test-run-bootstraptoken @@ -0,0 +1,28 @@ +#!/bin/bash + +all_services=( + coredns + local-path-provisioner + metrics-server + traefik +) + +export NUM_SERVERS=1 +export NUM_AGENTS=1 +export WAIT_SERVICES="${all_services[@]}" + +agent-pre-hook() { + local server=$(cat $TEST_DIR/servers/1/metadata/name) + docker exec $server k3s token create --ttl=5m --description=Test > $TEST_DIR/metadata/secret +} +export -f agent-pre-hook + +start-test() { + echo "Cluster is up with ephemeral join token" +} +export -f start-test + +# --- create a basic cluster with an agent joined using the ephemeral token and check for functionality +LABEL=BOOTSTRAP-TOKEN run-test + +cleanup-test-env