Ask for the VARA and Winlink zips when winlink.org won't serve them
downloads.winlink.org now puts a Cloudflare browser check in front of every page, so the installers' download fails with a 403 and updates ended with an error (report CD-NTEU79). Look for the zip in the user's Downloads folder first, and if it isn't there and the site refuses, list which zips to download and from where instead of failing the update. A zip that won't extract or an installer that doesn't finish is still an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
354a4cbe03
commit
bb5c7900d5
+41
-1
@@ -8,6 +8,8 @@ setup() {
|
||||
setup_fake_home
|
||||
fake_coredesktop
|
||||
stub curl 'exit 1'
|
||||
# So xdg-user-dir reads the fake home's (absent) settings, not the real ones
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
}
|
||||
|
||||
install_all_windows_apps() {
|
||||
@@ -30,10 +32,48 @@ install_all_windows_apps() {
|
||||
export DISPLAY=:0
|
||||
run bash "$REPO/install-windows-apps.sh"
|
||||
[[ "$output" == *"VARA HF is already installed"* ]]
|
||||
[[ "$output" == *"VARA Terminal was not installed"* ]]
|
||||
grep -q "^curl .*VARA%20Products" "$STUB_LOG"
|
||||
}
|
||||
|
||||
@test "windows apps: when winlink.org refuses the download, the user is asked to download it and the update isn't failed" {
|
||||
install_all_windows_apps
|
||||
rm "$HOME/.wine/drive_c/VARA/VARA Terminal.exe"
|
||||
export DISPLAY=:0
|
||||
run bash "$REPO/install-windows-apps.sh"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"VARA Terminal, from https://downloads.winlink.org/VARA%20Products/"* ]]
|
||||
[[ "$output" == *"Leave them in $HOME/Downloads"* ]]
|
||||
[[ "$output" != *"VARA HF, from"* ]]
|
||||
! grep -q '^wine .*\.exe' "$STUB_LOG"
|
||||
}
|
||||
|
||||
@test "windows apps: a zip in the downloads folder is installed without downloading" {
|
||||
install_all_windows_apps
|
||||
rm "$HOME/.wine/drive_c/VARA/VARA Terminal.exe"
|
||||
mkdir -p "$HOME/Downloads" "$BATS_TEST_TMPDIR/zip"
|
||||
touch "$BATS_TEST_TMPDIR/zip/VARA Terminal setup.exe"
|
||||
(cd "$BATS_TEST_TMPDIR/zip" && zip -q "$HOME/Downloads/VARA Terminal v1.2.3 setup.zip" "VARA Terminal setup.exe")
|
||||
stub wine 'case "$1" in *.exe) touch "$HOME/.wine/drive_c/VARA/VARA Terminal.exe" ;; esac'
|
||||
export DISPLAY=:0
|
||||
run bash "$REPO/install-windows-apps.sh"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"VARA Terminal installed."* ]]
|
||||
grep -q '^wine .*VARA Terminal setup.exe' "$STUB_LOG"
|
||||
! grep -q '^curl ' "$STUB_LOG"
|
||||
}
|
||||
|
||||
@test "windows apps: a zip saved with underscores for spaces is found too" {
|
||||
install_all_windows_apps
|
||||
rm "$HOME/.wine/drive_c/VARA/VARA Terminal.exe"
|
||||
mkdir -p "$HOME/Downloads"
|
||||
echo "not a zip" > "$HOME/Downloads/VARA_Terminal_v1.2.3.zip"
|
||||
export DISPLAY=:0
|
||||
run bash "$REPO/install-windows-apps.sh"
|
||||
[[ "$output" == *"Using $HOME/Downloads/VARA_Terminal_v1.2.3.zip"* ]]
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "$output" == *"VARA Terminal was not installed"* ]]
|
||||
}
|
||||
|
||||
@test "windows apps: without a desktop session, nothing is downloaded and the update isn't failed" {
|
||||
run bash "$REPO/install-windows-apps.sh"
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
Reference in New Issue
Block a user