1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-11 10:14:17 +00:00

improve tests

This commit is contained in:
deadc0de6
2022-05-03 23:13:51 +02:00
committed by deadc0de
parent c31f8ffcd5
commit 3dfa53469e
26 changed files with 108 additions and 71 deletions

View File

@@ -184,6 +184,11 @@ for different use-cases (usually described in their filename or in the file head
Each script starts with the same boilerplate code that you can paste at the Each script starts with the same boilerplate code that you can paste at the
start of your new test (see the head of the file down to `# this is the test`). start of your new test (see the head of the file down to `# this is the test`).
To run the tests on OSX, install following tools with homebrew
```bash
brew install coreutils gnu-sed
```
# Documentation # Documentation
Dotdrop documentation is available under [https://dotdrop.readthedocs.io/](https://dotdrop.readthedocs.io/). Dotdrop documentation is available under [https://dotdrop.readthedocs.io/](https://dotdrop.readthedocs.io/).

View File

@@ -70,9 +70,9 @@ create_conf ${cfg} # sets token
# import # import
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import --verbose -c ${cfg} ${tmpd}/program || exit 1 cd ${ddpath} | ${bin} import -f --verbose -c ${cfg} ${tmpd}/program || exit 1
cd ${ddpath} | ${bin} import --verbose -c ${cfg} ${tmpd}/config || exit 1 cd ${ddpath} | ${bin} import -f --verbose -c ${cfg} ${tmpd}/config || exit 1
cd ${ddpath} | ${bin} import --verbose -c ${cfg} ${tmpd}/vscode || exit 1 cd ${ddpath} | ${bin} import -f --verbose -c ${cfg} ${tmpd}/vscode || exit 1
# add files on filesystem # add files on filesystem
echo "[+] add files" echo "[+] add files"
@@ -149,7 +149,7 @@ mkdir -p ${tmpd}/.zsh/plugins
touch ${tmpd}/.zsh/plugins/someplugin touch ${tmpd}/.zsh/plugins/someplugin
echo "[+] import .zsh" echo "[+] import .zsh"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/.zsh cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/.zsh
# no diff expected # no diff expected
echo "[+] comparing .zsh" echo "[+] comparing .zsh"

View File

@@ -71,9 +71,9 @@ create_conf ${cfg} # sets token
# import # import
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/program cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/program
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/config cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/config
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/vscode cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/vscode
# add files # add files
echo "[+] add files" echo "[+] add files"
@@ -174,7 +174,7 @@ create_conf ${cfg} # sets token
# import # import
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/program ${tmpd}/config ${tmpd}/vscode cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/program ${tmpd}/config ${tmpd}/vscode
# create the files to ignore # create the files to ignore
touch ${tmpd}/program/.DS_Store touch ${tmpd}/program/.DS_Store

View File

@@ -95,8 +95,8 @@ create_conf ${cfg} # sets token
# import dir1 # import dir1
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/dir1 cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/dir1
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/uniquefile cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/uniquefile
cat ${cfg} cat ${cfg}
# let's see the dotpath # let's see the dotpath

View File

@@ -73,7 +73,7 @@ _EOF
# import # import
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/singlefile cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/singlefile
# modify the file # modify the file
echo "modified" > ${tmpd}/singlefile echo "modified" > ${tmpd}/singlefile

View File

@@ -62,7 +62,7 @@ cfg="${basedir}/config.yaml"
create_conf ${cfg} # sets token create_conf ${cfg} # sets token
# import the dir # import the dir
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd} cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}
# change token # change token
echo "changed" > ${token} echo "changed" > ${token}

View File

@@ -90,7 +90,7 @@ mkdir -p ${tmpd}/sub/sub
echo "test2" > ${tmpd}/sub/sub/abc echo "test2" > ${tmpd}/sub/sub/abc
# import # import
cd ${ddpath} | ${bin} import --verbose -c ${cfg} -p p2 \ cd ${ddpath} | ${bin} import -f --verbose -c ${cfg} -p p2 \
${tmpd}/abc \ ${tmpd}/abc \
${tmpd}/sub/abc \ ${tmpd}/sub/abc \
${tmpd}/sub/abc \ ${tmpd}/sub/abc \

