Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/test_host_port_bind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,22 @@ same() { # same <label> <got> <expected>
fail=1
fi
}
# shellcheck disable=SC2329 # called by the functions eval'd below
# shellcheck disable=SC2317,SC2329 # called indirectly by functions eval'd below
die() { echo "die: $*"; }
# shellcheck disable=SC2329
# shellcheck disable=SC2317,SC2329
warn() { printf '%s\n' "$*" >>"$stubs/warns"; }
for fn in fwd_bind build_hostfwd resolve_ports; do
eval "$(awk -v f="$fn" '$0 ~ "^" f "\\(\\) \\{" { on = 1 } on { print } on && /^}/ { exit }' setup/host/qemu_vm.sh)"
done
# shellcheck disable=SC2034 # used by eval-loaded functions from setup/host/qemu_vm.sh
PORTS_EXPOSED="http https"
RESOLVED_SPEC="ssh:4242:4242 http:8082:8880 https:8443:8443"
same "exposed forwards bind 0.0.0.0, ssh stays on loopback" "$(build_hostfwd)" \
",hostfwd=tcp:127.0.0.1:4242-:4242,hostfwd=tcp:0.0.0.0:8082-:8880,hostfwd=tcp:0.0.0.0:8443-:8443"
# shellcheck disable=SC2034 # read by the eval'd resolve_ports
PORTS_SPEC="ssh:4242:4242 https:8443:8443"
LISTENERS="192.168.1.132:8443"
# shellcheck disable=SC2034 # used by eval-loaded functions from setup/host/qemu_vm.sh
RESERVED_HOST_PORTS=""
resolve_ports
same "exposed: a LAN-address listener is a conflict" "$RESOLVED_SPEC" "ssh:4242:4242 https:8444:8443"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_verify_platform_wall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ chmod +x "$TMP/bin/ss" "$TMP/bin/docker"
# Read by hard() and the wall block, both run through eval below.
# shellcheck disable=SC2034
C_R='' C_RED='' C_DIM=''
# shellcheck disable=SC2329
# shellcheck disable=SC2329,SC2317
ok() { printf 'PASS %s\n' "$*"; }
# shellcheck disable=SC2329
# shellcheck disable=SC2329,SC2317
vm_ssh() { PATH="$TMP/bin:$PATH" bash -c "$1"; }
eval "$(awk '/^hard\(\) \{/,/^}/' "$SCRIPT")"
WALL=$(awk '/^# ── the wall/ { on = 1 } on && /^printf .\\n.$/ { exit } on' "$SCRIPT")
Expand Down
Loading