Skip to content

Commit

Permalink
[ci] integration: "Install" netcat if needed (#2161)
Browse files Browse the repository at this point in the history
We recently updated our Buildkite stack. The new version of the agents
doesn't come with netcat installed, which we use in our integration
tests. "Install" it if necessary.
  • Loading branch information
schallert authored Feb 21, 2020
1 parent 3da5a7e commit 7fdea6b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/docker-integration-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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[@]}
Expand Down

0 comments on commit 7fdea6b

Please sign in to comment.