diff --git a/tests-ng/actions-args.sh b/tests-ng/actions-args.sh index 1baa226..86acd3e 100755 --- a/tests-ng/actions-args.sh +++ b/tests-ng/actions-args.sh @@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the action temp -tmpa=`mktemp -d` +tmpa=`mktemp -d --suffix='-dotdrop-tests'` # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/actions-pre.sh b/tests-ng/actions-pre.sh index 861f734..782bc31 100755 --- a/tests-ng/actions-pre.sh +++ b/tests-ng/actions-pre.sh @@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the action temp -tmpa=`mktemp -d` +tmpa=`mktemp -d --suffix='-dotdrop-tests'` # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/actions.sh b/tests-ng/actions.sh index 8389824..604ea58 100755 --- a/tests-ng/actions.sh +++ b/tests-ng/actions.sh @@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the action temp -tmpa=`mktemp -d` +tmpa=`mktemp -d --suffix='-dotdrop-tests'` # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/compare-ignore.sh b/tests-ng/compare-ignore.sh index 5709f02..d3f992a 100755 --- a/tests-ng/compare-ignore.sh +++ b/tests-ng/compare-ignore.sh @@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # dotdrop directory -basedir=`mktemp -d` +basedir=`mktemp -d --suffix='-dotdrop-tests'` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # some files mkdir -p ${tmpd}/{program,config} diff --git a/tests-ng/compare.sh b/tests-ng/compare.sh index 3f76525..e5fadfe 100755 --- a/tests-ng/compare.sh +++ b/tests-ng/compare.sh @@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # dotdrop directory -basedir=`mktemp -d` +basedir=`mktemp -d --suffix='-dotdrop-tests'` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # single file echo 'unique' > ${tmpd}/uniquefile diff --git a/tests-ng/dir-import-update.sh b/tests-ng/dir-import-update.sh index 8e8a0f6..b2f681e 100755 --- a/tests-ng/dir-import-update.sh +++ b/tests-ng/dir-import-update.sh @@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # dotdrop directory -basedir=`mktemp -d` +basedir=`mktemp -d --suffix='-dotdrop-tests'` dotfiles="${basedir}/dotfiles" echo "dotdrop dir: ${basedir}" # the dotfile -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` create_dir ${tmpd} # create the config file diff --git a/tests-ng/duplicate-key.sh b/tests-ng/duplicate-key.sh index f9fe41a..481dca7 100755 --- a/tests-ng/duplicate-key.sh +++ b/tests-ng/duplicate-key.sh @@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dynactions.sh b/tests-ng/dynactions.sh index 469c519..7ba7963 100755 --- a/tests-ng/dynactions.sh +++ b/tests-ng/dynactions.sh @@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the action temp -tmpa=`mktemp -d` +tmpa=`mktemp -d --suffix='-dotdrop-tests'` # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dyndotfilepaths.sh b/tests-ng/dyndotfilepaths.sh index f768545..4821a3c 100755 --- a/tests-ng/dyndotfilepaths.sh +++ b/tests-ng/dyndotfilepaths.sh @@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dynvariables.sh b/tests-ng/dynvariables.sh index 94ac58e..54b7801 100755 --- a/tests-ng/dynvariables.sh +++ b/tests-ng/dynvariables.sh @@ -46,15 +46,15 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` #echo "dotfile destination: ${tmpd}" # create a shell script export TESTENV="this is my testenv" -scr=`mktemp` +scr=`mktemp --suffix='-dotdrop-tests'` chmod +x ${scr} echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr} diff --git a/tests-ng/header.sh b/tests-ng/header.sh index 66c245d..fd70c08 100755 --- a/tests-ng/header.sh +++ b/tests-ng/header.sh @@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles #echo "dotfile source: ${tmps}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/ignore-empty.sh b/tests-ng/ignore-empty.sh index 75676d1..aa45fca 100755 --- a/tests-ng/ignore-empty.sh +++ b/tests-ng/ignore-empty.sh @@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles #echo "dotfile source: ${tmps}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/include.sh b/tests-ng/include.sh index 2523ec1..c91c05d 100755 --- a/tests-ng/include.sh +++ b/tests-ng/include.sh @@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/jhelpers.sh b/tests-ng/jhelpers.sh index 059ab90..a6bc816 100755 --- a/tests-ng/jhelpers.sh +++ b/tests-ng/jhelpers.sh @@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/link-templates-dir-home.sh b/tests-ng/link-templates-dir-home.sh index 3207140..a0ae016 100755 --- a/tests-ng/link-templates-dir-home.sh +++ b/tests-ng/link-templates-dir-home.sh @@ -46,7 +46,7 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles echo "dotfiles source (dotpath): ${tmps}" # the dotfile destination diff --git a/tests-ng/link-templates-dir.sh b/tests-ng/link-templates-dir.sh index 6909f89..6699e5b 100755 --- a/tests-ng/link-templates-dir.sh +++ b/tests-ng/link-templates-dir.sh @@ -46,14 +46,14 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles echo "dotfiles source (dotpath): ${tmps}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` echo "dotfiles destination: ${tmpd}" # the workdir -tmpw=`mktemp -d` +tmpw=`mktemp -d --suffix='-dotdrop-tests'` echo "workdir: ${tmpw}" diff --git a/tests-ng/link-templates.sh b/tests-ng/link-templates.sh index 3945fa8..fb87d58 100755 --- a/tests-ng/link-templates.sh +++ b/tests-ng/link-templates.sh @@ -46,14 +46,14 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles echo "dotfiles source (dotpath): ${tmps}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` echo "dotfiles destination: ${tmpd}" # the workdir -tmpw=`mktemp -d` +tmpw=`mktemp -d --suffix='-dotdrop-tests'` echo "workdir: ${tmpw}" diff --git a/tests-ng/profile-dynvariables.sh b/tests-ng/profile-dynvariables.sh index 1940bb6..62a3ac1 100755 --- a/tests-ng/profile-dynvariables.sh +++ b/tests-ng/profile-dynvariables.sh @@ -46,20 +46,20 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` #echo "dotfile destination: ${tmpd}" # create a shell script export TESTENV="this is my global testenv" -scr=`mktemp` +scr=`mktemp --suffix='-dotdrop-tests'` chmod +x ${scr} echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr} export TESTENV2="this is my profile testenv" -scr2=`mktemp` +scr2=`mktemp --suffix='-dotdrop-tests'` chmod +x ${scr2} echo -e "#!/bin/bash\necho $TESTENV2\n" >> ${scr2} diff --git a/tests-ng/recvariables.sh b/tests-ng/recvariables.sh index ad913cb..6cced8a 100755 --- a/tests-ng/recvariables.sh +++ b/tests-ng/recvariables.sh @@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/transformations.sh b/tests-ng/transformations.sh index 8c729db..2fc4551 100755 --- a/tests-ng/transformations.sh +++ b/tests-ng/transformations.sh @@ -48,11 +48,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles echo "dotfiles source (dotpath): ${tmps}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` echo "dotfiles destination: ${tmpd}" # create the config file @@ -98,7 +98,7 @@ _EOF cat ${cfg} # create the base64 dotfile -tmpf=`mktemp` +tmpf=`mktemp --suffix='-dotdrop-tests'` echo ${token} > ${tmpf} cat ${tmpf} | base64 > ${tmps}/dotfiles/abc rm -f ${tmpf} @@ -107,7 +107,7 @@ rm -f ${tmpf} echo 'marker' > ${tmps}/dotfiles/def # create the compressed dotfile -tmpx=`mktemp -d` +tmpx=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmpx}/{a,b,c} mkdir -p ${tmpx}/a/{dir1,dir2} # ambiguous redirect ?? @@ -184,7 +184,7 @@ cd ${ddpath} | ${bin} update -f -k -c ${cfg} -p p1 -b -V d_ghi tar -tf ${tmps}/dotfiles/ghi | grep './b/newfile' tar -tf ${tmps}/dotfiles/ghi | grep './a/dir1/otherfile' -tmpy=`mktemp -d` +tmpy=`mktemp -d --suffix='-dotdrop-tests'` tar -xf ${tmps}/dotfiles/ghi -C ${tmpy} content=`cat ${tmpy}/a/somefile` [ "${content}" != "${touched}" ] && exit 1 diff --git a/tests-ng/update-ignore.sh b/tests-ng/update-ignore.sh index 077bdea..866dc20 100755 --- a/tests-ng/update-ignore.sh +++ b/tests-ng/update-ignore.sh @@ -46,7 +46,7 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # dotdrop directory -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` dt="${tmps}/dotfiles" mkdir -p ${dt} mkdir -p ${dt}/a/{b,c} @@ -54,7 +54,7 @@ echo 'a' > ${dt}/a/b/abfile echo 'a' > ${dt}/a/c/acfile # fs dotfiles -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` cp -r ${dt}/a ${tmpd}/ # create the config file diff --git a/tests-ng/update-templates.sh b/tests-ng/update-templates.sh index 8fafa76..cfa635a 100755 --- a/tests-ng/update-templates.sh +++ b/tests-ng/update-templates.sh @@ -46,14 +46,14 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles echo "dotfiles source (dotpath): ${tmps}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` echo "dotfiles destination: ${tmpd}" # the workdir -tmpw=`mktemp -d` +tmpw=`mktemp -d --suffix='-dotdrop-tests'` echo "workdir: ${tmpw}" diff --git a/tests-ng/update-with-key.sh b/tests-ng/update-with-key.sh index fb2c5fd..c852aa9 100755 --- a/tests-ng/update-with-key.sh +++ b/tests-ng/update-with-key.sh @@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # dotdrop directory -basedir=`mktemp -d` +basedir=`mktemp -d --suffix='-dotdrop-tests'` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # originally imported directory echo 'unique' > ${tmpd}/uniquefile diff --git a/tests-ng/update.sh b/tests-ng/update.sh index 8e8495a..45339e1 100755 --- a/tests-ng/update.sh +++ b/tests-ng/update.sh @@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # dotdrop directory -basedir=`mktemp -d` +basedir=`mktemp -d --suffix='-dotdrop-tests'` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` # single file echo 'unique' > ${tmpd}/uniquefile diff --git a/tests-ng/variables.sh b/tests-ng/variables.sh index 27819ef..357351a 100755 --- a/tests-ng/variables.sh +++ b/tests-ng/variables.sh @@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" ################################################################ # the dotfile source -tmps=`mktemp -d` +tmps=`mktemp -d --suffix='-dotdrop-tests'` mkdir -p ${tmps}/dotfiles #echo "dotfile source: ${tmps}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/workdir.sh b/tests-ng/workdir.sh index 13592d6..bee36f0 100755 --- a/tests-ng/workdir.sh +++ b/tests-ng/workdir.sh @@ -47,7 +47,7 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m" string="blabla" # the dotfile source -tmp=`mktemp -d` +tmp=`mktemp -d --suffix='-dotdrop-tests'` tmpf="${tmp}/dotfiles" tmpw="${tmp}/workdir" @@ -62,7 +62,7 @@ cfg="${tmp}/config.yaml" echo "config file: ${cfg}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` echo "dotfiles destination: ${tmpd}" ## RELATIVE @@ -104,7 +104,7 @@ rm -rf ${tmp} ${tmpd} ## ABSOLUTE echo "RUNNING ABSOLUTE" # the dotfile source -tmp=`mktemp -d` +tmp=`mktemp -d --suffix='-dotdrop-tests'` tmpf="${tmp}/dotfiles" tmpw="${tmp}/workdir" @@ -119,7 +119,7 @@ cfg="${tmp}/config.yaml" echo "config file: ${cfg}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` echo "dotfiles destination: ${tmpd}" cat > ${cfg} << _EOF @@ -159,7 +159,7 @@ rm -rf ${tmp} ${tmpd} ## NONE echo "RUNNING UNDEFINED WORKDIR" # the dotfile source -tmp=`mktemp -d` +tmp=`mktemp -d --suffix='-dotdrop-tests'` tmpf="${tmp}/dotfiles" @@ -171,7 +171,7 @@ cfg="${tmp}/config.yaml" echo "config file: ${cfg}" # the dotfile destination -tmpd=`mktemp -d` +tmpd=`mktemp -d --suffix='-dotdrop-tests'` echo "dotfiles destination: ${tmpd}" cat > ${cfg} << _EOF diff --git a/tests/helpers.py b/tests/helpers.py index 637e646..a372f97 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -37,7 +37,7 @@ def get_string(length): def get_tempdir(): """Get a temporary directory""" - return tempfile.mkdtemp(suffix=TMPSUFFIX) + return tempfile.mkdtemp(prefix='dotdrop-tests-') def create_random_file(directory, content=None,