mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 17:55:16 +00:00
improve profile action test
This commit is contained in:
@@ -74,6 +74,12 @@ dotfiles:
|
|||||||
f_abc:
|
f_abc:
|
||||||
dst: ${tmpd}/abc
|
dst: ${tmpd}/abc
|
||||||
src: abc
|
src: abc
|
||||||
|
f_def:
|
||||||
|
dst: ${tmpd}/def
|
||||||
|
src: def
|
||||||
|
f_ghi:
|
||||||
|
dst: ${tmpd}/ghi
|
||||||
|
src: ghi
|
||||||
profiles:
|
profiles:
|
||||||
p0:
|
p0:
|
||||||
actions:
|
actions:
|
||||||
@@ -82,11 +88,15 @@ profiles:
|
|||||||
- nakedaction
|
- nakedaction
|
||||||
dotfiles:
|
dotfiles:
|
||||||
- f_abc
|
- f_abc
|
||||||
|
- f_def
|
||||||
|
- f_ghi
|
||||||
_EOF
|
_EOF
|
||||||
#cat ${cfg}
|
#cat ${cfg}
|
||||||
|
|
||||||
# create the dotfile
|
# create the dotfile
|
||||||
echo "test" > ${tmps}/dotfiles/abc
|
echo "test" > ${tmps}/dotfiles/abc
|
||||||
|
echo "test" > ${tmps}/dotfiles/def
|
||||||
|
echo "test" > ${tmps}/dotfiles/ghi
|
||||||
|
|
||||||
# install
|
# install
|
||||||
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p0 -V
|
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p0 -V
|
||||||
@@ -97,19 +107,25 @@ cd ${ddpath} | ${bin} install -f -c ${cfg} -p p0 -V
|
|||||||
[ ! -e ${tmpa}/naked ] && echo 'action not executed' && exit 1
|
[ ! -e ${tmpa}/naked ] && echo 'action not executed' && exit 1
|
||||||
|
|
||||||
grep pre2 ${tmpa}/pre2
|
grep pre2 ${tmpa}/pre2
|
||||||
|
nb=`wc -l ${tmpa}/pre2 | awk '{print $1}'`
|
||||||
|
[ "${nb}" != "1" ] && echo "profile action executed multiple times" && exit 1
|
||||||
|
|
||||||
grep post2 ${tmpa}/post2
|
grep post2 ${tmpa}/post2
|
||||||
|
nb=`wc -l ${tmpa}/post2 | awk '{print $1}'`
|
||||||
|
[ "${nb}" != "1" ] && echo "profile action executed multiple times" && exit 1
|
||||||
|
|
||||||
grep naked ${tmpa}/naked
|
grep naked ${tmpa}/naked
|
||||||
|
nb=`wc -l ${tmpa}/naked | awk '{print $1}'`
|
||||||
|
[ "${nb}" != "1" ] && echo "profile action executed multiple times" && exit 1
|
||||||
|
|
||||||
# install again
|
# install again
|
||||||
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p0 -V
|
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p0 -V
|
||||||
|
|
||||||
# check actions not executed twice
|
# check actions not executed twice
|
||||||
nb=`wc -l ${tmpa}/pre2 | awk '{print $1}'`
|
|
||||||
[ "${nb}" -gt "1" ] && echo "action executed twice" && exit 1
|
|
||||||
nb=`wc -l ${tmpa}/post2 | awk '{print $1}'`
|
nb=`wc -l ${tmpa}/post2 | awk '{print $1}'`
|
||||||
[ "${nb}" -gt "1" ] && echo "action executed twice" && exit 1
|
[ "${nb}" -gt "1" ] && echo "action post2 executed twice" && exit 1
|
||||||
nb=`wc -l ${tmpa}/naked | awk '{print $1}'`
|
nb=`wc -l ${tmpa}/naked | awk '{print $1}'`
|
||||||
[ "${nb}" -gt "1" ] && echo "action executed twice" && exit 1
|
[ "${nb}" -gt "1" ] && echo "action naked executed twice" && exit 1
|
||||||
|
|
||||||
## CLEANING
|
## CLEANING
|
||||||
rm -rf ${tmps} ${tmpd} ${tmpa}
|
rm -rf ${tmps} ${tmpd} ${tmpa}
|
||||||
|
|||||||
Reference in New Issue
Block a user