From 501cdc33b29102baed72d8d637e384f4a6395757 Mon Sep 17 00:00:00 2001 From: Bruno Goncalves Date: Feb 23 2018 13:52:52 +0000 Subject: do not try to give exec permission if command used is not a file --- diff --git a/roles/standard-test-basic/tasks/main.yml b/roles/standard-test-basic/tasks/main.yml index 049b638..ad84543 100644 --- a/roles/standard-test-basic/tasks/main.yml +++ b/roles/standard-test-basic/tasks/main.yml @@ -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