]> source.dussan.org Git - nextcloud-server.git/commitdiff
script shall exit with error in case the start file has issues - fixes #20798
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 9 Dec 2015 11:09:45 +0000 (12:09 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 9 Dec 2015 11:09:45 +0000 (12:09 +0100)
autotest-external.sh

index 86fb796627ca82a8bb5eadf11459f942fc79c578..6128f68136f9a83c8d1996095bfb80732d30413a 100755 (executable)
@@ -193,7 +193,8 @@ EOF
                echo "name: $name"
 
                # execute start file
-               if ./$FILES_EXTERNAL_BACKEND_ENV_PATH/$startFile; then
+               ./$FILES_EXTERNAL_BACKEND_ENV_PATH/$startFile
+               if [ $? -eq 0 ]; then
                        # getting backend to test from filename
                        # it's the part between the dots startSomething.TestToRun.sh
                        testToRun=`echo $startFile | cut -d '-' -f 2`
@@ -209,6 +210,8 @@ EOF
                                "$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1-$name.xml" "$FILES_EXTERNAL_BACKEND_PATH/$testToRun.php"
                                RESULT=$?
                        fi
+               else
+                   DOEXIT=1
                fi
 
                # calculate stop file
@@ -218,6 +221,10 @@ EOF
                        # execute stop file if existant
                        ./$FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile
                fi
+               if [ "$DOEXIT" ]; then
+                   echo "Error during start file execution ... terminating"
+                   exit $DOEXIT
+               fi
        done;
 }