1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-11 03:49:16 +00:00

more tests

This commit is contained in:
deadc0de6
2020-11-09 22:24:21 +01:00
parent c608a8e868
commit 500db8d0db

View File

@@ -6,6 +6,9 @@
# with files and directories # with files and directories
# with different link # with different link
# #
# TODO
# - test for symlink templates
# - check for mode difference when install
# exit on first error # exit on first error
set -e set -e
@@ -62,6 +65,14 @@ echo 'link' > ${tmps}/dotfiles/link
mkdir -p ${tmps}/dotfiles/dir mkdir -p ${tmps}/dotfiles/dir
echo "f1" > ${tmps}/dotfiles/dir/f1 echo "f1" > ${tmps}/dotfiles/dir/f1
echo "exists" > ${tmps}/dotfiles/exists
chmod 644 ${tmps}/dotfiles/exists
echo "exists" > ${tmpd}/exists
chmod 644 ${tmpd}/exists
echo "existslink" > ${tmps}/dotfiles/existslink
chmod 644 ${tmpd}/exists
cat > ${cfg} << _EOF cat > ${cfg} << _EOF
config: config:
backup: true backup: true
@@ -81,12 +92,27 @@ dotfiles:
src: dir src: dir
dst: ${tmpd}/dir dst: ${tmpd}/dir
chmod: 777 chmod: 777
f_exists:
src: exists
dst: ${tmpd}/exists
chmod: 777
f_existslink:
src: existslink
dst: ${tmpd}/existslink
chmod: 777
link: link
profiles: profiles:
p1: p1:
dotfiles: dotfiles:
- f_f777 - f_f777
- f_link - f_link
- d_dir - d_dir
- f_exists
- f_existslink
p2:
dotfiles:
- f_exists
- f_existslink
_EOF _EOF
#cat ${cfg} #cat ${cfg}
@@ -102,6 +128,27 @@ mode=`stat -c '%a' "${tmpd}/link"`
mode=`stat -c '%a' "${tmpd}/dir"` mode=`stat -c '%a' "${tmpd}/dir"`
[ "${mode}" != "777" ] && echo "bad mode for dir" && exit 1 [ "${mode}" != "777" ] && echo "bad mode for dir" && exit 1
mode=`stat -c '%a' "${tmpd}/exists"`
[ "${mode}" != "777" ] && echo "bad mode for exists" && exit 1
mode=`stat -c '%a' "${tmpd}/existslink"`
[ "${mode}" != "777" ] && echo "bad mode for existslink" && exit 1
echo "exists" > ${tmps}/dotfiles/exists
chmod 644 ${tmps}/dotfiles/exists
echo "exists" > ${tmpd}/exists
chmod 644 ${tmpd}/exists
chmod 644 ${tmpd}/existslink
cd ${ddpath} | ${bin} install -c ${cfg} -p p2 -V ${i}
mode=`stat -c '%a' "${tmpd}/exists"`
[ "${mode}" != "777" ] && echo "bad mode for exists" && exit 1
mode=`stat -c '%a' "${tmpd}/existslink"`
[ "${mode}" != "777" ] && echo "bad mode for existslink" && exit 1
## CLEANING ## CLEANING
rm -rf ${tmps} ${tmpd} rm -rf ${tmps} ${tmpd}