Add isolated kind dependency testbed
This commit is contained in:
parent
74ac822d43
commit
5759938f3f
1 changed files with 1155 additions and 0 deletions
22
tests/kind/lib-test.sh
Executable file
22
tests/kind/lib-test.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
source "$ROOT/tests/kind/lib.sh"
|
||||
|
||||
if kube get namespaces >/dev/null 2>&1; then
|
||||
printf 'kube helper unexpectedly reached a cluster without fixture setup\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FIXTURE_LOCK_DIR="$RUNTIME/lock-test"
|
||||
FIXTURE_LOCK_PATH="$FIXTURE_LOCK_DIR/nuthatch-testbed-kind.lock"
|
||||
acquire_fixture_lock
|
||||
if XDG_RUNTIME_DIR="$FIXTURE_LOCK_DIR" bash -c \
|
||||
'source "$1"; acquire_fixture_lock' _ "$ROOT/tests/kind/lib.sh" 9>&-; then
|
||||
printf 'singleton fixture lock admitted a second worktree process\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
exec 9>&-
|
||||
|
||||
printf 'fixture isolation tests passed\n'
|
||||
Loading…
Reference in a new issue