k3s/scripts/test

70 lines
1.8 KiB
Text
Raw Permalink Normal View History

2019-11-01 12:48:28 -04:00
#!/bin/bash
set -e -x
cd $(dirname $0)/..
. ./scripts/version.sh
. ./tests/docker/test-helpers
2019-11-01 12:48:28 -04:00
Update Kubernetes to v1.29.0+k3s1 (#9052) * Update to v1.29.0 Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Update to v1.29.0 Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Update go to 1.21.5 Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * update golangci-lint Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * update flannel to 0.23.0-k3s1 This update uses k3s' fork of flannel to allow the removal of multicluster cidr flag logic from the code Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * fix flannel calls Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * update cri-tools to version v1.29.0-k3s1 Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Remove GOEXPERIMENT=nounified from arm builds Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Skip golangci-lint Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Fix setup logging with newer go version Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Move logging flags to components arguments Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * add sysctl commands to the test script Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Update scripts/test Signed-off-by: Brad Davidson <brad@oatmail.org> * disable secretsencryption tests Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> --------- Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> Signed-off-by: Brad Davidson <brad@oatmail.org> Co-authored-by: Brad Davidson <brad@oatmail.org>
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
# ---
docker ps
export K3S_IMAGE="rancher/k3s:${VERSION_TAG}${SUFFIX}"
export VERSION_K8S # used by the sonobuoy tests subprocess
# ---
# 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' ]; then
go test ./tests/docker/basics/basics_test.go -k3sImage="$K3S_IMAGE" -ci
echo "Did go test basics $?"
# Extract v1.XX minor version for skew and upgrade tests
minor_version=$(echo $VERSION_K8S | cut -d '.' -f1,2)
go test ./tests/docker/cacerts/cacerts_test.go -k3sImage="$K3S_IMAGE" -ci
echo "Did go test cacerts $?"
go test ./tests/docker/skew/skew_test.go -k3sImage="$K3S_IMAGE" -channel="$minor_version" -ci
echo "Did go test skew $?"
go test ./tests/docker/bootstraptoken/bootstraptoken_test.go -k3sImage="$K3S_IMAGE" -ci
echo "Did go test bootstraptoken $?"
go test ./tests/docker/upgrade/upgrade_test.go -k3sImage="$K3S_IMAGE" -channel="$minor_version" -ci
echo "Did go test upgrade $?"
go test ./tests/docker/lazypull/lazypull_test.go -k3sImage="$K3S_IMAGE" -ci
echo "Did go test lazypull $?"
fi
2019-11-01 12:48:28 -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-01-20 18:22:23 -05:00
# ---
2019-11-01 12:48:28 -04:00
# Wait until all tests have finished
delay=15
(
set +x
while [ $(count-running-tests) -ge 1 ]; do
sleep $delay
done
)
exit 0