View File

@@ -75,7 +75,7 @@ variables:
var1: "this is some test" var1: "this is some test"
var2: "the_dvar4" var2: "the_dvar4"
dynvariables: dynvariables:
dvar1: head -1 /proc/meminfo dvar1: head -1 ${cur}/helpers
dvar2: "echo 'this is some test' | rev | tr ' ' ','" dvar2: "echo 'this is some test' | rev | tr ' ' ','"
dvar3: ${scr} dvar3: ${scr}
dvar4: "echo {{@@ var2 @@}} | rev" dvar4: "echo {{@@ var2 @@}} | rev"
@@ -101,10 +101,12 @@ echo "test" >> ${tmps}/dotfiles/abc
# install # install
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 -V
echo "-----"
cat ${tmpd}/abc cat ${tmpd}/abc
echo "-----"
grep '^this is some test' ${tmpd}/abc >/dev/null grep '^this is some test' ${tmpd}/abc >/dev/null
grep "^MemTotal" ${tmpd}/abc >/dev/null grep '^# author: deadc0de6' ${tmpd}/abc >/dev/null
grep '^tset,emos,si,siht' ${tmpd}/abc >/dev/null grep '^tset,emos,si,siht' ${tmpd}/abc >/dev/null
grep "^${TESTENV}" ${tmpd}/abc > /dev/null grep "^${TESTENV}" ${tmpd}/abc > /dev/null
grep '^4ravd_eht' ${tmpd}/abc >/dev/null grep '^4ravd_eht' ${tmpd}/abc >/dev/null

View File

@@ -75,8 +75,8 @@ _EOF
# import # import
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/program cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/program
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/config cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/config
# add files # add files
echo "[+] add files" echo "[+] add files"

View File

@@ -63,3 +63,33 @@ dotfiles:
profiles: profiles:
_EOF _EOF
} }
# osx tricks
# brew install coreutils gnu-sed
if [[ $OSTYPE == 'darwin'* ]]; then
mktemp() {
gmktemp "$@"
}
stat() {
gstat "$@"
}
sed() {
gsed "$@"
}
wc() {
gwc "$@"
}
date() {
gdate "$@"
}
chmod() {
gchmod "$@"
}
export -f mktemp
export -f stat
export -f sed
export -f wc
export -f date
export -f chmod
fi

View File

@@ -77,17 +77,17 @@ _EOF
#cat ${cfg} #cat ${cfg}
# import # import
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/adir cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/adir
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/file3 cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/file3
echo "import --as dotfiles" echo "import --as dotfiles"
cd ${ddpath} | ${bin} import -c ${cfg} -p p2 -V ${tmpd}/adir --as ~/config/adir cd ${ddpath} | ${bin} import -f -c ${cfg} -p p2 -V ${tmpd}/adir --as ~/config/adir
cd ${ddpath} | ${bin} import -c ${cfg} -p p2 -V ${tmpd}/file3 --as ~/config2/file3 cd ${ddpath} | ${bin} import -f -c ${cfg} -p p2 -V ${tmpd}/file3 --as ~/config2/file3
cat ${cfg} cat ${cfg}
set +e set +e
cd ${ddpath} | ${bin} import -c ${cfg} -p p2 -V ${tmpd}/adir --as ~/config/should_not && echo "dual dst imported" && exit 1 cd ${ddpath} | ${bin} import -f -c ${cfg} -p p2 -V ${tmpd}/adir --as ~/config/should_not && echo "dual dst imported" && exit 1
set -e set -e
cat ${cfg} | grep should_not && echo "dual dst imported" && exit 1 cat ${cfg} | grep should_not && echo "dual dst imported" && exit 1
@@ -137,7 +137,7 @@ dotfiles:
profiles: profiles:
_EOF _EOF
cd ${ddpath} | ${bin} import -b -c ${cfg} -p test -V ~/.dotdrop.test --as=~/.whatever cd ${ddpath} | ${bin} import -f -b -c ${cfg} -p test -V ~/.dotdrop.test --as=~/.whatever
#cat ${cfg} #cat ${cfg}
[ ! -e ~/.dotdrop-dotfiles-test/dotfiles/whatever ] && echo 'tild imported' && exit 1 [ ! -e ~/.dotdrop-dotfiles-test/dotfiles/whatever ] && echo 'tild imported' && exit 1

