Files
threshold/internal/tests/cli/boundary/_helpers.bash
T
Johan Brandhorst-SatzkornandTimothy Messier 5dbcda512a Fix enos bats test errors (#2468)
* test(cli): Remove skips in CI for cli tests

* fix(enos): Fix enos bats tests

The tests still sometimes suffer from timing issues,
but I was able to run a successful run (setup, run, destroy)
of the tests from my machine at least once.

There were 2 issues:

- Some tests in groups.bats were hardcoding the default user id
- The default grants for a user in a project were missing
   the permission to connect to a target. We now add this
   explicitly.

Co-authored-by: Timothy Messier <tim.messier@gmail.com>
2022-09-20 14:39:28 -04:00

35 lines
1.1 KiB
Bash

export BOUNDARY_ADDR="${BOUNDARY_ADDR:-http://127.0.0.1:9200}"
export DEFAULT_PASSWORD="${DEFAULT_PASSWORD:-password}"
export DEFAULT_LOGIN="${DEFAULT_LOGIN:-admin}"
export DEFAULT_UNPRIVILEGED_LOGIN="${DEFAULT_UNPRIVILEGED_LOGIN:-user}"
export DEFAULT_AMPW="${DEFAULT_AMPW:-ampw_1234567890}"
export DEFAULT_P_ID="${DEFAULT_P_ID:-p_1234567890}"
export DEFAULT_O_ID="${DEFAULT_O_ID:-o_1234567890}"
export DEFAULT_GLOBAL='global'
export DEFAULT_TARGET="${DEFAULT_TARGET:-ttcp_1234567890}"
export DEFAULT_HOST_SET="${DEFAULT_HOST_SET:-hsst_1234567890}"
export DEFAULT_HOST_CATALOG="${DEFAULT_HOST_CATALOG:-hcst_1234567890}"
export DEFAULT_HOST="${DEFAULT_HOST:-hst_1234567890}"
export DEFAULT_USER="${DEFAULT_USER:-u_1234567890}"
export DEFAULT_UNPRIVILEGED_USER="${DEFAULT_UNPRIVILEGED_USER:-u_0987654321}"
function strip() {
echo "$1" | tr -d '"'
}
function strip_all() {
echo "$1" | tr -d '"' | tr -d '\'\'
}
function has_status_code() {
local json=$1
local code=$2
if [ echo "$json"|jq -c ".status_code == $code" ]; then
return 1
fi
}
diag() {
echo "$@" | sed -e 's/^/# /' >&3 ;
}