Shell fixes (#1056)

* broken test

* don't expand filenames into options

* fix for ./test_env.sh -h => ./test_env.sh: line 15: usage: command not found
This commit is contained in:
mmetc 2021-11-30 10:08:59 +01:00 committed by GitHub
parent dd03d07355
commit 96df5d6410
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 13 deletions

View file

@ -34,7 +34,7 @@ function wait_for_service {
while ! nc -z localhost 6060; do
sleep 0.5
((count ++))
if [[ count == 21 ]]; then
if [[ $count == 21 ]]; then
fail "$@"
fi
done

View file

@ -40,7 +40,7 @@ function setup_tests() {
while ! nc -z localhost 9999; do
sleep 0.5
((count ++))
if [[ count == 41 ]]; then
if [[ $count == 41 ]]; then
fail "mock server not up after 20s"
fi
done

View file

@ -2,6 +2,14 @@
BASE="./tests"
usage() {
echo "Usage:"
echo " ./wizard.sh -h Display this help message."
echo " ./test_env.sh -d ./tests Create test environment in './tests' folder"
exit 0
}
while [[ $# -gt 0 ]]
do
key="${1}"
@ -111,14 +119,4 @@ main() {
}
usage() {
echo "Usage:"
echo " ./wizard.sh -h Display this help message."
echo " ./env_test.sh -d ./tests Create test environment in './tests' folder"
exit 0
}
main

View file

@ -140,7 +140,7 @@ function down
rm -rf cs-firewall-bouncer-*
rm -f crowdsec-release.tgz
rm -f cs-firewall-bouncer.tgz
rm *.md5
rm -- *.md5
}
function assert_equal