improve checks

This commit is contained in:
2026-11-04 10:11:29 -07:00
parent c33736775b
commit b41b70619d
7 changed files with 26 additions and 6 deletions
+4 -1
View File
@@ -27,11 +27,14 @@ setup() {
stub ss
stub ssh-keygen 'touch "${@: -1}" "${@: -1}.pub"'
stub systemctl
# Like a real SSH session, the command gets no controlling terminal: the
# driver runs bash -i, which would otherwise try to take over the one bats
# runs in, and be stopped for it
stub ssh 'while [ $# -gt 0 ]; do
case "$1" in -i | -o | -p) shift 2 ;; *@*) shift; break ;; *) shift ;; esac
done
[ $# -gt 0 ] || exit 0
cd "$HOME" && exec bash -c "$*"'
cd "$HOME" && exec setsid -w bash -c "$*"'
stub scp 'dest="${*: -1}"; cp "${@: -2:1}" "${dest#*:}"'
SC="$WC/smoketest/scenarios"
+2
View File
@@ -9,6 +9,8 @@
# shellcheck disable=SC2034
PROJECT="$(cd "$BATS_TEST_DIRNAME/.." && pwd)"
# UPSTREAM, DEPLOYED and WC are used by the .bats files
# shellcheck disable=SC2034
common_setup() {
export HOME="$BATS_TEST_TMPDIR/home"
export STUB_BIN="$BATS_TEST_TMPDIR/bin"