S007: network smoke tests, local test server, selftest cancel_download, @HOME@ in smoke scripts

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-12 10:26:07 -06:00
commit 5389719c98

View file

@ -23,7 +23,8 @@
# Script commands (src/selftest.rs has the full list): wait <s>, waitload [s], open <url>, newtab <url>,
# page <nacre://...>, shot <name>, status <name>, set <json pointer> <json>, flyout <name>, do <action>,
# cmd <name> [arg], js <script>, assert <js>, click|rclick <x> <y>, pagetype <text>, log <text>, quit. Lines starting with # are notes.
# In the script, @PAGES@ is replaced by the file:// URL of tests/smoke/pages, @PAGESDIR@ by its path.
# In the script, @PAGES@ is replaced by the file:// URL of tests/smoke/pages, @PAGESDIR@ by its path, @HOME@ by the
# throwaway home.
#
# Never uses the user's profile, display, Discord socket or session bus; never sets a proxy.
set -u
@ -48,7 +49,7 @@ home=${SMOKE_HOME:-$out/home}
mkdir -p "$home"
home=$(cd "$home" && pwd)
rm -f "$out"/*.png "$out"/*.json "$out/selftest.log" "$out/nacre.log"
sed -e "s|@PAGES@|file://$root/tests/smoke/pages|g" -e "s|@PAGESDIR@|$root/tests/smoke/pages|g" "$script" >"$out/script.txt"
sed -e "s|@PAGES@|file://$root/tests/smoke/pages|g" -e "s|@PAGESDIR@|$root/tests/smoke/pages|g" -e "s|@HOME@|$home|g" "$script" >"$out/script.txt"
runtime=$(mktemp -d /tmp/nacre-smoke-XXXXXX)
chmod 700 "$runtime"