Browse Source

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
mmetc 3 years ago
parent
commit
96df5d6410

+ 1 - 1
scripts/func_tests/tests_base.sh

@@ -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

+ 1 - 1
scripts/func_tests/tests_post-install_7_plugin.sh

@@ -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

+ 8 - 10
scripts/test_env.sh

@@ -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

+ 1 - 1
scripts/test_wizard_upgrade.sh

@@ -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