Skip to content

Commit 7a7ecb7

Browse files
committed
test(install): keep the Android guard test off the network
Point CBM_DOWNLOAD_URL, the documented download-base override in install.sh, at a closed loopback port. If a curl stub were ever missed on some leg, the download would then fail locally instead of fetching a real release. Check that the uname stub is the one PATH resolves before running install.sh. Otherwise the test would quietly exercise the real host instead of an Android one and prove nothing. Refs DeusData#1202 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 79f674e commit 7a7ecb7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎tests/test_install_android_guard.sh‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,16 @@ exit 99
2222
EOF
2323
chmod +x "$WORK/bin/uname" "$WORK/bin/curl"
2424

25+
# The stubs must be what install.sh sees, or this test proves nothing.
26+
if [ "$(PATH="$WORK/bin:$PATH" uname -o)" != "Android" ]; then
27+
printf 'FAIL: the uname stub is not picked up from PATH\n' >&2
28+
exit 1
29+
fi
30+
2531
set +e
26-
output=$(PATH="$WORK/bin:$PATH" HOME="$WORK/home" bash "$ROOT/install.sh" --skip-config 2>&1)
32+
output=$(PATH="$WORK/bin:$PATH" HOME="$WORK/home" \
33+
CBM_DOWNLOAD_URL="http://127.0.0.1:9/cbm-android-guard-test" \
34+
bash "$ROOT/install.sh" --skip-config 2>&1)
2735
rc=$?
2836
set -e
2937

0 commit comments

Comments
 (0)