2019-11-01 12:48:28 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -e -x
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
|
2020-11-17 15:21:12 -05:00
|
|
|
. ./scripts/version.sh
|
2024-03-04 12:15:40 -05:00
|
|
|
. ./tests/docker/test-helpers
|
2019-11-01 12:48:28 -04:00
|
|
|
|
2023-12-18 22:14:02 -05:00
|
|
|
# sysctl commands
|
|
|
|
|
sysctl -w fs.inotify.max_queued_events=16384
|
|
|
|
|
sysctl -w fs.inotify.max_user_instances=8192
|
|
|
|
|
sysctl -w fs.inotify.max_user_watches=524288
|
|
|
|
|
sysctl -w user.max_inotify_instances=8192
|
|
|
|
|
sysctl -w user.max_inotify_watches=524288
|
|
|
|
|
|
2019-11-01 12:48:28 -04:00
|
|
|
artifacts=$(pwd)/dist/artifacts
|
|
|
|
|
mkdir -p $artifacts
|
|
|
|
|
|
|
|
|
|
# ---
|
|
|
|
|
|
2020-12-08 12:43:31 -05:00
|
|
|
docker ps
|
|
|
|
|
|
2025-02-06 16:39:50 -05:00
|
|
|
export K3S_IMAGE="rancher/k3s:${VERSION_TAG}${SUFFIX}"
|
2025-04-28 11:43:31 -04:00
|
|
|
export VERSION_K8S # used by the sonobuoy tests subprocess
|
2020-12-08 12:43:31 -05:00
|
|
|
# ---
|
2025-02-04 11:29:47 -05:00
|
|
|
# Only run PR tests on arm arch, we use GitHub Actions for amd64 and arm64
|
|
|
|
|
# Run all tests on tag events, as we want test failures to block the release
|
2025-11-21 15:26:26 -05:00
|
|
|
if [ "$ARCH" == 'arm' ]; then
|
2020-12-08 12:43:31 -05:00
|
|
|
|
2025-03-21 16:31:19 -04:00
|
|
|
go test ./tests/docker/basics/basics_test.go -k3sImage="$K3S_IMAGE" -ci
|
2024-11-26 15:30:52 -05:00
|
|
|
echo "Did go test basics $?"
|
|
|
|
|
|
2025-02-06 16:39:50 -05:00
|
|
|
# Extract v1.XX minor version for skew and upgrade tests
|
|
|
|
|
minor_version=$(echo $VERSION_K8S | cut -d '.' -f1,2)
|
2024-03-06 17:18:04 -05:00
|
|
|
|
2025-03-21 16:31:19 -04:00
|
|
|
go test ./tests/docker/cacerts/cacerts_test.go -k3sImage="$K3S_IMAGE" -ci
|
2025-02-06 16:39:50 -05:00
|
|
|
echo "Did go test cacerts $?"
|
2024-03-06 17:18:04 -05:00
|
|
|
|
2025-03-21 16:31:19 -04:00
|
|
|
go test ./tests/docker/skew/skew_test.go -k3sImage="$K3S_IMAGE" -channel="$minor_version" -ci
|
2025-02-06 16:39:50 -05:00
|
|
|
echo "Did go test skew $?"
|
2024-07-09 11:36:41 -04:00
|
|
|
|
2025-03-21 16:31:19 -04:00
|
|
|
go test ./tests/docker/bootstraptoken/bootstraptoken_test.go -k3sImage="$K3S_IMAGE" -ci
|
2025-02-06 16:39:50 -05:00
|
|
|
echo "Did go test bootstraptoken $?"
|
2024-03-06 17:18:04 -05:00
|
|
|
|
2025-03-21 16:31:19 -04:00
|
|
|
go test ./tests/docker/upgrade/upgrade_test.go -k3sImage="$K3S_IMAGE" -channel="$minor_version" -ci
|
2025-02-06 16:39:50 -05:00
|
|
|
echo "Did go test upgrade $?"
|
|
|
|
|
|
2025-03-21 16:31:19 -04:00
|
|
|
go test ./tests/docker/lazypull/lazypull_test.go -k3sImage="$K3S_IMAGE" -ci
|
2025-02-06 16:39:50 -05:00
|
|
|
echo "Did go test lazypull $?"
|
2024-03-06 17:18:04 -05:00
|
|
|
|
|
|
|
|
fi
|
2019-11-01 12:48:28 -04:00
|
|
|
|
2024-07-09 11:36:41 -04:00
|
|
|
|
2020-01-20 18:22:23 -05:00
|
|
|
# ---
|
2019-11-01 12:48:28 -04:00
|
|
|
|
2020-04-19 11:52:51 -04:00
|
|
|
[ "$ARCH" != 'amd64' ] && \
|
|
|
|
|
early-exit "Skipping remaining tests, images not available for $ARCH."
|
2020-03-09 20:19:02 -04:00
|
|
|
|
2020-01-20 18:22:23 -05:00
|
|
|
# ---
|
2019-11-01 12:48:28 -04:00
|
|
|
|
2023-03-10 22:53:41 -05:00
|
|
|
# Wait until all tests have finished
|
2022-01-31 13:57:23 -05:00
|
|
|
delay=15
|
|
|
|
|
(
|
|
|
|
|
set +x
|
|
|
|
|
while [ $(count-running-tests) -ge 1 ]; do
|
|
|
|
|
sleep $delay
|
|
|
|
|
done
|
|
|
|
|
)
|
2020-12-08 12:43:31 -05:00
|
|
|
|
|
|
|
|
exit 0
|