github.com/criteo/command-launcher@v0.0.0-20230407142452-fb616f546e98/test/integration/test-basic.sh (about) 1 #!/bin/bash 2 3 # required environment varibale 4 # CL_PATH 5 # CL_HOME 6 # OUTPUT_DIR 7 8 SCRIPT_DIR=${1:-$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )} 9 10 11 RESULT=$($OUTPUT_DIR/cl) 12 13 ## 14 # test application name 15 ## 16 echo "> test application name" 17 echo "$RESULT" | grep -q "Command Launcher - A command launcher" 18 if [ $? -ne 0 ]; then 19 echo "KO - wrong application name" 20 exit 1 21 else 22 echo "OK" 23 fi 24 25 ## 26 # test home folder & loacl repository 27 ## 28 echo "> test home folder & local repository" 29 30 if [ -d "$OUTPUT_DIR/home/current" ]; then 31 # ok 32 echo "OK" 33 else 34 echo "KO - local repository should exist" 35 exit 1 36 fi 37 38 ## 39 # test command list 40 ## 41 echo "> test default command list" 42 43 echo "$RESULT" | grep -q "hello" 44 if [ $? -ne 0 ]; then 45 # ok 46 echo "OK" 47 else 48 echo "KO - hello command shouldn't exist" 49 exit 1 50 fi