mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
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:
parent
dd03d07355
commit
96df5d6410
4 changed files with 11 additions and 13 deletions
|
@ -34,7 +34,7 @@ function wait_for_service {
|
||||||
while ! nc -z localhost 6060; do
|
while ! nc -z localhost 6060; do
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
((count ++))
|
((count ++))
|
||||||
if [[ count == 21 ]]; then
|
if [[ $count == 21 ]]; then
|
||||||
fail "$@"
|
fail "$@"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -40,7 +40,7 @@ function setup_tests() {
|
||||||
while ! nc -z localhost 9999; do
|
while ! nc -z localhost 9999; do
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
((count ++))
|
((count ++))
|
||||||
if [[ count == 41 ]]; then
|
if [[ $count == 41 ]]; then
|
||||||
fail "mock server not up after 20s"
|
fail "mock server not up after 20s"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -2,6 +2,14 @@
|
||||||
|
|
||||||
BASE="./tests"
|
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 ]]
|
while [[ $# -gt 0 ]]
|
||||||
do
|
do
|
||||||
key="${1}"
|
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
|
main
|
||||||
|
|
|
@ -140,7 +140,7 @@ function down
|
||||||
rm -rf cs-firewall-bouncer-*
|
rm -rf cs-firewall-bouncer-*
|
||||||
rm -f crowdsec-release.tgz
|
rm -f crowdsec-release.tgz
|
||||||
rm -f cs-firewall-bouncer.tgz
|
rm -f cs-firewall-bouncer.tgz
|
||||||
rm *.md5
|
rm -- *.md5
|
||||||
}
|
}
|
||||||
|
|
||||||
function assert_equal
|
function assert_equal
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue