tests: use wc -m to support BSD and macOS

This commit is contained in:
Hans-Christoph Steiner 2021-01-07 17:09:44 +01:00
parent 16d3f89b5c
commit 81b55e0d8f
No known key found for this signature in database
GPG Key ID: 3E177817BA1B9BFA
1 changed files with 1 additions and 1 deletions

View File

@ -1266,7 +1266,7 @@ if which wget; then
mv $REPOROOT/index-v1.json repo/index-v1.json
port=321${RANDOM:3}
test $(printf $port | wc --chars) -le 3 && port=52734 # when $RANDOM doesn't work
test $(printf $port | wc -m) -le 3 && port=52734 # when $RANDOM doesn't work
timeout 5m python3 -m http.server $port --bind 127.0.0.1 > $REPOROOT/http.server.log 2>&1 &
http_server_pid=$!