summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapps/files_external/tests/env/start-smb-windows.sh6
-rwxr-xr-xautotest-external.sh81
2 files changed, 46 insertions, 41 deletions
diff --git a/apps/files_external/tests/env/start-smb-windows.sh b/apps/files_external/tests/env/start-smb-windows.sh
index 2143d7e7499..6779cdb2d56 100755
--- a/apps/files_external/tests/env/start-smb-windows.sh
+++ b/apps/files_external/tests/env/start-smb-windows.sh
@@ -19,6 +19,12 @@ user=smb-test
password=!owncloud123
host=WIN-9GTFAS08C15
+if ! (nc -c -w 1 ${host} 445 </dev/null >&/dev/null \
+ || nc -w 1 ${host} 445 </dev/null >&/dev/null); then
+ echo "[ERROR] Server not reachable" >&2
+ exit 1
+fi
+
cat > $thisFolder/config.smb.php <<DELIM
<?php
diff --git a/autotest-external.sh b/autotest-external.sh
index b738669b48c..86fb796627c 100755
--- a/autotest-external.sh
+++ b/autotest-external.sh
@@ -175,57 +175,56 @@ EOF
fi
if [ -n "$2" -a "$2" == "common-tests" ]; then
- return;
+ return;
fi
- FILES_EXTERNAL_BACKEND_PATH=../apps/files_external/tests/backends
- FILES_EXTERNAL_BACKEND_ENV_PATH=../apps/files_external/tests/env
+ FILES_EXTERNAL_BACKEND_PATH=../apps/files_external/tests/backends
+ FILES_EXTERNAL_BACKEND_ENV_PATH=../apps/files_external/tests/env
for startFile in `ls -1 $FILES_EXTERNAL_BACKEND_ENV_PATH | grep start`; do
- name=`echo $startFile | sed 's/start-//' | sed 's/\.sh//'`
-
- if [ -n "$2" -a "$2" != "$name" ]; then
- echo "skip: $startFile"
- continue;
- fi
-
- echo "start: $startFile"
- echo "name: $name"
-
- # execute start file
- ./$FILES_EXTERNAL_BACKEND_ENV_PATH/$startFile
-
- # getting backend to test from filename
- # it's the part between the dots startSomething.TestToRun.sh
- testToRun=`echo $startFile | cut -d '-' -f 2`
-
- # run the specific test
- if [ -z "$NOCOVERAGE" ]; then
- rm -rf "coverage-external-html-$1-$name"
- mkdir "coverage-external-html-$1-$name"
- "$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1-$name.xml" --coverage-clover "autotest-external-clover-$1-$name.xml" --coverage-html "coverage-external-html-$1-$name" "$FILES_EXTERNAL_BACKEND_PATH/$testToRun.php"
- RESULT=$?
- else
- echo "No coverage"
- "$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1-$name.xml" "$FILES_EXTERNAL_BACKEND_PATH/$testToRun.php"
- RESULT=$?
- fi
-
- # calculate stop file
- stopFile=`echo "$startFile" | sed 's/start/stop/'`
- echo "stop: $stopFile"
- if [ -f $FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile ]; then
- # execute stop file if existant
- ./$FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile
- fi
+ name=`echo $startFile | sed 's/start-//' | sed 's/\.sh//'`
+
+ if [ -n "$2" -a "$2" != "$name" ]; then
+ echo "skip: $startFile"
+ continue;
+ fi
+
+ echo "start: $startFile"
+ echo "name: $name"
+
+ # execute start file
+ if ./$FILES_EXTERNAL_BACKEND_ENV_PATH/$startFile; then
+ # getting backend to test from filename
+ # it's the part between the dots startSomething.TestToRun.sh
+ testToRun=`echo $startFile | cut -d '-' -f 2`
+
+ # run the specific test
+ if [ -z "$NOCOVERAGE" ]; then
+ rm -rf "coverage-external-html-$1-$name"
+ mkdir "coverage-external-html-$1-$name"
+ "$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1-$name.xml" --coverage-clover "autotest-external-clover-$1-$name.xml" --coverage-html "coverage-external-html-$1-$name" "$FILES_EXTERNAL_BACKEND_PATH/$testToRun.php"
+ RESULT=$?
+ else
+ echo "No coverage"
+ "$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1-$name.xml" "$FILES_EXTERNAL_BACKEND_PATH/$testToRun.php"
+ RESULT=$?
+ fi
+ fi
+
+ # calculate stop file
+ stopFile=`echo "$startFile" | sed 's/start/stop/'`
+ echo "stop: $stopFile"
+ if [ -f $FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile ]; then
+ # execute stop file if existant
+ ./$FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile
+ fi
done;
}
#
# start test execution
#
-if [ -z "$1" ]
- then
+if [ -z "$1" ]; then
# run all known database configs
for DBCONFIG in $DBCONFIGS; do
execute_tests $DBCONFIG "$2"