Skip to content

Commit

Permalink
Add CI test
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
brandond committed Feb 7, 2023
1 parent 9b9c9dd commit 745c393
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -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 $?"

Expand Down
28 changes: 28 additions & 0 deletions scripts/test-run-bootstraptoken
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 745c393

Please sign in to comment.