improve checks
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user