From 00ae0f5fda2bd9b59741940f2e45ebef3cf4aef1 Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 6 Dec 2016 14:00:48 +0100 Subject: [PATCH 1/4] Fixing remote third party check url not set right --- dev/tests/run_tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/run_tests.sh b/dev/tests/run_tests.sh index f26a317..263b149 100755 --- a/dev/tests/run_tests.sh +++ b/dev/tests/run_tests.sh @@ -7,7 +7,7 @@ ## On CYGWIN / MSYS, ACL and extended attributes aren't supported -# osync test suite 2016120601 +# osync test suite 2016120602 # 4 tests: # quicklocal @@ -196,7 +196,7 @@ function oneTimeSetUp () { else echo "Running with local settings" REMOTE_USER="root" - SetConfFileValue "$CONF_DIR/$REMOTE_CONF" "REMOTE_3RD_PARTY_HOSTS" "www.kernel.org www.google.com" + SetConfFileValue "$CONF_DIR/$REMOTE_CONF" "REMOTE_3RD_PARTY_HOSTS" "\"www.kernel.org www.google.com\"" fi # Get default ssh port from env @@ -1015,7 +1015,7 @@ function test_Locking () { echo 65536@bogusinstance > "$TARGET_DIR/$OSYNC_WORKDIR/lock" REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__confRemote]} - assertEquals "Should not be able to resume remote locked target with bgous instance_id in confRemote mode." "1" $? + assertEquals "Should not be able to resume remote locked target with bogus instance_id in confRemote mode." "1" $? # Target lock present should be resumed if instance ID is NOT the same as current one but FORCE_STRANGER_UNLOCK=yes From 467cb717add93c386678cd9ec33fcace12b0bc8f Mon Sep 17 00:00:00 2001 From: deajan Date: Thu, 8 Dec 2016 10:53:47 +0100 Subject: [PATCH 2/4] Some msys fixes --- dev/tests/run_tests.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/tests/run_tests.sh b/dev/tests/run_tests.sh index 263b149..2369b73 100755 --- a/dev/tests/run_tests.sh +++ b/dev/tests/run_tests.sh @@ -7,7 +7,7 @@ ## On CYGWIN / MSYS, ACL and extended attributes aren't supported -# osync test suite 2016120602 +# osync test suite 2016120801 # 4 tests: # quicklocal @@ -387,7 +387,7 @@ function test_Deletetion () { } function test_deletion_failure () { - if [ "$LOCAL_OS" == "WinNT10" ]; then + if [ "$LOCAL_OS" == "WinNT10" ] || [ "$LOCAL_OS" == "msys" ]; then echo "Skipping deletion failure test as Win10 does not have chattr support." return 0 fi @@ -734,7 +734,7 @@ function test_softdeletion_cleanup () { touch "$file.new" - if [ "$TRAVIS_RUN" == true ] || [ "$LOCAL_OS" == "BSD" ] || [ "$LOCAL_OS" == "MacOSX" ] || [ "$LOCAL_OS" == "WinNT10" ] || [ "LOCAL_OS" == "msys" ]; then + if [ "$TRAVIS_RUN" == true ] || [ "$LOCAL_OS" == "BSD" ] || [ "$LOCAL_OS" == "MacOSX" ] || [ "$LOCAL_OS" == "WinNT10" ] || [ "$LOCAL_OS" == "msys" ]; then echo "Skipping changing ctime on file because travis / bsd / macos / Win10 / msys / cygwin does not support debugfs" else CreateOldFile "$file.old" @@ -768,8 +768,8 @@ function test_FileAttributePropagation () { return 0 fi - if [ "$LOCAL_OS" == "MacOSX" ]; then - echo "Skipping FileAttributePropagation tests because Mac OSX does not support ACL." + if [ "$LOCAL_OS" == "MacOSX" ] || [ "$LOCAL_OS" == "msys" ]; then + echo "Skipping FileAttributePropagation tests because [$LOCAL_OS] does not support ACL." return 0 fi From 696140b575569e10e649b8e4c0ee556543f0ec6d Mon Sep 17 00:00:00 2001 From: deajan Date: Thu, 8 Dec 2016 12:09:52 +0100 Subject: [PATCH 3/4] Another msys fix --- dev/tests/run_tests.sh | 46 +++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/dev/tests/run_tests.sh b/dev/tests/run_tests.sh index 2369b73..0ab6283 100755 --- a/dev/tests/run_tests.sh +++ b/dev/tests/run_tests.sh @@ -7,7 +7,7 @@ ## On CYGWIN / MSYS, ACL and extended attributes aren't supported -# osync test suite 2016120801 +# osync test suite 2016120802 # 4 tests: # quicklocal @@ -974,19 +974,21 @@ function test_Locking () { REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__confLocal]} assertEquals "Should be able to resume locked target with same instance_id in confLocal mode." "0" $? - PrepareLocalDirs - mkdir -p "$TARGET_DIR/$OSYNC_WORKDIR" - echo 65536@quickremote > "$TARGET_DIR/$OSYNC_WORKDIR/lock" + if [ "$LOCAL_OS" != "msys" ]; then + PrepareLocalDirs + mkdir -p "$TARGET_DIR/$OSYNC_WORKDIR" + echo 65536@quickremote > "$TARGET_DIR/$OSYNC_WORKDIR/lock" - REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__quickRemote]} - assertEquals "Should be able to resume locked target with same instance_id in quickRemote mode." "0" $? + REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__quickRemote]} + assertEquals "Should be able to resume locked target with same instance_id in quickRemote mode." "0" $? - PrepareLocalDirs - mkdir -p "$TARGET_DIR/$OSYNC_WORKDIR" - echo 65536@remote > "$TARGET_DIR/$OSYNC_WORKDIR/lock" + PrepareLocalDirs + mkdir -p "$TARGET_DIR/$OSYNC_WORKDIR" + echo 65536@remote > "$TARGET_DIR/$OSYNC_WORKDIR/lock" - REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__confRemote]} - assertEquals "Should be able to resume locked target with same instance_id in confRemote mode." "0" $? + REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__confRemote]} + assertEquals "Should be able to resume locked target with same instance_id in confRemote mode." "0" $? + fi # Remote Target lock present should not be resumed if instance ID is NOT the same as current one, local target lock is resumed PrepareLocalDirs @@ -1003,19 +1005,21 @@ function test_Locking () { REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__confLocal]} assertEquals "Should be able to resume locked local target with bogus instance_id in confLocal mode." "0" $? - PrepareLocalDirs - mkdir -p "$TARGET_DIR/$OSYNC_WORKDIR" - echo 65536@bogusinstance > "$TARGET_DIR/$OSYNC_WORKDIR/lock" + if [ "$LOCAL_OS" != "msys" ]; then + PrepareLocalDirs + mkdir -p "$TARGET_DIR/$OSYNC_WORKDIR" + echo 65536@bogusinstance > "$TARGET_DIR/$OSYNC_WORKDIR/lock" - REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__quickRemote]} - assertEquals "Should not be able to resume remote locked target with bogus instance_id in quickRemote mode." "1" $? + REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__quickRemote]} + assertEquals "Should not be able to resume remote locked target with bogus instance_id in quickRemote mode." "1" $? - PrepareLocalDirs - mkdir -p "$TARGET_DIR/$OSYNC_WORKDIR" - echo 65536@bogusinstance > "$TARGET_DIR/$OSYNC_WORKDIR/lock" + PrepareLocalDirs + mkdir -p "$TARGET_DIR/$OSYNC_WORKDIR" + echo 65536@bogusinstance > "$TARGET_DIR/$OSYNC_WORKDIR/lock" - REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__confRemote]} - assertEquals "Should not be able to resume remote locked target with bogus instance_id in confRemote mode." "1" $? + REMOTE_HOST_PING=no ./$OSYNC_EXECUTABLE ${osyncParameters[$__confRemote]} + assertEquals "Should not be able to resume remote locked target with bogus instance_id in confRemote mode." "1" $? + fi # Target lock present should be resumed if instance ID is NOT the same as current one but FORCE_STRANGER_UNLOCK=yes From 703333798410cd40d5fbb754ad36931a9aec0a2a Mon Sep 17 00:00:00 2001 From: deajan Date: Thu, 8 Dec 2016 20:36:13 +0100 Subject: [PATCH 4/4] Quick fix for remaining tmp file after ParallelExec test --- dev/tests/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/run_tests.sh b/dev/tests/run_tests.sh index 0ab6283..3a85240 100755 --- a/dev/tests/run_tests.sh +++ b/dev/tests/run_tests.sh @@ -276,6 +276,7 @@ function oneTimeTearDown () { #TODO: uncomment this when dev is done #rm -rf "$OSYNC_TESTS_DIR" + rm -f "$TMP_FILE" ELAPSED_TIME=$(($SECONDS - $START_TIME)) echo "It took $ELAPSED_TIME seconds to run these tests." @@ -1195,7 +1196,6 @@ function test_ParallelExec () { cmd="sleep 4;du /none;sleep 3;du /none;sleep 2" ParallelExec 3 "$cmd" false 1 2 .05 7000 true true false ${FUNCNAME[0]} assertNotEquals "ParallelExec full test 3" "0" $? - } function test_timedExecution () {