summaryrefslogtreecommitdiff
path: root/tests/bin
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-19 21:08:45 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-19 21:13:29 +0000
commit8e08e1a1fd6ba8f85cc71c5fd077e60c6062a4ce (patch)
tree59562954ab5baf1c981924dadd555bae409e9ad2 /tests/bin
parent2503321da3d58a1c51b4f7dd8b14a33a29e4b5aa (diff)
downloadalpine-conf-8e08e1a1fd6ba8f85cc71c5fd077e60c6062a4ce.zip
tests: make it possible to simluate wget failure
Make it possible to simulate wget errors by fetching an URL with 'fail' or '404' in the URL string. 'fail' results in DNS error(ish) and '404' returns a 404 error message.
Diffstat (limited to 'tests/bin')
-rwxr-xr-xtests/bin/wget7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/bin/wget b/tests/bin/wget
index 72306a4..5efc612 100755
--- a/tests/bin/wget
+++ b/tests/bin/wget
@@ -63,6 +63,13 @@ while true; do
shift
done
+for url; do
+ case "$url" in
+ *fail*) msg "bad address"; exit 1;;
+ *404*) msg "wget: server returned error: HTTP/1.1 404 Not Found"; exit 1;;
+ esac
+done
+
: ${outfile:=index.html}
case "$outfile" in
-) msg "writing to stdout"