Files
threshold/internal/tests/cli/test.sh
T
429247f407 [COMPLIANCE] Update Copyright Headers (#6282)
* [COMPLIANCE] Update Copyright and License Headers

* chore: make gen to generate files with copyright headers

* chore: update missed copyright headers

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Justin Nguyen <justin.nguyen@hashicorp.com>
2026-01-28 11:05:07 -06:00

48 lines
978 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright IBM Corp. 2020, 2025
# SPDX-License-Identifier: BUSL-1.1
# TERM isn't set automatically in CI so we need to make sure it's always there.
export TERM=${TERM:=dumb}
function die {
echo $*
exit -1
}
# error out early if missing a command
which boundary || die "missing boundary"
which jq || die "missing jq"
which bats || die "missing bats"
which nc || die "missing nc"
echo "starting boundary dev in background"
boundary dev --create-loopback-plugin &>/dev/null &
boundary_pid=$!
function cleanup {
rv=$?
echo "stopping boundary dev"
if [[ -n ${boundary_pid} ]]; then
kill ${boundary_pid}
fi
exit $rv
}
trap cleanup EXIT
max=120
c=0
until boundary scopes list; do
echo 'waiting for boundary to be up'
((c+=1))
if [[ $c -ge $max ]]; then
die "timeout waiting for boundary controller to get healthy"
fi
sleep 1
done
echo "running bats tests"
bats -p ./boundary