Skip to content
Snippets Groups Projects
Commit d0899a57 authored by Laura Nao's avatar Laura Nao
Browse files

Merge branch 'wip/extend-network-test' into 'master'

network: add more domains and update test logic

See merge request !9
parents 13d27c50 6ffc0089
No related branches found
No related tags found
1 merge request!9network: add more domains and update test logic
#!/bin/sh
set -e
if [ "$LAVA" = "y" ]; then
alias test-result='lava-test-case'
alias test-exception='lava-test-raise'
else
alias test-result='echo'
alias test-exception='echo'
fi
if ! command -v nc >/dev/null; then
echo "nc could not be found"
exit 1
fi
set -- "google.com" \
"kernel.org" \
"deb.debian.org" \
"gitlab.collabora.com" \
"gitlab.freedesktop.org" \
"images.apertis.org"
count=0
for domain in "$@"; do
if nc -vz -w 1 "$domain" 443; then
res=pass
count=$((count + 1))
else
res=fail
fi
test-result $domain --result "$res"
done
if [ "$count" -gt 0 ]; then
test-result network-test --result pass --measurement "$count" --units domains
else
test-result network-test --result fail --measurement "$count" --units domains
test-exception "Network not able to connect; job exit"
exit 1
fi
exit 0
......@@ -5,5 +5,4 @@ metadata:
run:
steps:
- lava-test-case network-test-google --shell 'nc -vz -w 1 google.com 443 || lava-test-raise "Network not able to connect; job exit"'
- lava-test-case network-test-kernelorg --shell 'nc -vz -w 1 kernel.org 443 || lava-test-raise "Network not able to connect; job exit"'
\ No newline at end of file
- LAVA=y /bin/sh network/network.sh
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment