From 4a1001a40ff85e0808aee634b4c0a668c34e3c46 Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 21 May 2019 21:31:15 +0200 Subject: [PATCH 1/3] Set default SSH port for test --- dev/tests/conf/remote.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/conf/remote.conf b/dev/tests/conf/remote.conf index 3dff923..f3d10cc 100644 --- a/dev/tests/conf/remote.conf +++ b/dev/tests/conf/remote.conf @@ -16,7 +16,7 @@ INITIATOR_SYNC_DIR="${HOME}/osync-tests/initiator" ## Target is the system osync synchronizes to (can be the same system as the initiator in case of local sync tasks). The target directory can be a local or remote path. #TARGET_SYNC_DIR="${HOME}/osync-tests/target" -TARGET_SYNC_DIR="ssh://root@localhost:44999/${HOME}/osync-tests/target" +TARGET_SYNC_DIR="ssh://root@localhost:22/${HOME}/osync-tests/target" ## If the target system is remote, you can specify a RSA key (please use full path). If not defined, the default ~/.ssh/id_rsa will be used. See documentation for further information. SSH_RSA_PRIVATE_KEY="${HOME}/.ssh/id_rsa_local" From 9435c48f20199f681eda4dca96b43c2dd895ed88 Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 21 May 2019 22:11:01 +0200 Subject: [PATCH 2/3] Fix newer bash on Windows10 got rid of elder find cmd bug --- dev/ofunctions.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 2334c08..bb96bc0 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -30,8 +30,8 @@ #### OFUNCTIONS FULL SUBSET #### #### OFUNCTIONS MINI SUBSET #### #### OFUNCTIONS MICRO SUBSET #### -_OFUNCTIONS_VERSION=2.3.0-RC2 -_OFUNCTIONS_BUILD=2019031502 +_OFUNCTIONS_VERSION=2.3.0-dev-postRC2 +_OFUNCTIONS_BUILD=2019052102 #### _OFUNCTIONS_BOOTSTRAP SUBSET #### _OFUNCTIONS_BOOTSTRAP=true #### _OFUNCTIONS_BOOTSTRAP SUBSET END #### @@ -1700,7 +1700,7 @@ GetOs ENDSSH if [ $? -ne 0 ]; then - Logger "Cannot connect to remote system [$REMOTE_HOST] port [$REMOTE_PORT]." "CRITICAL" + Logger "Cannot connect to remote system [$REMOTE_HOST] port [$REMOTE_PORT] as [$REMOTE_USER]." "CRITICAL" if [ -f "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP" ]; then Logger "$(cat "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP")" "ERROR" fi @@ -2123,7 +2123,13 @@ function InitLocalOSDependingSettings { ## Getting running processes is quite different ## Ping command is not the same if [ "$LOCAL_OS" == "msys" ] || [ "$LOCAL_OS" == "Cygwin" ] || [ "$LOCAL_OS" == "Microsoft" ] || [ "$LOCAL_OS" == "WinNT10" ]; then - FIND_CMD=$(dirname $BASH)/find + if [ -f "/usr/bin/find" ]; then + FIND_CMD="/usr/bin/find" + elif [ -f "/bin/find" ]; then + FIND_CMD="/bin/find" + else + FIND_CMD="$(dirname $BASH)/find" + fi PING_CMD='$SYSTEMROOT\system32\ping -n 2' # On BSD, when not root, min ping interval is 1s From 3cd2f16bc3c4126ae0c8a28a10921d8ee907ea56 Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 21 May 2019 23:52:26 +0200 Subject: [PATCH 3/3] Fixed newer Win10 bash version ping --- dev/ofunctions.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index bb96bc0..0c19c89 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -31,7 +31,7 @@ #### OFUNCTIONS MINI SUBSET #### #### OFUNCTIONS MICRO SUBSET #### _OFUNCTIONS_VERSION=2.3.0-dev-postRC2 -_OFUNCTIONS_BUILD=2019052102 +_OFUNCTIONS_BUILD=2019052103 #### _OFUNCTIONS_BOOTSTRAP SUBSET #### _OFUNCTIONS_BOOTSTRAP=true #### _OFUNCTIONS_BOOTSTRAP SUBSET END #### @@ -2123,6 +2123,8 @@ function InitLocalOSDependingSettings { ## Getting running processes is quite different ## Ping command is not the same if [ "$LOCAL_OS" == "msys" ] || [ "$LOCAL_OS" == "Cygwin" ] || [ "$LOCAL_OS" == "Microsoft" ] || [ "$LOCAL_OS" == "WinNT10" ]; then + + # Newer bash on Win10 finally uses integrated find command instead of windows one if [ -f "/usr/bin/find" ]; then FIND_CMD="/usr/bin/find" elif [ -f "/bin/find" ]; then @@ -2130,7 +2132,13 @@ function InitLocalOSDependingSettings { else FIND_CMD="$(dirname $BASH)/find" fi - PING_CMD='$SYSTEMROOT\system32\ping -n 2' + + # Newer bash on Windows 10 uses integrated ping whereas cygwin & msys use Windows version + if [ "$LOCAL_OS" == "WinNT10" ]; then + PING_CMD="ping -c 2 -i 1" + else + PING_CMD='$SYSTEMROOT\system32\ping -n 2' + fi # On BSD, when not root, min ping interval is 1s elif [ "$LOCAL_OS" == "BSD" ] && [ "$LOCAL_USER" != "root" ]; then