diff options
Diffstat (limited to 'test/run-tests.sh')
| -rwxr-xr-x | test/run-tests.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/run-tests.sh b/test/run-tests.sh index a88e024..415ecc3 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -276,5 +276,21 @@ else bad "apk validation" "rc=$rc out=$out" fi +# 23. A real, large APK must be accepted. The first version of the zip check used +# `unzip -l | grep -q`, which under pipefail SIGPIPEs unzip and rejects valid files -- +# the very trap this repo's README documents. +realapk="$tmproot/real.apk" +mkdir -p "$tmproot/apkbuild/res" +printf 'manifest' > "$tmproot/apkbuild/AndroidManifest.xml" +# Enough entries that grep matches well before the listing ends, which is when SIGPIPE bites. +for i in $(seq 1 300); do printf 'x%.0s' $(seq 1 100) > "$tmproot/apkbuild/res/f$i.bin"; done +( cd "$tmproot/apkbuild" && zip -q -r "$realapk" . ) +out=$("$BIN/publish-apk" "$realapk" thing.apk --host "$(hostname)" --dir "$tmproot/nonexistent" 2>&1); rc=$? +if printf '%s' "$out" | grep -qi "not an APK\|not a zip"; then + bad "valid APK rejected" "out=$out" +else + ok "accepts a real multi-entry APK (no SIGPIPE from the zip check)" +fi + printf '\n=== summary: %d passed, %d failed ===\n' "$pass" "$fail" [ "$fail" -eq 0 ] |
