diff --git a/test/borg.bats b/test/borg.bats index e26428e..84def7a 100644 --- a/test/borg.bats +++ b/test/borg.bats @@ -137,7 +137,7 @@ finish_borg() { greplog 'Debug: executing borg create$' "'${BN_SRCDIR}'$" # multiple paths - setconfig_repeat backup.d/test.borg include "$BN_SRCDIR" /foo /bar + setconfig_repeat backup.d/test.borg source include "$BN_SRCDIR" /foo /bar testaction test.borg [ "$status" -eq 0 ] greplog 'Debug: executing borg create$' "'${BN_SRCDIR}' '/foo' '/bar'$" @@ -157,7 +157,7 @@ finish_borg() { greplog 'Debug: executing borg create$' "\s--exclude '${BN_SRCDIR}/var'\s" # multiple paths - setconfig_repeat backup.d/test.borg exclude "$BN_SRCDIR/var" "$BN_SRCDIR/foo" "$BN_SRCDIR/bar" + setconfig_repeat backup.d/test.borg source exclude "$BN_SRCDIR/var" "$BN_SRCDIR/foo" "$BN_SRCDIR/bar" testaction test.borg [ "$status" -eq 0 ] greplog 'Debug: executing borg create$' "\s--exclude '${BN_SRCDIR}/var' --exclude '${BN_SRCDIR}/foo' --exclude '${BN_SRCDIR}/bar'\s" diff --git a/test/common.bash b/test/common.bash index 0237e3e..e18b394 100644 --- a/test/common.bash +++ b/test/common.bash @@ -95,12 +95,14 @@ setconfig() { # (used for include and exclude parameters) setconfig_repeat() { conffile="${BATS_TMPDIR}/$1" - param="$2" - shift; shift; - for p in "$@"; do - conf="${conf}${param} = ${p}\n" + section="$2" + param="$3" + shift 3 + crudini --del "$conffile" "$section" "$param" + for v; do + crudini --set --list --list-sep=$'\nREPEAT = ' "$conffile" "$section" "$param" "$v" done - sed -i "s#^${param} =.*#${conf}#" "${conffile}" + sed -i "s#^\s\+REPEAT =#${param} =#" "${conffile}" } # delete config parameter diff --git a/test/dup.bats b/test/dup.bats index 59e510c..77b5afd 100644 --- a/test/dup.bats +++ b/test/dup.bats @@ -141,7 +141,7 @@ finish_dup() { greplog 'Debug: executing duplicity$' "\s--include '${BN_SRCDIR}'" # multiple paths - setconfig_repeat backup.d/test.dup include "$BN_SRCDIR" /foo /bar + setconfig_repeat backup.d/test.dup source include "$BN_SRCDIR" /foo /bar testaction test.dup [ "$status" -eq 0 ] greplog 'Debug: executing duplicity$' "\s--include '${BN_SRCDIR}' --include '/foo' --include '/bar'\s" @@ -161,7 +161,7 @@ finish_dup() { greplog 'Debug: executing duplicity$' "\s--exclude '${BN_SRCDIR}/var'\s" # multiple paths - setconfig_repeat backup.d/test.dup exclude "$BN_SRCDIR/var" "$BN_SRCDIR/foo" "$BN_SRCDIR/bar" + setconfig_repeat backup.d/test.dup source exclude "$BN_SRCDIR/var" "$BN_SRCDIR/foo" "$BN_SRCDIR/bar" testaction test.dup [ "$status" -eq 0 ] greplog 'Debug: executing duplicity$' "\s--exclude '${BN_SRCDIR}/var' --exclude '${BN_SRCDIR}/foo' --exclude '${BN_SRCDIR}/bar'\s"