#129 do not try to give exec permission if command used is not a file
Merged 6 years ago by astepano. Opened 6 years ago by bgoncalv.
bgoncalv/standard-test-roles basic-script-fix  into  master

@@ -6,8 +6,11 @@ 

        logfile={{ remote_artifacts }}/test.$(echo $TEST | sed -e 's/\//-/g').log

        exec 2>>$logfile 1>>$logfile

        cd $TEST_DIR

-       #make script executable

-       chmod 0775 $(echo $TEST_CMD | awk '{print $1;}')

+       #if command is a file make it executable

+       cmd="$(echo $TEST_CMD | awk '{print $1;}')"

+       if [ -f "$cmd" ]; then

+           chmod 0775 "$cmd"

+       fi

        #execute the test

        eval $TEST_CMD

        if [ $? -eq 0 ]; then

For example, do not try to give exec permission if command that will run is on $PATH

Please add "..." to escape whitespace issues in filepath

rebased onto 501cdc3

6 years ago

Commit f44a662 fixes this pull-request

Pull-Request has been merged by astepano

6 years ago

Pull-Request has been merged by astepano

6 years ago
Metadata