View File

@@ -93,8 +93,8 @@ _EOF
cat ${cfg} cat ${cfg}
# import # import
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/.mutt/colors cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/.mutt/colors
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/.colors cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/.colors
cat ${cfg} cat ${cfg}

View File

@@ -58,13 +58,13 @@ tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d`
mkdir -p ${tmps}/dotfiles mkdir -p ${tmps}/dotfiles
# the dotfile destination # the dotfile destination
tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d`
mkdir -p ${tmpd}
#echo "dotfile destination: ${tmpd}" #echo "dotfile destination: ${tmpd}"
clear_on_exit "${tmps}" clear_on_exit "${tmps}"
clear_on_exit "${tmpd}" clear_on_exit "${tmpd}"
# dotdrop directory # dotdrop directory
mkdir -p ${tmpd}
mkdir -p ${tmpd}/a/{b,c} mkdir -p ${tmpd}/a/{b,c}
echo 'a' > ${tmpd}/a/b/abfile echo 'a' > ${tmpd}/a/b/abfile
echo 'a' > ${tmpd}/a/c/acfile echo 'a' > ${tmpd}/a/c/acfile
@@ -90,7 +90,7 @@ _EOF
# import # import
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} --verbose --profile=p1 ${tmpd}/a cd ${ddpath} | ${bin} import -c ${cfg} -f --verbose --profile=p1 ${tmpd}/a
[ -d ${tmps}/dotfiles/newdir ] && echo "newdir not ignored" && exit 1 [ -d ${tmps}/dotfiles/newdir ] && echo "newdir not ignored" && exit 1
[ -e ${tmps}/dotfiles/newdir/newfile ] && echo "newfile not ignored" && exit 1 [ -e ${tmps}/dotfiles/newdir/newfile ] && echo "newfile not ignored" && exit 1

View File

@@ -89,7 +89,7 @@ profiles:
_EOF _EOF
# import # import
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V --link=link_children ${dt} cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V --link=link_children ${dt}
# check is set to link_children # check is set to link_children
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "d_`basename ${dt}`" | grep ',link:link_children,' cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "d_`basename ${dt}`" | grep ',link:link_children,'

View File

@@ -96,7 +96,7 @@ profiles:
_EOF _EOF
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 --verbose ${dftoimport} cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 --verbose ${dftoimport}
[ "$?" != "0" ] && exit 1 [ "$?" != "0" ] && exit 1
echo "[+] install" echo "[+] install"

View File

@@ -75,8 +75,8 @@ _EOF
#cat ${cfg} #cat ${cfg}
# import # import
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/adir cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/adir
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/file3 cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/file3
cat ${cfg} cat ${cfg}
@@ -97,8 +97,8 @@ nb=`cat ${cfg} | grep f_file3 | wc -l`
cntpre=`find ${tmps}/dotfiles -type f | wc -l` cntpre=`find ${tmps}/dotfiles -type f | wc -l`
# reimport # reimport
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/adir cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/adir
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/file3 cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/file3
cntpost=`find ${tmps}/dotfiles -type f | wc -l` cntpost=`find ${tmps}/dotfiles -type f | wc -l`
@@ -124,7 +124,7 @@ echo "fil2" > ${d}/file2
mkfifo ${d}/fifo mkfifo ${d}/fifo
# import # import
cd ${ddpath} | ${bin} import -c ${cfg} -p p2 -V ${d} cd ${ddpath} | ${bin} import -f -c ${cfg} -p p2 -V ${d}
# ensure exists and is not link # ensure exists and is not link
[ ! -d ${tmps}/dotfiles/${d} ] && echo "not a directory" && exit 1 [ ! -d ${tmps}/dotfiles/${d} ] && echo "not a directory" && exit 1

View File

