Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deadc0de6 committed Sep 7, 2023
1 parent 41d8e58 commit 0959d5a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests-ng/import-with-trans.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ cd "${ddpath}" | ${bin} import -f -c "${cfg}" -p p1 -b -V --transw=base64 --tran
# import directory (to compress)
cd "${ddpath}" | ${bin} import -f -c "${cfg}" -p p1 -b -V --transw=compress --transr=decompress "${tmpd}"/def
# import file (to encrypt)
#cd "${ddpath}" | ${bin} import -f -c "${cfg}" -p p1 -b -V --transw=encrypt --transr=decrypt "${tmpd}"/ghi
cd "${ddpath}" | ${bin} import -f -c "${cfg}" -p p1 -b -V --transw=encrypt --transr=decrypt "${tmpd}"/ghi

# check file imported in dotpath
[ ! -e "${tmps}"/dotfiles/"${tmpd}"/abc ] && echo "abc does not exist" && exit 1
[ ! -e "${tmps}"/dotfiles/"${tmpd}"/def ] && echo "def does not exist" && exit 1
#[ ! -e "${tmps}"/dotfiles/"${tmpd}"/ghi ] && echo "ghi does not exist" && exit 1
[ ! -e "${tmps}"/dotfiles/"${tmpd}"/ghi ] && echo "ghi does not exist" && exit 1

# check content in dotpath
echo "checking content"
Expand All @@ -105,7 +105,7 @@ echo "checking imported in config"
cd "${ddpath}" | ${bin} -p p1 -c "${cfg}" files
cd "${ddpath}" | ${bin} -p p1 -c "${cfg}" files | grep '^f_abc'
cd "${ddpath}" | ${bin} -p p1 -c "${cfg}" files | grep '^d_def'
#cd "${ddpath}" | ${bin} -p p1 -c "${cfg}" files | grep '^f_ghi'
cd "${ddpath}" | ${bin} -p p1 -c "${cfg}" files | grep '^f_ghi'

# check has trans_write and trans_read in config
echo "checking trans_write is set in config"
Expand All @@ -114,17 +114,17 @@ cat "${cfg}"
echo "--------------"
cat "${cfg}" | grep -A 4 'f_abc:' | grep 'trans_write: base64'
cat "${cfg}" | grep -A 4 'd_def:' | grep 'trans_write: compress'
#cat "${cfg}" | grep -A 4 'f_ghi:' | grep 'trans_write: encrypt'
cat "${cfg}" | grep -A 4 'f_ghi:' | grep 'trans_write: encrypt'

cat "${cfg}" | grep -A 4 'f_abc:' | grep 'trans_read: base64'
cat "${cfg}" | grep -A 4 'd_def:' | grep 'trans_read: decompress'
#cat "${cfg}" | grep -A 4 'f_ghi:' | grep 'trans_read: decrypt'
cat "${cfg}" | grep -A 4 'f_ghi:' | grep 'trans_read: decrypt'

# install these
echo "install and check"
rm "${tmpd}"/abc
rm -r "${tmpd}"/def
#rm "${tmpd}"/ghi
rm "${tmpd}"/ghi

cd "${ddpath}" | ${bin} install -f -c "${cfg}" -p p1 -b -V

Expand All @@ -133,15 +133,15 @@ echo "check exist"
[ ! -e "${tmpd}"/abc ] && exit 1
[ ! -d "${tmpd}"/def/a ] && exit 1
[ ! -e "${tmpd}"/def/a/file ] && exit 1
#[ ! -e "${tmpd}"/ghi ] && exit 1
[ ! -e "${tmpd}"/ghi ] && exit 1

# test content
echo "check content"
cat "${tmpd}"/abc
cat "${tmpd}"/abc | grep "${token}"
cat "${tmpd}"/def/a/file
cat "${tmpd}"/def/a/file | grep "${tokend}"
#cat "${tmpd}"/ghi | grep "${tokenenc}"
cat "${tmpd}"/ghi | grep "${tokenenc}"

echo "OK"
exit 0

0 comments on commit 0959d5a

Please sign in to comment.