|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
|
|
|
|
|
## On CYGWIN / MSYS, ACL and extended attributes aren't supported
|
|
|
|
|
|
|
|
|
|
# osync test suite 2017020701
|
|
|
|
|
# osync test suite 2017020702
|
|
|
|
|
|
|
|
|
|
# 4 tests:
|
|
|
|
|
# quicklocal
|
|
|
|
@ -74,34 +74,36 @@ OSYNC_IS_STABLE=maybe
|
|
|
|
|
# Setup an array with all function modes
|
|
|
|
|
#declare -Ag osyncParameters
|
|
|
|
|
|
|
|
|
|
function GetConfFileValue () {
|
|
|
|
|
local file="${1}"
|
|
|
|
|
local name="${2}"
|
|
|
|
|
local value
|
|
|
|
|
|
|
|
|
|
value=$(grep "^$name=" "$file")
|
|
|
|
|
if [ $? == 0 ]; then
|
|
|
|
|
value="${value##*=}"
|
|
|
|
|
echo "$value"
|
|
|
|
|
else
|
|
|
|
|
assertEquals "$name does not exist in [$file]." "1" "0"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function SetConfFileValue () {
|
|
|
|
|
local file="${1}"
|
|
|
|
|
local name="${2}"
|
|
|
|
|
local value="${3}"
|
|
|
|
|
|
|
|
|
|
if grep "^$name=" "$file" > /dev/null; then
|
|
|
|
|
# Using -i.tmp for BSD compat
|
|
|
|
|
sed -i.tmp "s/^$name=.*/$name=$value/" "$file"
|
|
|
|
|
rm -f "$file.tmp"
|
|
|
|
|
assertEquals "Set $name to [$value]." "0" $?
|
|
|
|
|
else
|
|
|
|
|
assertEquals "$name does not exist in [$file]." "1" "0"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
## Moved to ofunctions.sh
|
|
|
|
|
#function GetConfFileValue () {
|
|
|
|
|
# local file="${1}"
|
|
|
|
|
# local name="${2}"
|
|
|
|
|
# local value
|
|
|
|
|
#
|
|
|
|
|
# value=$(grep "^$name=" "$file")
|
|
|
|
|
# if [ $? == 0 ]; then
|
|
|
|
|
# value="${value##*=}"
|
|
|
|
|
# echo "$value"
|
|
|
|
|
# else
|
|
|
|
|
# assertEquals "$name does not exist in [$file]." "1" "0"
|
|
|
|
|
# fi
|
|
|
|
|
#}
|
|
|
|
|
|
|
|
|
|
#function SetConfFileValue () {
|
|
|
|
|
# local file="${1}"
|
|
|
|
|
# local name="${2}"
|
|
|
|
|
# local value="${3}"
|
|
|
|
|
#
|
|
|
|
|
# if grep "^$name=" "$file" > /dev/null; then
|
|
|
|
|
# # Using -i.tmp for BSD compat
|
|
|
|
|
# sed -i.tmp "s/^$name=.*/$name=$value/" "$file"
|
|
|
|
|
# rm -f "$file.tmp"
|
|
|
|
|
# assertEquals "Set $name to [$value]." "0" $?
|
|
|
|
|
# else
|
|
|
|
|
# assertEquals "$name does not exist in [$file]." "1" "0"
|
|
|
|
|
# fi
|
|
|
|
|
#}
|
|
|
|
|
|
|
|
|
|
function SetupSSH {
|
|
|
|
|
echo -e 'y\n'| ssh-keygen -t rsa -b 2048 -N "" -f "${HOME}/.ssh/id_rsa_local"
|
|
|
|
|