@@ -71,9 +71,9 @@ create_conf ${cfg} # sets token
# import # import
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/program cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/program
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/config cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/config
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/vscode cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/vscode
# add files on filesystem # add files on filesystem
echo "[+] add files" echo "[+] add files"
@@ -143,7 +143,7 @@ echo "f1" > ${tmpd}/nvim/dir2/file2
echo "ftop" > ${tmpd}/nvim/ftop echo "ftop" > ${tmpd}/nvim/ftop
echo "[+] import top" echo "[+] import top"
cd ${ddpath} | ${bin} import -c ${cfg} -l link_children -p p1 ${tmpd}/nvim cd ${ddpath} | ${bin} import -f -c ${cfg} -l link_children -p p1 ${tmpd}/nvim
# add sub dir # add sub dir
mkdir -p ${tmpd}/nvim/templated mkdir -p ${tmpd}/nvim/templated
@@ -151,8 +151,8 @@ echo "noprofile" > ${tmpd}/nvim/templated/ftemplated
echo "noprofile" > ${tmpd}/nvim/template echo "noprofile" > ${tmpd}/nvim/template
echo "[+] import sub" echo "[+] import sub"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${tmpd}/nvim/templated cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${tmpd}/nvim/templated
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${tmpd}/nvim/template cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${tmpd}/nvim/template
cfg2="${basedir}/config2.yaml" cfg2="${basedir}/config2.yaml"
sed '/d_nvim:/a \ \ \ \ instignore:\n\ \ \ \ - "*template*"' ${cfg} > ${cfg2} sed '/d_nvim:/a \ \ \ \ instignore:\n\ \ \ \ - "*template*"' ${cfg} > ${cfg2}

View File

@@ -78,8 +78,8 @@ profiles:
_EOF _EOF
# import # import
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/top/.colors cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/top/.colors
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/.mutt/sub cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/.mutt/sub
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | cut -f1 -d',' | grep -q '_top_colors' cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | cut -f1 -d',' | grep -q '_top_colors'
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | cut -f1 -d',' | grep -q '_mutt_sub' cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | cut -f1 -d',' | grep -q '_mutt_sub'
@@ -103,8 +103,8 @@ profiles:
_EOF _EOF
# import # import
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/top/.colors cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/top/.colors
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/.mutt/sub cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/.mutt/sub
cat ${cfg} cat ${cfg}
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G

View File

@@ -73,7 +73,7 @@ profiles:
_EOF _EOF
# import # import
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/abc cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/abc
# checks # checks
inside="${tmps}/dotfiles/${tmpd}/abc" inside="${tmps}/dotfiles/${tmpd}/abc"
@@ -95,7 +95,7 @@ profiles:
_EOF _EOF
# import # import
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/abc cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/abc
# checks # checks
inside="${tmps}/dotfiles/${tmpd}/abc" inside="${tmps}/dotfiles/${tmpd}/abc"

View File

@@ -79,7 +79,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -113,7 +113,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -147,7 +147,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=nolink cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V --link=nolink
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -181,7 +181,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=link cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V --link=link
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -215,7 +215,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -249,7 +249,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=nolink cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V --link=nolink
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -283,7 +283,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=nolink cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V --link=nolink
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -317,7 +317,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=nolink cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V --link=nolink
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -349,7 +349,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} --link=link -p p1 ${df} -V cd ${ddpath} | ${bin} import -f -c ${cfg} --link=link -p p1 ${df} -V
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -382,7 +382,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
set +e set +e
cd ${ddpath} | ${bin} import -c ${cfg} --link=link_children -p p1 ${df} -V cd ${ddpath} | ${bin} import -f -c ${cfg} --link=link_children -p p1 ${df} -V
[ "$?" = "0" ] && echo "link_children with file should fail" && exit 1 [ "$?" = "0" ] && echo "link_children with file should fail" && exit 1
set -e set -e
@@ -410,7 +410,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} --link=link_children -p p1 ${df} -V cd ${ddpath} | ${bin} import -f -c ${cfg} --link=link_children -p p1 ${df} -V
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
@@ -450,7 +450,7 @@ _EOF
# import # import
df="${tmpd}/qwert" df="${tmpd}/qwert"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 ${df} -V
# checks # checks
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V

