diff --git a/scripts/docker-integration-tests/run.sh b/scripts/docker-integration-tests/run.sh index c2ce9e9e08..3bbdbc5f12 100755 --- a/scripts/docker-integration-tests/run.sh +++ b/scripts/docker-integration-tests/run.sh @@ -17,6 +17,29 @@ TESTS=( scripts/docker-integration-tests/coordinator_config_rules/test.sh ) +# Some systems, including our default Buildkite hosts, don't come with netcat +# installed and we may not have perms to install it. "Install" it in the worst +# possible way. +if ! command -v nc && [[ "$BUILDKITE" == "true" ]]; then + echo "installing netcat" + NCDIR="$(mktemp -d)" + + yumdownloader --destdir "$NCDIR" --resolve nc + ( + cd "$NCDIR" + RPM=$(find . -maxdepth 1 -name '*.rpm' | tail -n1) + rpm2cpio "$RPM" | cpio -id + ) + + export PATH="$PATH:$NCDIR/usr/bin" + + function cleanup_nc() { + rm -rf "$NCDIR" + } + + trap cleanup_nc EXIT +fi + scripts/docker-integration-tests/setup.sh NUM_TESTS=${#TESTS[@]}