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-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
|
|
|
|
|
if [ "$ARCH" == 'arm' ] || [ "$DRONE_BUILD_EVENT" = 'tag' ]; then
|
2020-12-08 12:43:31 -05:00
|
|
|
|
2024-11-26 15:30:52 -05:00
|
|
|
export K3S_IMAGE="rancher/k3s:${VERSION_TAG}${SUFFIX}"
|
|
|
|
|
go test ./tests/docker/basics/basics_test.go -k3sImage="$K3S_IMAGE"
|
|
|
|
|
echo "Did go test basics $?"
|
|
|
|
|
|
2024-03-06 17:18:04 -05:00
|
|
|
. ./tests/docker/test-run-basics
|
|
|
|
|
echo "Did test-run-basics $?"
|
|
|
|
|
|
|
|
|
|
. ./tests/docker/test-run-cacerts
|
|
|
|
|
echo "Did test-run-cacerts $?"
|
|
|
|
|
|
2024-07-09 11:36:41 -04:00
|
|
|
. ./tests/docker/test-run-compat
|
|
|
|
|
echo "Did test-run-compat $?"
|
|
|
|
|
|
2024-03-06 17:18:04 -05:00
|
|
|
. ./tests/docker/test-run-bootstraptoken
|
|
|
|
|
echo "Did test-run-bootstraptoken $?"
|
|
|
|
|
|
|
|
|
|
. ./tests/docker/test-run-upgrade
|
|
|
|
|
echo "Did test-run-upgrade $?"
|
|
|
|
|
|
|
|
|
|
. ./tests/docker/test-run-lazypull
|
|
|
|
|
echo "Did test-run-lazypull $?"
|
|
|
|
|
fi
|
2019-11-01 12:48:28 -04:00
|
|
|
|
2024-07-09 11:36:41 -04:00
|
|
|
|
2025-02-04 11:29:47 -05:00
|
|
|
#TODO convert this to new go test framework
|
2024-03-04 12:15:40 -05:00
|
|
|
. ./tests/docker/test-run-hardened
|
2022-10-26 13:16:33 -04:00
|
|
|
echo "Did test-run-hardened $?"
|
|
|
|
|
|
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
|
|
|
|
2022-01-31 13:57:23 -05:00
|
|
|
if [ "$DRONE_BUILD_EVENT" = 'tag' ]; then
|
2023-03-10 22:53:41 -05:00
|
|
|
E2E_OUTPUT=$artifacts test-run-sonobuoy serial
|
|
|
|
|
echo "Did test-run-sonobuoy serial $?"
|
2022-01-31 13:57:23 -05:00
|
|
|
E2E_OUTPUT=$artifacts test-run-sonobuoy parallel
|
|
|
|
|
echo "Did test-run-sonobuoy parallel $?"
|
2020-03-09 20:19:02 -04:00
|
|
|
early-exit 'Skipping remaining tests on tag.'
|
2022-01-31 13:57:23 -05:00
|
|
|
fi
|
2020-01-20 18:22:23 -05:00
|
|
|
# ---
|
2019-11-01 12:48:28 -04:00
|
|
|
|
2023-03-10 22:53:41 -05:00
|
|
|
if [ "$DRONE_BUILD_EVENT" = 'cron' ]; then
|
|
|
|
|
E2E_OUTPUT=$artifacts test-run-sonobuoy serial
|
|
|
|
|
echo "Did test-run-sonobuoy serial $?"
|
|
|
|
|
test-run-sonobuoy etcd serial
|
|
|
|
|
echo "Did test-run-sonobuoy-etcd serial $?"
|
|
|
|
|
test-run-sonobuoy mysql serial
|
|
|
|
|
echo "Did test-run-sonobuoy-mysqk serial $?"
|
|
|
|
|
test-run-sonobuoy postgres serial
|
|
|
|
|
echo "Did test-run-sonobuoy-postgres serial $?"
|
|
|
|
|
|
|
|
|
|
# Wait until all serial tests have finished
|
|
|
|
|
delay=15
|
|
|
|
|
(
|
|
|
|
|
set +x
|
|
|
|
|
while [ $(count-running-tests) -ge 1 ]; do
|
|
|
|
|
sleep $delay
|
|
|
|
|
done
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
E2E_OUTPUT=$artifacts test-run-sonobuoy parallel
|
|
|
|
|
echo "Did test-run-sonobuoy parallel $?"
|
|
|
|
|
test-run-sonobuoy etcd parallel
|
|
|
|
|
echo "Did test-run-sonobuoy-etcd parallel $?"
|
|
|
|
|
test-run-sonobuoy mysql parallel
|
|
|
|
|
echo "Did test-run-sonobuoy-mysql parallel $?"
|
|
|
|
|
test-run-sonobuoy postgres parallel
|
|
|
|
|
echo "Did test-run-sonobuoy-postgres parallel $?"
|
|
|
|
|
fi
|
2022-01-31 13:57:23 -05: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
|