View File

@@ -82,7 +82,7 @@ variables:
gvar1: "global1" gvar1: "global1"
gvar2: "global2" gvar2: "global2"
dynvariables: dynvariables:
gdvar1: head -1 /proc/meminfo gdvar1: head -1 ${cur}/helpers
gdvar2: "echo 'this is some test' | rev | tr ' ' ','" gdvar2: "echo 'this is some test' | rev | tr ' ' ','"
gdvar3: ${scr} gdvar3: ${scr}
dotfiles: dotfiles:
@@ -123,7 +123,7 @@ grep '^local1' ${tmpd}/abc >/dev/null
grep '^global2' ${tmpd}/abc >/dev/null grep '^global2' ${tmpd}/abc >/dev/null
grep '^local2' ${tmpd}/abc >/dev/null grep '^local2' ${tmpd}/abc >/dev/null
# test dynvariables # test dynvariables
grep "^MemTotal" ${tmpd}/abc >/dev/null grep "^# author: deadc0de6" ${tmpd}/abc >/dev/null
grep '^tset,emos,si,siht' ${tmpd}/abc >/dev/null grep '^tset,emos,si,siht' ${tmpd}/abc >/dev/null
grep "^${TESTENV2}" ${tmpd}/abc > /dev/null grep "^${TESTENV2}" ${tmpd}/abc > /dev/null
grep "^cba" ${tmpd}/abc >/dev/null grep "^cba" ${tmpd}/abc >/dev/null

View File

@@ -68,7 +68,7 @@ tokend="compressed archive"
touched="touched" touched="touched"
cat > ${cfg} << _EOF cat > ${cfg} << _EOF
trans: trans_read:
base64: cat {0} | base64 -d > {1} base64: cat {0} | base64 -d > {1}
uncompress: mkdir -p {1} && tar -xf {0} -C {1} uncompress: mkdir -p {1} && tar -xf {0} -C {1}
trans_write: trans_write:
@@ -85,12 +85,12 @@ dotfiles:
f_abc: f_abc:
dst: ${tmpd}/abc dst: ${tmpd}/abc
src: abc src: abc
trans: base64 trans_read: base64
trans_write: base64 trans_write: base64
d_ghi: d_ghi:
dst: ${tmpd}/ghi dst: ${tmpd}/ghi
src: ghi src: ghi
trans: uncompress trans_read: uncompress
trans_write: compress trans_write: compress
chmod: 700 chmod: 700
profiles: profiles:

View File

@@ -72,8 +72,8 @@ create_conf ${cfg} # sets token
# import dir1 # import dir1
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd} cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpf} cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpf}
# change file # change file
chmod +x ${tmpf} chmod +x ${tmpf}

View File

@@ -73,9 +73,9 @@ create_conf ${cfg} # sets token
# import dir1 # import dir1
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/dir1 cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/dir1
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/uniquefile cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/uniquefile
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/uniquefile2 cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/uniquefile2
# make some modification # make some modification
echo "[+] modify" echo "[+] modify"

View File

@@ -97,8 +97,8 @@ create_conf ${cfg} # sets token
# import dir1 # import dir1
echo "[+] import" echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/dir1 cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/dir1
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/uniquefile cd ${ddpath} | ${bin} import -f -c ${cfg} ${tmpd}/uniquefile
# let's see the dotpath # let's see the dotpath
#tree ${basedir}/dotfiles #tree ${basedir}/dotfiles

View File

@@ -87,7 +87,7 @@ fi
#PYTHONPATH="dotdrop" python3 -m pytest tests #PYTHONPATH="dotdrop" python3 -m pytest tests
# disable debug logs # disable debug logs
unset DOTDROP_DEBUG= unset DOTDROP_DEBUG
export DOTDROP_FORCE_NODEBUG=yes export DOTDROP_FORCE_NODEBUG=yes
tmpworkdir="/tmp/dotdrop-tests-workdir" tmpworkdir="/tmp/dotdrop-tests-workdir"